text
stringlengths
4
6.14k
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DESCRIBERULESPACKAGESRESPONSE_P_H #define QTAWS_DESCRIBERULESPACKAGESRESPONSE_P_H #include "inspectorresponse_p.h" namespace QtAws { namespace Inspector { class DescribeRulesPackagesResponse; class DescribeRulesPackagesResponsePrivate : public InspectorResponsePrivate { public: explicit DescribeRulesPackagesResponsePrivate(DescribeRulesPackagesResponse * const q); void parseDescribeRulesPackagesResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(DescribeRulesPackagesResponse) Q_DISABLE_COPY(DescribeRulesPackagesResponsePrivate) }; } // namespace Inspector } // namespace QtAws #endif
/*------------------------------------------------------------------------------------*\ /$$$$$$ /$$ /$$__ $$ | $$ /$$$$$$ /$$$$$$ /$$$$$$ | $$ \__/ /$$$$$$$ /$$$$$$ | $$ /$$$$$$ /$$__ $$ |____ $$ /$$__ $$| $$$$$$ /$$_____/ |____ $$| $$ /$$__ $$ | $$ \ $$ /$$$$$$$| $$ \__/ \____ $$| $$ /$$$$$$$| $$| $$$$$$$$ | $$ | $$ /$$__ $$| $$ /$$ \ $$| $$ /$$__ $$| $$| $$_____/ | $$$$$$$/| $$$$$$$| $$ | $$$$$$/| $$$$$$$| $$$$$$$| $$| $$$$$$$ | $$____/ \_______/|__/ \______/ \_______/ \_______/|__/ \_______/ | $$ | $$ |__/ A Compilation of Particle Scale Models Copyright (C): 2014 DCS Computing GmbH (www.dcs-computing.com), Linz, Austria 2014 Graz University of Technology (ippt.tugraz.at), Graz, Austria --------------------------------------------------------------------------------------- License ParScale is licensed under the GNU LESSER GENERAL PUBLIC LICENSE (LGPL). Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. You should have received a copy of the GNU Lesser General Public License along with ParScale. If not, see <http://www.gnu.org/licenses/lgpl.html>. This code is designed to simulate transport processes (e.g., for heat and mass) within porous and no-porous particles, eventually undergoing chemical reactions. Parts of the code were developed in the frame of the NanoSim project funded by the European Commission through FP7 Grant agreement no. 604656. \*-----------------------------------------------------------------------------------*/ #ifndef PASC_SIMULATION_STATE_H #define PASC_SIMULATION_STATE_H #include "stdio.h" #include "pascal_base.h" namespace PASCAL_NS { class SimulationState : public ParScaleBase { public: SimulationState(ParScale *ptr); void setDeltaT(double _dt) { deltaT_ = _dt; } void setOutputTimeStep(double _dt) { deltaT_writeContainers_ = _dt; time_writeContainers_ = time_ + _dt ; } void progress_time(double _dt) { time_ += _dt; time_step_++; } inline double time() { return time_; } inline double deltaT() { return deltaT_; } inline int timeStep() { return time_step_; } inline bool writeContainers() { if(time_ >= time_writeContainers_) { time_writeContainers_ += deltaT_writeContainers_; return true; } return false; } private: double time_; //the current time double deltaT_; //the time step int time_step_; //the current integration step //I/O information double deltaT_writeContainers_; //the time intervall for writing containers double time_writeContainers_; //the next time for writing containers }; } //end PASCAL_NS #endif
// Created file "Lib\src\Uuid\X64\imapi2uuid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IFsiNamedStreams, 0xed79ba56, 0x5294, 0x4250, 0x8d, 0x46, 0xf9, 0xae, 0xce, 0xe2, 0x34, 0x59);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTTAPEPOOLSREQUEST_P_H #define QTAWS_LISTTAPEPOOLSREQUEST_P_H #include "storagegatewayrequest_p.h" #include "listtapepoolsrequest.h" namespace QtAws { namespace StorageGateway { class ListTapePoolsRequest; class ListTapePoolsRequestPrivate : public StorageGatewayRequestPrivate { public: ListTapePoolsRequestPrivate(const StorageGatewayRequest::Action action, ListTapePoolsRequest * const q); ListTapePoolsRequestPrivate(const ListTapePoolsRequestPrivate &other, ListTapePoolsRequest * const q); private: Q_DECLARE_PUBLIC(ListTapePoolsRequest) }; } // namespace StorageGateway } // namespace QtAws #endif
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> //#include "nuc2num.h" //#include "hashfuc.h" //#include "statfreq.h" int hashfuc(char *string,int mer); int nuc2num(char s); int main(){ //get the reference from the reference file. // while (){ // } //reference example char *ref; const int MER=16; size_t SIZE_ref = (int)*(pow(2,31)) ref = (char *)malloc(SIZE_ref); //frequents container int *fre; int i,len_fre=(int)pow(4,MER); size_t SIZE = len_fre*sizeof(int); fre = (int *)malloc(SIZE); //frequents initantization for (i=0;i<len_fre;i++){ *(fre+i)=0; } //statfreq(ref,MER,fre); for (i=0;i<(strlen(ref)-MER+1);i++){ *(fre+hashfuc((ref+i),MER))+=1; } //print the frequents result for (i=0; i<len_fre; i++){ printf("%d\t",*(fre+i)); } //free the memory free(fre); return 0; } int hashfuc(char *string,int mer){ /* input is a substring of a reference or read, len is the length of the string. output is a integer to be used as an address of the index array following. example: "AAA" --> 0 "ATA" --> 4 "AAT" --> 1 "ATT" --> 5 "AAC" --> 2 "ATC" --> 6 "AAG" --> 3 "ATG" --> 7 The real string has a length of 16. */ int sum=0,loc=mer,i; char tmp; for (i=0; i< mer; i++){ tmp=*(string+i); sum+= (int)pow(4,(double)(loc-1))*nuc2num(tmp); loc-=1; } return sum; } int nuc2num(char s){ /* input is a char type of nucletide such as "A","a","T","t","C","c","G","g" output is a number of the nucletide. example: "A" --> 0 "a" --> 0 "T" --> 1 "t" --> 1 "C" --> 2 "c" --> 2 "G" --> 3 "g" --> 3 */ switch(s){ case 'A': return 0; case 'a': return 0; case 'T': return 1; case 't': return 1; case 'C': return 2; case 'c': return 2; case 'G': return 3; case 'g': return 3; default: printf("Error happens in nuc2num(). Please check your input!\n"); return -1; } }
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTPIPELINEEXECUTIONSREQUEST_P_H #define QTAWS_LISTPIPELINEEXECUTIONSREQUEST_P_H #include "codepipelinerequest_p.h" #include "listpipelineexecutionsrequest.h" namespace QtAws { namespace CodePipeline { class ListPipelineExecutionsRequest; class ListPipelineExecutionsRequestPrivate : public CodePipelineRequestPrivate { public: ListPipelineExecutionsRequestPrivate(const CodePipelineRequest::Action action, ListPipelineExecutionsRequest * const q); ListPipelineExecutionsRequestPrivate(const ListPipelineExecutionsRequestPrivate &other, ListPipelineExecutionsRequest * const q); private: Q_DECLARE_PUBLIC(ListPipelineExecutionsRequest) }; } // namespace CodePipeline } // namespace QtAws #endif
/******************************************************************** * Copyright © 2016 Computational Molecular Biology Group, * * Freie Universität Berlin (GER) * * * * This file is part of ReaDDy. * * * * ReaDDy is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation, either version 3 of * * the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General * * Public License along with this program. If not, see * * <http://www.gnu.org/licenses/>. * ********************************************************************/ /** * << detailed description >> * * @file TopologyFusionReaction.h * @brief << brief description >> * @author clonker * @date 23.06.17 * @copyright GNU Lesser General Public License v3.0 */ #pragma once #include <readdy/common/macros.h> #include <readdy/common/common.h> #include <readdy/common/ParticleTypeTuple.h> #include <readdy/model/topologies/TopologyParticleTypeMap.h> #include <readdy/common/string.h> NAMESPACE_BEGIN(readdy) NAMESPACE_BEGIN(model) NAMESPACE_BEGIN(top) class TopologyRegistry; NAMESPACE_BEGIN(reactions) /** * TT - Topology-Topology * TP - Topology-Particle */ enum class STRMode { TT_ENZYMATIC = 0, TT_FUSION, TT_FUSION_ALLOW_SELF, TP_ENZYMATIC, TP_FUSION }; class STRParser; class SpatialTopologyReaction { public: SpatialTopologyReaction(std::string name, util::particle_type_pair types, topology_type_pair top_types, util::particle_type_pair types_to, topology_type_pair top_types_to, scalar rate, scalar radius, STRMode mode) : _name(std::move(name)), _types(std::move(types)), _types_to(std::move(types_to)), _rate(rate), _radius(radius), _mode(mode), _top_types(std::move(top_types)), _top_types_to(std::move(top_types_to)) {}; ~SpatialTopologyReaction() = default; SpatialTopologyReaction(const SpatialTopologyReaction &) = default; SpatialTopologyReaction &operator=(const SpatialTopologyReaction &) = default; SpatialTopologyReaction(SpatialTopologyReaction &&) = default; SpatialTopologyReaction &operator=(SpatialTopologyReaction &&) = default; const std::string &name() const { return _name; } const particle_type_type type1() const { return std::get<0>(_types); } const particle_type_type type2() const { return std::get<1>(_types); } const util::particle_type_pair &types() const { return _types; } const particle_type_type type_to1() const { return std::get<0>(_types_to); } const particle_type_type type_to2() const { return std::get<1>(_types_to); } const util::particle_type_pair &types_to() const { return _types_to; } const topology_type_type top_type1() const { return std::get<0>(_top_types); } const topology_type_type top_type2() const { return std::get<1>(_top_types); } const topology_type_type top_type_to1() const { return std::get<0>(_top_types_to); } const topology_type_type top_type_to2() const { return std::get<1>(_top_types_to); } bool is_topology_particle_reaction() const { return top_type2() == topology_type_empty; } bool is_topology_topology_reaction() const { return !is_topology_particle_reaction(); } const bool is_enzymatic() const { return _mode == STRMode::TT_ENZYMATIC || _mode == STRMode::TP_ENZYMATIC; } const bool is_fusion() const { return _mode == STRMode::TT_FUSION || _mode == STRMode::TT_FUSION_ALLOW_SELF || _mode == STRMode::TP_FUSION; } const scalar rate() const { return _rate; } const scalar radius() const { return _radius; } const bool allow_self_connection() const { return _mode == STRMode::TT_FUSION_ALLOW_SELF; } const STRMode &mode() const { return _mode; } private: friend class STRParser; SpatialTopologyReaction() = default; std::string _name; util::particle_type_pair _types; util::particle_type_pair _types_to; topology_type_pair _top_types; topology_type_pair _top_types_to; scalar _rate{0}; scalar _radius{0}; STRMode _mode{STRMode::TP_ENZYMATIC}; }; class STRParser { public: explicit STRParser(const TopologyRegistry &registry) : _topology_registry(registry) {}; /** * Pass descriptor of form for Topology<->Topology * - fusion type: * name: T1 (p1) + T2 (p2) -> T3 (p3--p4) [self=true|false] * - enzymatic type: * name: T1 (p1) + T2 (p2) -> T3 (p3) + T4 (p4) * * and for Topology<->Particle * - fusion type: * name: T1 (p1) + (p2) -> T2 (p3--p4) * - enzymatic type: * name: T1 (p1) + (p2) -> T2 (p3) + (p4) * * @param descriptor the descriptor * @param rate the rate * @param radius the radius * @return the parsed reaction object */ SpatialTopologyReaction parse(const std::string &descriptor, scalar rate, scalar radius) const; private: std::reference_wrapper<const TopologyRegistry> _topology_registry; }; NAMESPACE_END(reactions) NAMESPACE_END(top) NAMESPACE_END(model) NAMESPACE_END(readdy)
#ifndef DIR_EXPLORER_H #define DIR_EXPLORER_H #include <glib.h> typedef struct dir_explorer_s { gint64 dir_count; gint64 dir_index; GSList *src_dir_list; GSList *src_dir_cursor; GDir* src_dir_ptr; } dir_explorer_t; /** * Callback function for dir_next_match * * @param path A complete file or directory path * @return True if path matches criteria, False otherwise */ typedef gboolean (*dir_explorer_match)(gchar *path, gpointer user_data); GError* dir_explore(gchar* current_path, dir_explorer_t *iter); gint dir_progress(dir_explorer_t *exp); gchar *dir_next_match(dir_explorer_t *exp, GPatternSpec *exclude_pattern, dir_explorer_match, gpointer user_data); gchar *dir_next_file(dir_explorer_t *exp, gchar *exclude_dir_pattern); void dir_explorer_clean(dir_explorer_t *exp); #endif
#ifndef _GS_NODE_H_ #define _GS_NODE_H_ #include "gs_types.h" #include "gs_common.h" #include "gs_element.h" #include "gs_edge.h" #ifdef __cplusplus extern "C" { #endif struct _node { GSElement parent; GSGraph *graph; uint edge_count; GList *edges; }; #define GS_NODE(e) ((GSNode*)CHECK_TYPE(e,NODE_TYPE)) GSAPI GSNode* gs_node_create(GSGraph *graph, const gsid id); GSAPI void gs_node_destroy(GSNode *node); GSAPI void gs_node_edge_register(GSNode *node, GSEdge *edge); GSAPI GSIterator* gs_node_edge_iterator_new(const GSNode *node); #ifdef __cplusplus } #endif #endif /* _GS_NODE_H_ */
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_STOPMONITORINGMEMBERSREQUEST_P_H #define QTAWS_STOPMONITORINGMEMBERSREQUEST_P_H #include "guarddutyrequest_p.h" #include "stopmonitoringmembersrequest.h" namespace QtAws { namespace GuardDuty { class StopMonitoringMembersRequest; class StopMonitoringMembersRequestPrivate : public GuardDutyRequestPrivate { public: StopMonitoringMembersRequestPrivate(const GuardDutyRequest::Action action, StopMonitoringMembersRequest * const q); StopMonitoringMembersRequestPrivate(const StopMonitoringMembersRequestPrivate &other, StopMonitoringMembersRequest * const q); private: Q_DECLARE_PUBLIC(StopMonitoringMembersRequest) }; } // namespace GuardDuty } // namespace QtAws #endif
/* ========================================================================= * This file is part of NITRO * ========================================================================= * * (C) Copyright 2004 - 2010, General Dynamics - Advanced Information Systems * * NITRO is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, If not, * see <http://www.gnu.org/licenses/>. * */ #include "nitf/LookupTable.h" NITFAPI(nitf_LookupTable *) nitf_LookupTable_construct(nitf_Uint32 tables, nitf_Uint32 entries, nitf_Error * error) { nitf_LookupTable *lt = NULL; lt = (nitf_LookupTable *) NITF_MALLOC(sizeof(nitf_LookupTable)); if (!lt) { nitf_Error_init(error, NITF_STRERROR(NITF_ERRNO), NITF_CTXT, NITF_ERR_MEMORY); return NULL; } lt->tables = tables; lt->entries = entries; lt->table = NULL; if (!nitf_LookupTable_init(lt, tables, entries, NULL, error)) { nitf_LookupTable_destruct(&lt); lt = NULL; } return lt; } NITFAPI(nitf_LookupTable *) nitf_LookupTable_clone(nitf_LookupTable * donor, nitf_Error * error) { nitf_LookupTable *lt; if (!donor) { nitf_Error_initf(error, NITF_CTXT, NITF_ERR_INVALID_OBJECT, "Trying to clone NULL pointer"); return NULL; } if (!(donor->tables * donor->entries)) { nitf_Error_initf(error, NITF_CTXT, NITF_ERR_INVALID_OBJECT, "Trying to clone bad LUT (size)"); return NULL; } if (!donor->table) { nitf_Error_initf(error, NITF_CTXT, NITF_ERR_INVALID_OBJECT, "Trying to clone bad LUT (pointer)"); return NULL; } lt = nitf_LookupTable_construct(donor->tables, donor->entries, error); if (lt) { memcpy(lt->table, donor->table, (donor->tables * donor->entries)); } return lt; } NITFAPI(void) nitf_LookupTable_destruct(nitf_LookupTable ** lt) { if (*lt) { if ((*lt)->table) { NITF_FREE((*lt)->table); } NITF_FREE((*lt)); *lt = NULL; } } NITFAPI(NITF_BOOL) nitf_LookupTable_init(nitf_LookupTable * lut, nitf_Uint32 numTables, nitf_Uint32 numEntries, const NITF_DATA * tables, nitf_Error * error) { /* Look for existing table of a different size */ if (lut->tables != numTables || lut->entries != numEntries) { NITF_FREE(lut->table); lut->table = NULL; } lut->tables = numTables; lut->entries = numEntries; /* only create the table data if we really should */ if (numTables > 0 && numEntries > 0) { if (!lut->table) { lut->table = (nitf_Uint8 *) NITF_MALLOC(numTables * numEntries); if (!lut->table) { nitf_Error_initf(error, NITF_CTXT, NITF_ERR_MEMORY, "Error allocating look-up table"); return NITF_FAILURE; } } /* only copy if one existed */ if (tables) { memcpy(lut->table, tables, numTables * numEntries); } } else { lut->table = NULL; } return NITF_SUCCESS; }
#ifndef JMPIRBUILDER_H #define JMPIRBUILDER_H #include "BaseIRBuilder.h" #include "EflagsBuilder.h" #include "Inst.h" #include "OneOperandTemplate.h" class JmpIRBuilder: public BaseIRBuilder, public OneOperandTemplate { public: JmpIRBuilder(uint64 address, const std::string &disassembly); // From BaseIRBuilder virtual Inst *process(AnalysisProcessor &ap) const; // From OneOperandTemplate virtual void none(AnalysisProcessor &ap, Inst &inst) const; virtual void reg(AnalysisProcessor &ap, Inst &inst) const; virtual void imm(AnalysisProcessor &ap, Inst &inst) const; virtual void mem(AnalysisProcessor &ap, Inst &inst) const; }; #endif // JMPIRBUILDER_H
#ifndef TST_KEINTERNETXPLORERTEST_H #define TST_KEINTERNETXPLORERTEST_H #include <QString> #include <QtTest> #include <QCoreApplication> #include "keinternetexplorer.h" class KEInternetExplorerTest : public QObject { Q_OBJECT public: KEInternetExplorerTest(); private Q_SLOTS: void initTestCase(); void cleanupTestCase(); void get(); void get_data(); void post(); void post_data(); private: KEInternetExplorer* ie; }; #endif // TST_KEINTERNETXPLORERTEST_H
/* String.h - String ** https://github.com/hubenchang0515/Luminous ** ** Copyright (C) 2017 hubenchang0515 ** Date : 2017-8-23 ** E-mail : hubenchang0515@outlook.com ** Blog : blog.kurukurumi.com ** LISENCE : LGPL v3.0 */ #ifndef LUMINOUS_STRING_H #define LUMINOUS_STRING_H #include "core.h" #ifdef __cplusplus extern "C" { #endif typedef struct StringInfo* String; typedef struct StringInfo StringInfo; struct StringInfo { size_t space; // space of String char* data; // pointer to first character }; /* Create String */ String stringCreate(const char* cstr); /* Delete String */ void stringDelete(String string); /* Length of String */ size_t stringLength(String string); /* Resize space of String */ bool_t stringResize(String string, size_t size); /* Reduce space of String */ void stringReduce(String string); /* Copy a String */ String stringCopy(String string); /* Return C style String of String */ const char* stringValue(String string); /* Return data pointer of String */ char* stringData(String string); /* Set Value */ bool_t stringSetValue(String string, const char* cstr); /* Get value */ void stringGetValue(String string, char* cstr, size_t len); /* Remove some data */ bool_t stringRemove(String string, size_t site, size_t len); /* Append C style String */ bool_t stringAppend(String string, const char* cstr); /* Insert C style String */ bool_t stringInsert(String string, size_t site, const char* cstr); /* Repalce by C style String */ bool_t stringReplace(String string, size_t site, size_t len, const char* cstr); /* Append String */ bool_t stringAppendL(String string, String lstr); /* Insert String */ bool_t stringInsertL(String string, String lstr); /* Repalce by String */ bool_t stringReplaceL(String string, size_t site, size_t len, String lstr); /* Set String as sprintf */ bool_t stringSprintf(String string, const char* fmt,...); #ifdef __cplusplus } #endif #endif // LUMINOUS_STRING_H
#ifndef PAXOS_NET #define PAXOS_NET #include "capitalC.h" #include "msg.h" #include "types.h" port_t init_server(port_t port = 0); void setNodeAddr(nid_t nid, addr_t* addr); bool send_msg(const struct msg* msg, nid_t nid); // non-NULL pointers from next_* need to be passed to free() // blocking struct msg* next_msg(); // blocking, returns NULL on hangup only struct msg* next_msg_same(); // nonblocking struct msg* next_msg_now(); // source of last message nid_t msg_source(); // orderly shutdown void shutdown_server(); #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_GETTABLEREQUEST_P_H #define QTAWS_GETTABLEREQUEST_P_H #include "gluerequest_p.h" #include "gettablerequest.h" namespace QtAws { namespace Glue { class GetTableRequest; class GetTableRequestPrivate : public GlueRequestPrivate { public: GetTableRequestPrivate(const GlueRequest::Action action, GetTableRequest * const q); GetTableRequestPrivate(const GetTableRequestPrivate &other, GetTableRequest * const q); private: Q_DECLARE_PUBLIC(GetTableRequest) }; } // namespace Glue } // namespace QtAws #endif
/* * Copyright (C) 2011 ~ 2019 Deepin Technology Co., Ltd. * * Author: andywang <wangwei_cm@deepin.com> * * Maintainer: andywang <wangwei_cm@deepin.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TOUCHPADSETTINGWIDGET_H #define TOUCHPADSETTINGWIDGET_H #include "interface/namespace.h" #include "widgets/contentwidget.h" namespace dcc { namespace mouse { class MouseModel; class MouseWorker; class DouTestWidget; class PalmDetectSetting; } namespace widgets { class SettingsGroup; class SwitchWidget; class TitledSliderItem; } } namespace DCC_NAMESPACE { namespace mouse { class TouchPadSettingWidget : public QWidget { Q_OBJECT public: explicit TouchPadSettingWidget(QWidget *parent = nullptr); void setModel(dcc::mouse::MouseModel *const model); Q_SIGNALS: void requestSetTouchpadMotionAcceleration(const int value); void requestSetTapClick(const bool state); void requestSetTouchNaturalScroll(const bool state); void requestDetectState(bool enable); void requestContact(int value); void requestPressure(int value); private Q_SLOTS: void onTouchMoveSpeedChanged(int speed); private: dcc::mouse::MouseModel *m_mouseModel; dcc::mouse::PalmDetectSetting *m_palmDetectSetting; dcc::widgets::TitledSliderItem *m_touchMoveSlider; dcc::widgets::SwitchWidget *m_touchClickStn; dcc::widgets::SwitchWidget *m_touchNaturalScroll; QVBoxLayout *m_contentLayout; }; } } #endif // TOUCHPADSETTINGWIDGET_H
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_TAGRESOURCERESPONSE_H #define QTAWS_TAGRESOURCERESPONSE_H #include "dynamodbresponse.h" #include "tagresourcerequest.h" namespace QtAws { namespace DynamoDB { class TagResourceResponsePrivate; class QTAWSDYNAMODB_EXPORT TagResourceResponse : public DynamoDBResponse { Q_OBJECT public: TagResourceResponse(const TagResourceRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const TagResourceRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(TagResourceResponse) Q_DISABLE_COPY(TagResourceResponse) }; } // namespace DynamoDB } // namespace QtAws #endif
#ifndef STRINGREPLACER_H #define STRINGREPLACER_H #include <QString> #include <QPair> #include <QList> class QSqlDatabase; class StringReplacer { public: static StringReplacer *getInstance(); void addPair (const QString &rWildcard, const QString &rReplacementString); const QString getReplacementString (const QString &rWildcard); void removeEntry (const QString &rWildcard); const QString findAndReplaceWildcards (QString in); void findAndReplaceWildcards(QString *in); void clear (); void setUser (QString user); private: StringReplacer(void); ~StringReplacer(void); bool getFromDb (QString *pString, const QString &rWildcard); bool getFromCommon (QString *pString, const QString &rWildcard); //QSqlDatabase* mDb; typedef QPair<QString, QString> QStringPair; typedef QList<QStringPair> QStringPairList; QString mUser; }; #endif // STRINGREPLACER_H
/*------------------------------------------------------------------------- * * create_shards.h * * Declarations for public functions and types related to shard creation * functionality. * * Copyright (c) 2014-2015, Citus Data, Inc. * *------------------------------------------------------------------------- */ #ifndef PG_SHARD_CREATE_SHARDS_H #define PG_SHARD_CREATE_SHARDS_H #include "postgres.h" #include "c.h" #include "fmgr.h" #include "postgres_ext.h" #include "nodes/pg_list.h" /* name for the file containing worker node and port information */ #define WORKER_LIST_FILENAME "pg_worker_list.conf" /* transaction related commands used in talking to the worker nodes */ #define BEGIN_COMMAND "BEGIN" #define COMMIT_COMMAND "COMMIT" #define ROLLBACK_COMMAND "ROLLBACK" /* in-memory representation of a worker node */ typedef struct WorkerNode { uint32 nodePort; char *nodeName; } WorkerNode; /* utility functions declaration shared within this module */ extern List * SortList(List *pointerList, int (*ComparisonFunction)(const void *, const void *)); extern Oid ResolveRelationId(text *relationName); /* function declarations for initializing a distributed table */ extern Datum master_create_distributed_table(PG_FUNCTION_ARGS); extern Datum master_create_worker_shards(PG_FUNCTION_ARGS); #endif /* PG_SHARD_CREATE_SHARDS_H */
// Created file "tmp\src\dxguid\dxguid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(TID_D3DRMFrame, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
// Created file "Lib\src\Uuid\X64\shguids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IFolderViewOC, 0x9ba05970, 0xf6a8, 0x11cf, 0xa4, 0x42, 0x00, 0xa0, 0xc9, 0x0a, 0x8f, 0x39);
/** * * Phantom OS * * Copyright (C) 2005-2019 Dmitry Zavalishin, dz@dz.ru * * .internal.http class implementation * * See <https://github.com/dzavalishin/phantomuserland/wiki/InternalClasses> * See <https://github.com/dzavalishin/phantomuserland/wiki/InternalMethodWritingGuide> * **/ #define DEBUG_MSG_PREFIX "vm.sysc.udp" #include <debug_ext.h> #define debug_level_flow 0 #define debug_level_error 1 #define debug_level_info 0 #include <phantom_libc.h> #include <vm/syscall_net.h> #include <vm/alloc.h> #include <kernel/snap_sync.h> #include <kernel/net.h> #include <kernel/json.h> #include <errno.h> static int debug_print = 0; static int si_http_tostring_5( pvm_object_t me, pvm_object_t *ret, struct data_area_4_thread *tc, int n_args, pvm_object_t *args ) { (void) me; DEBUG_INFO; SYSCALL_RETURN( pvm_create_string_object( "http" )); } static int si_http_resolve_16( pvm_object_t me, pvm_object_t *ret, struct data_area_4_thread *tc, int n_args, pvm_object_t *args ) { (void) me; //struct data_area_4_udp *da = pvm_data_area( me, udp ); DEBUG_INFO; CHECK_PARAM_COUNT(1); //int addr = AS_INT(args[0]); //(void) addr; //SYSCALL_PUT_THIS_THREAD_ASLEEP() SYSCALL_THROW_STRING( "not implemented" ); } syscall_func_t syscall_table_4_http[18] = { &si_void_0_construct, &si_void_1_destruct, &si_void_2_class, &si_void_3_clone, &si_void_4_equals, &si_http_tostring_5, &si_void_6_toXML, &si_void_7_fromXML, // 8 &invalid_syscall, &invalid_syscall, &invalid_syscall, &invalid_syscall, &invalid_syscall, &invalid_syscall, &invalid_syscall, &si_void_15_hashcode, // 16 &si_http_resolve_16, &invalid_syscall, //&invalid_syscall, &si_http_send_19, //&invalid_syscall, &si_http_recv_21, // 24 //&invalid_syscall, &si_http_recvfrom_23, //&invalid_syscall, &si_http_sendto_25, }; DECLARE_SIZE(http); void pvm_internal_init_http(pvm_object_t os) { struct data_area_4_http *da = (struct data_area_4_http *)os->da; (void) da; //da->connected = 0; } pvm_object_t pvm_create_http_object(void) { return pvm_create_object( pvm_get_http_class() ); } void pvm_gc_iter_http(gc_iterator_call_t func, pvm_object_t os, void *arg) { struct data_area_4_http *da = (struct data_area_4_http *)os->da; (void) da; //gc_fcall( func, arg, ot ); //gc_fcall( func, arg, da->p_kernel_state_object ); //gc_fcall( func, arg, da->callback ); } void pvm_gc_finalizer_http( pvm_object_t os ) { // is it called? struct data_area_4_http *da = (struct data_area_4_http *)os->da; (void) da; } void pvm_restart_http( pvm_object_t o ) { struct data_area_4_http *da = pvm_object_da( o, http ); //da->connected = 0; //if( da->connected ) { printf("restarting HTTP - unimpl!"); } }
/* * Low level reading functions * * Copyright (C) 2006-2021, Joachim Metz <joachim.metz@gmail.com> * * Refer to AUTHORS for acknowledgements. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ #if !defined( _LIBEWF_READ_IO_HANDLE_H ) #define _LIBEWF_READ_IO_HANDLE_H #include <common.h> #include <types.h> #include "libewf_chunk_data.h" #include "libewf_io_handle.h" #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libfcache.h" #include "libewf_libfdata.h" #include "libewf_media_values.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_read_io_handle libewf_read_io_handle_t; struct libewf_read_io_handle { /* Cached version of the case data */ uint8_t *case_data; /* Size of the cached version of the case data */ size_t case_data_size; /* Cached version of the device information */ uint8_t *device_information; /* Size of the cached version of the device information */ size_t device_information_size; /* The storage media size read */ size64_t storage_media_size_read; /* The (total) number of chunks read */ uint64_t number_of_chunks_read; }; int libewf_read_io_handle_initialize( libewf_read_io_handle_t **read_io_handle, libcerror_error_t **error ); int libewf_read_io_handle_free( libewf_read_io_handle_t **read_io_handle, libcerror_error_t **error ); int libewf_read_io_handle_clone( libewf_read_io_handle_t **destination_read_io_handle, libewf_read_io_handle_t *source_read_io_handle, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBEWF_READ_IO_HANDLE_H ) */
// ext_drag.h copyright 2008 cycling '74 // functions for handling drag-and-drop from the max file browser (but not from the mac finder) #ifndef __EXT_DRAG_H__ #define __EXT_DRAG_H__ BEGIN_USING_C_LINKAGE enum { JDRAG_MATCHFLAGS_ANY = 1 // any item with this role is OK, default is that all must match }; typedef struct _jdrag_inquiry { t_symbol *i_role; // kind of file that works (one inquiry per file kind) t_symbol *i_prepend; // corresponding message } t_jdrag_inquiry; char *jdrag_getitemstring(t_object *dg, long index, long quote, long backslash); t_object *jdrag_getobject(t_object *dg, long index); void jdrag_getlocation(t_object *dg, long index, double *xpos, double *ypos); t_object *jdrag_createobject(t_object *dg, t_object *pv, void *d, long dragobjectindex); t_object *jdrag_createnewobj(t_object *dg, t_object *pv, char *classname, char *str); t_object *jdrag_createmessage(t_object *dg, t_object *pv, t_symbol *msg, long ac, t_atom *av); // dg the jdrag object // rcv the jbox which will have a message called when the dragged thing is released // msg the message name that will be sent to the box when the dragged thing is released // desc a description to be displayed in a contextual menu for the drop action // arg user data to be passed to the drag function (for example, the t_symbol* of the message to call in the case of jdrag_box_add()) void jdrag_add(t_object *dg, t_object *rcv, t_symbol *msg, char *desc, void *arg); long jdrag_matchdragrole(t_object *dx, t_symbol *role, long flags); void jdrag_setboxlocation(t_object *dg, t_object *box); void jdrag_object_add(t_object *dg, t_object *obj, t_symbol *msg); // a wrapper around jbox_add() used by most ui objects; demonstrated in the pictmeter~ example project in the sdk void jdrag_box_add(t_object *dg, t_object *box, t_symbol *msg); END_USING_C_LINKAGE #endif // __EXT_DRAG_H__
/****************************************************************************** * Copyright (C) 2011 by Jerome Maye * * jerome.maye@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the Lesser GNU General Public License as published by* * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * Lesser GNU General Public License for more details. * * * * You should have received a copy of the Lesser GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ /** \file Distribution.h \brief This file contains an interface to any kind of distributions */ #ifndef DISTRIBUTION_H #define DISTRIBUTION_H #include "functions/Function.h" /** The Distribution class represents an interface to any kind of distributions. \brief Distribution */ template <typename X> class Distribution : public virtual Function<double, X> { /** \name Private constructors @{ */ /// Copy constructor Distribution(const Distribution& other); /// Assignment operator Distribution& operator = (const Distribution& other); /** @} */ public: /** \name Types @{ */ /// Random variable type typedef typename Function<double, X>::Domain RandomVariable; /** @} */ /** \name Constructors/destructor @{ */ /// Default constructor Distribution(); /// Destructor virtual ~Distribution(); /** @} */ protected: }; #include "statistics/Distribution.tpp" #endif // DISTRIBUTION_H
#pragma once class ScreenDisplay; class Layer { public: Layer(void); ~Layer(void); string* LayerName; int ShapeType; virtual void setLayerName(string* name); // »æÖÆÍ¼²ã virtual int Draw(ScreenDisplay* display); };
# 1 "continueStatement.c" int continueStatementFunction() { while(0) { continue; } return 0; }
// Created file "Lib\src\ADSIid\X64\guid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(DB_NULLID, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
// Created file "Lib\src\dxguid\d3d9guid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(GUID_STANDBY_TIMEOUT, 0x29f6c1db, 0x86da, 0x48c5, 0x9f, 0xdb, 0xf2, 0xb6, 0x7b, 0x1f, 0x44, 0xda);
/* * Ringbuffer with median of samples calculation for small sample counts * Copyright (C) 2018 Sakari Kapanen * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <stdbool.h> #include <stdint.h> #include <stddef.h> typedef struct { size_t sample_count; size_t next_index; size_t middle1; size_t middle2; int32_t buffer[]; } samplebuffer_t; // Allocate and initialize ring buffer. Free it with free() samplebuffer_t* samplebuffer_init(size_t sample_count); void samplebuffer_add_sample(samplebuffer_t* buffer, int32_t value); void samplebuffer_reset(samplebuffer_t* buffer, int32_t value); // Performs an insertion sort of the samples and calculates the median // from there. int32_t samplebuffer_median(samplebuffer_t* buffer);
#ifndef _LISTE_H_ #define _LISTE_H_ #include "Balise.h" namespace CppCgi { namespace IgCgi { namespace IU { namespace EListe { enum Type { Ordonnee, NonOrdonnee }; } class Liste : public Balise { public: Liste(const std::string& identifiant, EListe::Type type_liste, Objet* parent = NULL); virtual ~Liste(); }; } } } // namespace #endif
#pragma once #include "Region.h" class ClusterElement { public: ClusterElement(); virtual ~ClusterElement(); virtual bool Init(const Rect& box, bool isPrimary=false, bool doubleBuffer=false); virtual void SetVisible(bool visible); virtual bool GetVisible() { return mVisible; }; // Invalidate the area of this element indicated by the rectangle. // NOTE : 'box' is in screen coordinates virtual void Invalidate(const Rect& box); // Invalidate the area of this element indicated by the region. // NOTE : 'region' is in screen coordinates virtual void Invalidate(const Region& region); // Set the location of this element virtual void SetLocation(const Point& loc); virtual Region Update(); virtual Region Draw(); virtual void DrawLabel(); virtual void DrawLabelImage(); void AddGradientStop(float position, uint8_t a, uint8_t r, uint8_t g, uint8_t b); void SetGradientAngle(int16_t angle); GraphicsContext& GetGraphicsContext() { return mGfx; }; Rect GetClientRect() { return mClientRect; }; void SetLabelText(std::string label) { mLabelText = label; }; void SetLabelCenter(Point loc) { mLabelCenter = loc; }; void SetTextColor(Color32 color) { mTextColor = color; }; void SetLabelImage(BMPImage* image) { mLabelImage = image; }; void SetImage(BMPImage* image) { mImage = image; }; void SetImageAlpha(uint8_t alpha) { mImageAlpha = alpha; }; void SetLabelImageCenter(Point loc) { mLabelImageCenter = loc; }; protected: bool mVisible; // NOTE : the "ALIGN" below. ARM does not like un-aligned memory access Rect mClientRect ALIGN; //!< The bounds for this element in client space (upper left is 0,0) GraphicsContext mGfx; Region mForegroundDirtyRegion; //!< The portion of our foreground that needs to be redrawn Region mBackgroundDirtyRegion; //!< The portion of our background that needs to be redrawn Region mScreenDirtyRegion; //!< The portion of the object below us that needs to be redrawn //!< NOTE : this is in screen coordinates, not client Region mTempRegion; //!< Temp storage region. Never assume this contains anything valid! std::vector<GradientStop> mGradientStops; bool mStateChanged; int16_t mGradientAngle ALIGN; std::string mLabelText; //!< The text label for this element Point mLabelCenter; //!< The location of the center of the label Color32 mTextColor; //!< Color for text - labels, etc. BMPImage* mLabelImage; //!< The label image for this element Point mLabelImageCenter; //!< The location of the center of the label image BMPImage* mImage; //!< The image for this element (if any) uint8_t mImageAlpha; //!< Global alpha value to apply to image, or eOpaque int16_t mImageAlphaCurrent; //!< If we are fading in/out, this is the current val };
#ifndef _BCM2835_MAILBOX_H #define _BCM2835_MAILBOX_H #include <stdint.h> #define MAILBOX_BASE 0x2000B880 #define MAILBOX_POLL 0x10 #define MAILBOX_SENDER 0x14 #define MAILBOX_STATUS 0x18 #define MAILBOX_CONFIG 0x1C #define MAILBOX_WRITE 0x20 #define EMMC_CLOCK_ID 0x01 #define UART_CLOCK_ID 0x02 #define ARM_CLOCK_ID 0x03 #define CORE_CLOCK_ID 0x04 #define V3D_CLOCK_ID 0x05 #define H264_CLOCK_ID 0x06 #define ISP_CLOCK_ID 0x07 #define SDRAM_CLOCK_ID 0x08 #define PIXEL_CLOCK_ID 0x09 #define PWM_CLOCK_ID 0x0A #define MAILBOX_ARM_TO_VC 8 #define MAILBOX_SUCCESS 0x80000000 #define MAILBOX_TIMEOUT 100 /* * Synchronously write to the mailbox. * uint32_t data. * uint8_t channel. */ void mailbox_write(uint32_t data, uint8_t channel); /* * Synchronously read from the mailbox. * uint8_t channel. * * Returns: * uint32_t. */ uint32_t mailbox_read(uint8_t channel); #endif /* _BCM2835_MAILBOX_H */
#ifndef _GAMETREE_H #define _GAMETREE_H #include <vector> #include "board.h" using namespace std; class gameTree { public: struct move { int from, to; int moveValue; }; enum status { CHECK, CHECKMATE, STALEMATE}; gameTree (); move findMove (int ply, board::colors currentPlayer, int alpha, int beta, vector< vector <board::placement> > boardState); int boardScore (const vector< vector <board::placement> > &boardState); inline int unitValue (board::unitTypes type); move randomMove (board::colors aiPlayer, const vector< vector <board::placement> > &boardState); status boardState(board::colors currentPlayer, const vector< vector <board::placement> > &boardState); bool isAttacked (board::colors currentPlayer, const vector< vector <board::placement> > &boardState, int location); virtual ~gameTree (); private: }; #endif /* _GAMETREE_H */
@class BBObserver, BBBulletin; @interface SBLockScreenNotificationListController : UIViewController - (void)observer:(BBObserver *)observer addBulletin:(BBBulletin *)bulletin forFeed:(NSUInteger)feed; - (void)observer:(BBObserver *)observer addBulletin:(BBBulletin *)bulletin forFeed:(NSUInteger)feed playLightsAndSirens:(BOOL)playLightsAndSirens withReply:(id)reply; @end
#ifndef FORM_TENTANG_H #define FORM_TENTANG_H #include <QDialog> namespace Ui { class form_tentang; } class form_tentang : public QDialog { Q_OBJECT public: explicit form_tentang(QWidget *parent = 0); ~form_tentang(); private slots: void on_btnTutup_clicked(); void on_btnLisensi_clicked(); void on_btnKembali_clicked(); private: Ui::form_tentang *ui; }; #endif // FORM_TENTANG_H
#ifndef EVAPPLICATION_H #define EVAPPLICATION_H #include <QObject> #include "EvGlobal.h" class EvApplicationPrivate; class EvApplicationSettings; class EvMessagesManager; class EvJobsManager; class EvApplicationArgumentsManager; class EvIconsFactory ; class EvSession; class EvPluginsManager; class QAction; class EvObject; class EvApplicationObjects; class EvApplicationDocumentation; #define evApp EvApplication::instance() class EvApplication : public QObject { Q_OBJECT Q_PROPERTY(QStringList pluginsDirectories READ pluginsDirectories WRITE setPluginsDirectories) Q_PROPERTY(bool defaultYesNoQuestionReply READ defaultYesNoQuestionReply WRITE setDefaultYesNoQuestionReply NOTIFY defaultYesNoQuestionReplyChanged) public: enum Mode { Batch, Graphical }; EvApplication(); ~EvApplication(); Mode mode()const; void create(); static EvApplication *instance(); QStringList pluginsDirectories() const; void setPluginsDirectories(const QStringList & arg); void loadPlugins(); void loadPluginsFromDirectory(const QString & path); void loadPluginsFromLibrary(const QString & path); EvApplicationObjects * applicationObjects()const; bool isObjectValid(EvObject*)const; EvMessagesManager* messagesManager()const; EvApplicationSettings* settings()const; EvJobsManager* jobsManager()const; EvApplicationArgumentsManager* argumentsManager()const; EvIconsFactory* iconsFactory()const; EvPluginsManager *pluginsManager()const; EvApplicationDocumentation * documentation()const; EvSession* currentSession()const; bool defaultYesNoQuestionReply() const; public Q_SLOTS: void setDefaultYesNoQuestionReply(bool arg); Q_SIGNALS: void defaultYesNoQuestionReplyChanged(bool arg); protected: void handleArguments(); void runScript(const QString & path); private: EV_PRIVATE(EvApplication) }; #endif // EVAPPLICATION_H
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/vespalib/data/input_reader.h> #include "string.h" namespace vbench { using Input = vespalib::Input; /** * Concrete utility class used to read individual lines of text from * an underlying input. This class is implemented in terms of the * ByteInput class. **/ class LineReader { public: using InputReader = vespalib::InputReader; private: InputReader _input; public: /** * Wrap an Input to read one line at a time. * * @param input the underlying Input **/ LineReader(Input &input); /** * Read the next line of input. Lines are separated by '\n'. '\r' * appearing directly in from of '\n' will be stripped. Empty * lines will be returned. * * @return true if a line could be read, * false if no more data was available * @param dst where to store the line that was read **/ bool readLine(string &dst); }; } // namespace vbench
/* data_partition.h -*- C++ -*- Jeremy Barns, 26 August 2012 Copyright (c) 2012 mldb.ai inc. All rights reserved. This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved. Abstract data partition used for training. */ #pragma once #include <tuple> #include <functional> #include <vector> #include "mldb/utils/any.h" #include <stdint.h> #include "tuple_encoder.h" namespace MLDB { /*****************************************************************************/ /* DATA PARTITION */ /*****************************************************************************/ struct DataPartition { virtual ~DataPartition() { } virtual size_t exampleCount() const = 0; virtual std::tuple<bool, std::any, double> getExample(size_t exampleNum) const = 0; typedef void (ForEachExampleCallbackFn) (bool label, const std::any & features, double weight, size_t exampleNum); // Callback to be called to iterate over all examples typedef std::function<ForEachExampleCallbackFn> ForEachExampleCallback; virtual void forEachExample(const ForEachExampleCallback & cb, bool inParallel) const = 0; }; /*****************************************************************************/ /* ADHOC DATA PARTITION */ /*****************************************************************************/ struct AdHocDataPartition : public DataPartition { // Callback to be called to get the number of examples std::function<size_t ()> exampleCountImpl; virtual size_t exampleCount() const { return exampleCountImpl(); } // Callback to be called to get a specific example std::function<std::tuple<bool, std::any, double> (int exampleNum)> getExampleImpl; virtual std::tuple<bool, std::any, double> getExample(size_t exampleNum) const { return getExampleImpl(exampleNum); } std::function<void (ForEachExampleCallback, bool inParallel)> forEachExampleImpl; virtual void forEachExample(const ForEachExampleCallback & cb, bool inParallel) const { return forEachExampleImpl(cb, inParallel); } }; /*****************************************************************************/ /* STORED DATA PARTITION */ /*****************************************************************************/ /** Implementation of a DataPartition that stores its data in a vector. */ struct StoredDataPartition : public DataPartition { virtual ~StoredDataPartition(); virtual size_t exampleCount() const; virtual std::tuple<bool, std::any, double> getExample(size_t exampleNum) const; virtual void forEachExample(const ForEachExampleCallback & cb, bool inParallel) const; void add(bool label, const std::any & key, double weight); std::vector<std::tuple<bool, std::any, double> > examples; }; /*****************************************************************************/ /* STORED DATA PARTITION TEMPLATE */ /*****************************************************************************/ /** Implementation of a DataPartition that stores its data in a vector. */ template<typename... Args> struct StoredDataPartitionT : public StoredDataPartition { TupleEncoder<Args...> encoder; virtual ~StoredDataPartitionT() { } void add(bool label, Args... args, double weight) { StoredDataPartition::add(label, encoder.encode(args...), weight); } }; } // namespace MLDB
/* Q Light Controller vcsoloframe.h Copyright (c) Anders Thomsen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.txt Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef VCSOLOFRAME_H #define VCSOLOFRAME_H #include "vcwidget.h" #include "vcframe.h" #include "function.h" class QDomDocument; class QDomElement; class QMouseEvent; class QString; class Doc; /** @addtogroup ui_vc_widgets * @{ */ #define KXMLQLCVCSoloFrame "SoloFrame" class VCSoloFrame : public VCFrame { Q_OBJECT Q_DISABLE_COPY(VCSoloFrame) /************************************************************************* * Initialization *************************************************************************/ public: VCSoloFrame(QWidget* parent, Doc* doc, bool canCollapse = false); virtual ~VCSoloFrame(); /************************************************************************* * Clipboard *************************************************************************/ public: /** @reimp */ VCWidget* createCopy(VCWidget* parent); /************************************************************************* * Solo behaviour *************************************************************************/ protected: /** Method that returns true if $widget's nearest parent * is this Solo Frame. Otherwise false is returned */ bool thisIsNearestSoloFrameParent(QWidget* widget); protected slots: virtual void slotModeChanged(Doc::Mode mode); /** Slot called when a Function attached to a widget has * been requested to start. */ void slotWidgetFunctionStarting(); /********************************************************************* * Web access *********************************************************************/ public: /** @reimpl */ QString getCSS(); /************************************************************************* * Load & Save *************************************************************************/ protected: virtual QString xmlTagName() const; /************************************************************************* * Event handlers *************************************************************************/ protected: virtual void paintEvent(QPaintEvent* e); }; /** @} */ #endif
#ifndef __ENG_UEVENT_H_ #define __ENG_UEVENT_H_ void* eng_uevt_thread(void *x); #endif /*__ENG_UEVENT_H_*/
#ifdef _WIN32 #include <Windows.h> #define _BITS_PER_PIXEL_ 16 /** * An instance of the window. */ extern WNDCLASS windowsClass; /* The window process method for processing a window's events. */ extern LRESULT CALLBACK windowProcess; WNDCLASS createGLWindow(LPCWSTR title, unsigned int width, unsigned int height, bool fullscreen); void updateWindow(); void killGLWindow(); #elif __APPLE__ #elif __linux__ #endif
/* ============================================================================ * Project Name : ezbox Configuration Daemon * Module Name : utils_cleanup_rootfs.c * * Description : ezcfg cleanup rootfs files before mounting overlayfs * * Copyright (C) 2008-2013 by ezbox-project * * History Rev Description * 2012-06-19 0.1 Write it from scratch * ============================================================================ */ #include <stddef.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> #include <string.h> #include <sys/wait.h> #include <sys/socket.h> #include <sys/select.h> #include <sys/mman.h> #include <sys/time.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/mount.h> #include <sys/un.h> #include <fcntl.h> #include <netinet/in.h> #include <arpa/inet.h> #include <assert.h> #include <pthread.h> #include <errno.h> #include <syslog.h> #include <ctype.h> #include <stdarg.h> #include "ezcd.h" int utils_cleanup_rootfs(char *path) { FILE *file = NULL; char buf[FILE_LINE_BUFFER_SIZE]; int buf_len; char *p=NULL; int rc; if (path == NULL) return EXIT_FAILURE; file = fopen(path, "r"); if (file == NULL) return EXIT_FAILURE; rc = snprintf(buf, sizeof(buf), "%s -rf", CMD_RM); if (rc < 0) { rc = EXIT_FAILURE; goto func_exit; } p = buf + rc; buf_len = sizeof(buf) - rc; while (utils_file_get_line(file, p, buf_len, "#", LINE_TAIL_STRING) == true) { if (strncmp(p, "d ", 2) == 0) { /* remove following file/directory */ *p = ' '; /* change 'd' to ' ' */ utils_system(buf); } } rc = EXIT_SUCCESS; func_exit: fclose(file); return rc; }
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/network-firewall/NetworkFirewall_EXPORTS.h> #include <aws/network-firewall/model/PerObjectSyncStatus.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace NetworkFirewall { namespace Model { /** * <p/><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/network-firewall-2020-11-12/PerObjectStatus">AWS * API Reference</a></p> */ class AWS_NETWORKFIREWALL_API PerObjectStatus { public: PerObjectStatus(); PerObjectStatus(Aws::Utils::Json::JsonView jsonValue); PerObjectStatus& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p/> */ inline const PerObjectSyncStatus& GetSyncStatus() const{ return m_syncStatus; } /** * <p/> */ inline bool SyncStatusHasBeenSet() const { return m_syncStatusHasBeenSet; } /** * <p/> */ inline void SetSyncStatus(const PerObjectSyncStatus& value) { m_syncStatusHasBeenSet = true; m_syncStatus = value; } /** * <p/> */ inline void SetSyncStatus(PerObjectSyncStatus&& value) { m_syncStatusHasBeenSet = true; m_syncStatus = std::move(value); } /** * <p/> */ inline PerObjectStatus& WithSyncStatus(const PerObjectSyncStatus& value) { SetSyncStatus(value); return *this;} /** * <p/> */ inline PerObjectStatus& WithSyncStatus(PerObjectSyncStatus&& value) { SetSyncStatus(std::move(value)); return *this;} private: PerObjectSyncStatus m_syncStatus; bool m_syncStatusHasBeenSet; }; } // namespace Model } // namespace NetworkFirewall } // namespace Aws
// // shape.h // // Created by Jingshu Huang on 8/27/13. // Copyright (c) HuangImage 2013. All rights reserved. // #ifndef __shape__ #define __shape__ class Mesh; class Shape { public: Shape() {} virtual ~Shape() {} virtual void loadIntoMesh(Mesh& mesh) {} virtual void updateMesh(Mesh& mesh) {} }; #endif
// 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. #import "BundleResource.h" #import "TextLocation.h" @interface ResourceReference : NSObject @property(nonatomic, copy, readonly) NSString *resourcePath; @property(nonatomic, copy, readonly) NSString *referencePath; @property(nonatomic, assign, readonly) TextLocation referenceLocation; @property(nonatomic, copy, readonly) NSString *referenceHint; @property(nonatomic, strong, readonly) NSMutableArray *bundleResources; @property(nonatomic, copy, readonly) NSString *missingResourceHint; - (instancetype)init NS_UNAVAILABLE; - (instancetype)initWithResourcePath:(NSString *)resourcePath referencePath:(NSString *)referencePath referenceLocation:(TextLocation)referenceLocation referenceHint:(NSString *)referenceHint missingResourceHint:(NSString *)missingResourceHint NS_DESIGNATED_INITIALIZER; - (instancetype)initWithResourcePath:(NSString *)resourcePath referencePath:(NSString *)referencePath referenceLocation:(TextLocation)referenceLocation missingResourceHint:(NSString *)missingResourceHint; @end
/* * Copyright (c) 2020 Embedded Planet * SPDX-License-Identifier: Apache-2.0 * * 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 <bootutil/sign_key.h> #include <mcuboot_config/mcuboot_config.h> #if defined(MCUBOOT_SIGN_RSA) #define HAVE_KEYS extern const unsigned char rsa_pub_key[]; extern unsigned int rsa_pub_key_len; #elif defined(MCUBOOT_SIGN_EC256) #define HAVE_KEYS extern const unsigned char ecdsa_pub_key[]; extern unsigned int ecdsa_pub_key_len; #elif defined(MCUBOOT_SIGN_ED25519) #define HAVE_KEYS extern const unsigned char ed25519_pub_key[]; extern unsigned int ed25519_pub_key_len; #else #error "No public key available for given signing algorithm." #endif /* * Note: Keys for both signing and encryption must be provided by the application. * mcuboot's imgtool utility can be used to generate these keys and convert them into compatible C code. * See imgtool's documentation, specifically the section: "Incorporating the public key into the code" which can be found here: * https://github.com/JuulLabs-OSS/mcuboot/blob/master/docs/imgtool.md#incorporating-the-public-key-into-the-code */ #if defined(HAVE_KEYS) const struct bootutil_key bootutil_keys[] = { { #if defined(MCUBOOT_SIGN_RSA) .key = rsa_pub_key, .len = &rsa_pub_key_len, #elif defined(MCUBOOT_SIGN_EC256) .key = ecdsa_pub_key, .len = &ecdsa_pub_key_len, #elif defined(MCUBOOT_SIGN_ED25519) .key = ed25519_pub_key, .len = &ed25519_pub_key_len, #endif }, }; const int bootutil_key_cnt = 1; #if defined(MCUBOOT_ENCRYPT_RSA) extern const unsigned char enc_priv_key[]; extern const unsigned int enc_priv_key_len; const struct bootutil_key bootutil_enc_key = { .key = enc_priv_key, .len = &enc_priv_key_len, }; #elif defined(MCUBOOT_ENCRYPT_KW) #error "Encrypted images with AES-KW is not implemented yet." #endif #endif
/* Copyright 2017 The TensorFlow 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. ==============================================================================*/ #ifndef TENSORFLOW_PYTHON_EAGER_PYWRAP_TFE_H_ #define TENSORFLOW_PYTHON_EAGER_PYWRAP_TFE_H_ #include "tensorflow/c/eager/c_api.h" #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/gtl/inlined_vector.h" #include <Python.h> typedef tensorflow::gtl::InlinedVector<TFE_TensorHandle*, 4> TFE_InputTensorHandles; typedef tensorflow::gtl::InlinedVector<TFE_TensorHandle*, 2> TFE_OutputTensorHandles; // Execute a TensorFlow operation. // // 'device_name': Name of the device on which to execute the operation, or NULL // for automatic selection. // 'op_name': Name of the TensorFlow op to execute. // 'inputs': An array of TFE_TensorHandle*'s of size 'num_inputs'. These tensors // will be provided as input to the operation. // 'attrs': A Python tuple alternating names and attr values. // 'outputs': A pointer to a TFE_OutputTensorHandles in which outputs will // placed. On success, its elements will be filled in and the // caller takes ownership of each returned TFE_TensorHandle. // 'outputs' MUST be sized to be at least as large as the number // of tensors produced by the operation and will be resized to // the actual number of tensors produced. void TFE_Py_Execute(TFE_Context* ctx, const char* device_name, const char* op_name, TFE_InputTensorHandles* inputs, PyObject* attrs, TFE_OutputTensorHandles* outputs, TF_Status* out_status); // Registers e as the Exception class for handling not ok Status. Returns // Py_None if registration succeeds, else throws a TypeError and returns NULL. PyObject* TFE_Py_RegisterExceptionClass(PyObject* e); // Returns 0 if 'status' is TF_OK. Otherwise, raises an exception (using // `exception` if not nullptr, else using the class registered via // TFE_Py_RegisterExceptionClass), and returns -1. int MaybeRaiseExceptionFromTFStatus(TF_Status* status, PyObject* exception); // Returns 0 if 'status' is ok. Otherwise, raises an exception (using // `exception` if not nullptr, else using the class registered via // TFE_Py_RegisterExceptionClass), and returns -1. int MaybeRaiseExceptionFromStatus(const tensorflow::Status& status, PyObject* exception); // Returns the string associated with the passed-in python object. char* TFE_GetPythonString(PyObject* o); // Returns a unique id on each call. int64_t get_uid(); // Wraps the output of get_uid as a Python Long object. Ownership is passed to // the caller. PyObject* TFE_Py_UID(); // Deleter for Context objects, called from the Capsule that owns it. void TFE_DeleteContextCapsule(PyObject* context); // Returns true if o is an instance of EagerTensor, but not a subclass. Else // returns false. bool EagerTensor_CheckExact(const PyObject* o); // Helper function to construct a new EagerTensor from a TFE_TensorHandle. PyObject* EagerTensorFromHandle(TFE_TensorHandle* handle); // Extracts the handle inside EagerTensor object `o`. Returns nullptr on error. TFE_TensorHandle* EagerTensorHandle(const PyObject* o); // Creates the `EagerTensor` class by subclassing `base_class` and returns the // newly created type, or nullptr on error. PyObject* TFE_Py_InitEagerTensor(PyObject* base_class); PyObject* TFE_Py_NewTape(); PyObject* TFE_Py_TapeShouldRecord(PyObject* py_tape, PyObject* tensors); void TFE_Py_TapeWatch(PyObject* tape, tensorflow::int64 tensor_id); void TFE_Py_TapeDeleteTrace(PyObject* tape, tensorflow::int64 tensor_id); // Records an operation in the gradient tape. `tape` should point to an object // returned by TFE_Py_NewTape. op_type is a string for the operation type, used // in the backprop code. output_tensors should be a list of python ops.Tensor // objects. input_tensor_ids should be a list of python integers with the ids of // the input tensors of the recorded operation. backward_function should be the // function to be called during backprop to, given the gradients of the output // tensors, produce the gradients of the input tensors. void TFE_Py_TapeRecordOperation(PyObject* tape, PyObject* op_type, PyObject* output_tensors, PyObject* input_tensor_ids, PyObject* backward_function); PyObject* TFE_Py_TapeExport(PyObject* tape); // Returns an EagerTensor of dimension [len(`tensor_list`)] containing // the `slice_dim`'th dimension of each tensor in `tensor_list`. In other words, // TFE_Py_TensorShapeSlice takes a slice of dimensions of tensors in // `tensor_list`. For example, if `tensor_list` contains tensors of with shapes // [1, 2, 3], [4, 5], [6, 7, 8, 9], TFE_Py_TensorShapeSlice called with // `slice_dim` equal to 1 will return [2, 5, 7]. // On error, returns nullptr and sets python exception. // REQUIRES: `tensor_list` is a python list of EagerTensors // REQUIRES: `slice_dim` is non-negative and smaller than the rank of all // tensors in `tensor_list`. PyObject* TFE_Py_TensorShapeSlice(PyObject* tensor_list, int slice_dim); #endif // TENSORFLOW_PYTHON_EAGER_PYWRAP_TFE_H_
// // Camera.h // raytracer // // Created by a on 07/08/15. // Copyright (c) 2015 Martin Mi. All rights reserved. // #ifndef __raytracer__Camera__ #define __raytracer__Camera__ #include "Vector.h" struct Camera { Camera(const Vector & pos, const Vector & lookAt); Vector forward, right, up; Vector pos; }; #endif /* defined(__raytracer__Camera__) */
#ifndef _CHE_CRYPTO_RC4_H_ #define _CHE_CRYPTO_RC4_H_ #include "che_base_object.h" namespace chepdf { class CryptoRC4 { public: static void Encrypt(const uint8_t * const key, uint32_t keyLength, uint8_t * data, uint32_t dataLength, uint8_t * dataRet); }; }//namespace #endif
/* * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ /** * @file Sample app to demonstrate PWM. * * This app uses PWM[0]. */ #include <zephyr.h> #include <misc/printk.h> #include <device.h> #include <pwm.h> #if defined(CONFIG_SOC_STM32F401XE) || defined(CONFIG_SOC_STM32F412ZG) || \ defined(CONFIG_SOC_STM32F413XX) || defined(CONFIG_SOC_STM32L476XG) || \ defined(CONFIG_SOC_STM32F407XG) || defined(CONFIG_SOC_STM32F302X8) #define PWM_DRIVER DT_PWM_STM32_2_DEV_NAME #define PWM_CHANNEL 1 #elif CONFIG_SOC_STM32F103XB #define PWM_DRIVER DT_PWM_STM32_1_DEV_NAME #define PWM_CHANNEL 1 #elif defined(CONFIG_SOC_QUARK_SE_C1000) || defined(CONFIG_SOC_QUARK_D2000) #define PWM_DRIVER CONFIG_PWM_QMSI_DEV_NAME #define PWM_CHANNEL 0 #elif defined(CONFIG_SOC_FAMILY_NRF) #define PWM_DRIVER CONFIG_PWM_NRF5_SW_0_DEV_NAME #define PWM_CHANNEL LED0_GPIO_PIN #elif defined(CONFIG_BOARD_COLIBRI_IMX7D_M4) #define PWM_DRIVER PWM_1_LABEL #define PWM_CHANNEL 0 #elif defined(CONFIG_SOC_FAMILY_NRF) #define PWM_DRIVER CONFIG_PWM_NRF5_SW_0_DEV_NAME #define PWM_CHANNEL LED0_GPIO_PIN #elif defined(PWM_LED0_PWM_CONTROLLER) && defined(PWM_LED0_PWM_CHANNEL) /* get the defines from dt (based on alias 'pwm-led0') */ #define PWM_DRIVER PWM_LED0_PWM_CONTROLLER #define PWM_CHANNEL PWM_LED0_PWM_CHANNEL #else #error "Choose supported PWM driver" #endif /* in micro second */ #define MIN_PERIOD (USEC_PER_SEC / 64) /* in micro second */ #define MAX_PERIOD USEC_PER_SEC void main(void) { struct device *pwm_dev; u32_t period = MAX_PERIOD; u8_t dir = 0U; printk("PWM demo app-blink LED\n"); pwm_dev = device_get_binding(PWM_DRIVER); if (!pwm_dev) { printk("Cannot find %s!\n", PWM_DRIVER); return; } while (1) { if (pwm_pin_set_usec(pwm_dev, PWM_CHANNEL, period, period / 2)) { printk("pwm pin set fails\n"); return; } if (dir) { period *= 2; if (period > MAX_PERIOD) { dir = 0U; period = MAX_PERIOD; } } else { period /= 2; if (period < MIN_PERIOD) { dir = 1U; period = MIN_PERIOD; } } k_sleep(MSEC_PER_SEC * 4); } }
/***************************************************************************** Simple TCP (stream; HTTP) client This code is public domain (no copyright). You can do whatever you want with it. *****************************************************************************/ #include <string.h> /* memset(), memcpy() */ #include <stdlib.h> /* atexit() */ #include <stdio.h> /* printf() */ /* MinGW, Borland C 5.5 */ #if defined(__WIN32__) #include <winsock.h> /* DOS; using Turbo C, Watcom C, or maybe another 16-bit C compiler You also need http://my.execpc.com/~geezer/osd/net/vxdsock.zip */ #elif defined(__TURBOC__) #include "socket.h" #elif defined(__WATCOMC__) #if defined(__386__) #error This is a 16-bit program #endif #include "socket.h" /* Linux */ #elif defined(__netbas__) #include <netinet/in.h> #include <sys/socket.h> #include <sys/types.h> #include <arpa/inet.h> #include <unistd.h> #include <netdb.h> /* gethostbyname() */ #include <errno.h> #define closesocket(S) close(S) #else #error Unsupported OS or compiler #endif #define MY_PORT 80 /* HTTP */ #define BUF_LEN 256 /***************************************************************************** *****************************************************************************/ int main(int arg_c, char *arg_v[]) { static const char cmd[] = "GET / HTTP/1.0\r\n\r\n"; /**/ struct sockaddr_in their_adr; char buf[BUF_LEN]; struct hostent *he; int sock, i; #if defined(__WIN32__) WSADATA wsdata; /* Winsock start up */ WSAStartup(0x0101, &wsdata); atexit((void (*)(void))WSACleanup); #endif if(arg_c != 2) { printf("specify HTTP server name\n"); return 1; } /* create socket */ printf("calling socket()...\n"); sock = socket(AF_INET, SOCK_STREAM, 0); if(sock < 0) { printf("socket() returned %d, errno=%d\n", sock, errno); return 1; } /* get IP address of other end */ printf("calling gethostbyname()...\n"); he = gethostbyname(arg_v[1]); if(he == NULL) { printf("can't get IP address of host '%s'\n", arg_v[1]); return 1; } memset(&their_adr, 0, sizeof(their_adr)); their_adr.sin_family = AF_INET; memcpy(&their_adr.sin_addr, he->h_addr, he->h_length); their_adr.sin_port = htons(MY_PORT); /* connect */ printf("calling connect()...\n"); i = connect(sock, (struct sockaddr *)&their_adr, sizeof(their_adr)); if(i != 0) { printf("connect() returned %d, errno=%d\n", i, errno); return 1; } /* send HTTP command */ printf("calling send()...\n"); i = send(sock, cmd, sizeof(cmd), 0); if(i != sizeof(cmd)) { printf("send() returned %d, errno=%d\n", i, errno); return 1; } /* get reply */ do { printf("calling recv()...\n"); i = recv(sock, buf, BUF_LEN, 0); if(i < 0) { printf("recv() returned %d, errno=%d\n", i, errno); break; } if(i > BUF_LEN) i = BUF_LEN; printf("%-*.*s", i, i, buf); } while(i != 0); /* close socket */ printf("calling closesocket()...\n"); closesocket(sock); return 0; }
/* * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. * * NVIDIA CORPORATION and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation * and any modifications thereto. Any use, reproduction, disclosure or * distribution of this software and related documentation without an express * license agreement from NVIDIA CORPORATION is strictly prohibited. */ // This file was generated by NxParameterized/scripts/GenModuleHelpers.pl // Created: 2015.10.22 17:26:36 #include "ClothingActorParam_0p0.h" #include "ClothingActorParam_0p1.h" #include "ClothingActorParam_0p10.h" #include "ClothingActorParam_0p11.h" #include "ClothingActorParam_0p12.h" #include "ClothingActorParam_0p13.h" #include "ClothingActorParam_0p14.h" #include "ClothingActorParam_0p15.h" #include "ClothingActorParam_0p16.h" #include "ClothingActorParam_0p17.h" #include "ClothingActorParam_0p2.h" #include "ClothingActorParam_0p3.h" #include "ClothingActorParam_0p4.h" #include "ClothingActorParam_0p5.h" #include "ClothingActorParam_0p6.h" #include "ClothingActorParam_0p7.h" #include "ClothingActorParam_0p8.h" #include "ClothingActorParam_0p9.h" #include "ClothingAssetParameters_0p0.h" #include "ClothingAssetParameters_0p1.h" #include "ClothingAssetParameters_0p10.h" #include "ClothingAssetParameters_0p11.h" #include "ClothingAssetParameters_0p12.h" #include "ClothingAssetParameters_0p13.h" #include "ClothingAssetParameters_0p2.h" #include "ClothingAssetParameters_0p3.h" #include "ClothingAssetParameters_0p4.h" #include "ClothingAssetParameters_0p5.h" #include "ClothingAssetParameters_0p6.h" #include "ClothingAssetParameters_0p7.h" #include "ClothingAssetParameters_0p8.h" #include "ClothingAssetParameters_0p9.h" #include "ClothingCookedParam_0p0.h" #include "ClothingCookedParam_0p1.h" #include "ClothingCookedParam_0p2.h" #include "ClothingCookedPhysX3Param_0p0.h" #include "ClothingCookedPhysX3Param_0p1.h" #include "ClothingCookedPhysX3Param_0p2.h" #include "ClothingCookedPhysX3Param_0p3.h" #include "ClothingCookedPhysX3Param_0p4.h" #include "ClothingGraphicalLodParameters_0p0.h" #include "ClothingGraphicalLodParameters_0p1.h" #include "ClothingGraphicalLodParameters_0p2.h" #include "ClothingGraphicalLodParameters_0p3.h" #include "ClothingGraphicalLodParameters_0p4.h" #include "ClothingMaterialLibraryParameters_0p0.h" #include "ClothingMaterialLibraryParameters_0p1.h" #include "ClothingMaterialLibraryParameters_0p10.h" #include "ClothingMaterialLibraryParameters_0p11.h" #include "ClothingMaterialLibraryParameters_0p12.h" #include "ClothingMaterialLibraryParameters_0p13.h" #include "ClothingMaterialLibraryParameters_0p14.h" #include "ClothingMaterialLibraryParameters_0p2.h" #include "ClothingMaterialLibraryParameters_0p3.h" #include "ClothingMaterialLibraryParameters_0p4.h" #include "ClothingMaterialLibraryParameters_0p5.h" #include "ClothingMaterialLibraryParameters_0p6.h" #include "ClothingMaterialLibraryParameters_0p7.h" #include "ClothingMaterialLibraryParameters_0p8.h" #include "ClothingMaterialLibraryParameters_0p9.h" #include "ClothingPhysicalMeshParameters_0p0.h" #include "ClothingPhysicalMeshParameters_0p1.h" #include "ClothingPhysicalMeshParameters_0p10.h" #include "ClothingPhysicalMeshParameters_0p2.h" #include "ClothingPhysicalMeshParameters_0p3.h" #include "ClothingPhysicalMeshParameters_0p4.h" #include "ClothingPhysicalMeshParameters_0p5.h" #include "ClothingPhysicalMeshParameters_0p6.h" #include "ClothingPhysicalMeshParameters_0p7.h" #include "ClothingPhysicalMeshParameters_0p8.h" #include "ClothingPhysicalMeshParameters_0p9.h"
#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.Security.Cryptography.RC2Transform struct RC2Transform_t542353943; // System.Security.Cryptography.RC2 struct RC2_t2466813799; // System.Byte[] struct ByteU5BU5D_t4260760469; #include "codegen/il2cpp-codegen.h" #include "mscorlib_System_Security_Cryptography_RC22466813799.h" // System.Void System.Security.Cryptography.RC2Transform::.ctor(System.Security.Cryptography.RC2,System.Boolean,System.Byte[],System.Byte[]) extern "C" void RC2Transform__ctor_m3390235803 (RC2Transform_t542353943 * __this, RC2_t2466813799 * ___rc2Algo0, bool ___encryption1, ByteU5BU5D_t4260760469* ___key2, ByteU5BU5D_t4260760469* ___iv3, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Security.Cryptography.RC2Transform::.cctor() extern "C" void RC2Transform__cctor_m754720983 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Security.Cryptography.RC2Transform::ECB(System.Byte[],System.Byte[]) extern "C" void RC2Transform_ECB_m224687124 (RC2Transform_t542353943 * __this, ByteU5BU5D_t4260760469* ___input0, ByteU5BU5D_t4260760469* ___output1, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// // CDCheckBoxView.h // ColorDiary2 // // Created by apple on 16/5/21. // Copyright (c) 2016年 apple. All rights reserved. // #import <UIKit/UIKit.h> @interface CDCheckBoxView : UIView +(instancetype)colorCheckBox; @end
/* * Copyright 2005-2013 nbcyl.com. All rights reserved. * Support: http://www.nbcyl.com * License: http://www.nbcyl.com/license */ #import <UIKit/UIKit.h> /** * control - 发票抬头 * * @author nbcyl Team * @version 3.0 */ typedef void (^ReturnTextBlock)(NSString *showText); @interface NTGInvoiceController : UIViewController @property (nonatomic, copy) ReturnTextBlock returnTextBlock; @end
#pragma once #include "SceneNode.h" #include "D3dShader.h" #include "Geometry.h" namespace engiX { class D3dGeneratedMeshNode : public SceneNode { public: typedef std::vector<D3D11Vertex_PositionColored> VertexList; typedef std::vector<UINT> IndexList; D3dGeneratedMeshNode(_In_ ActorID actorId, _In_ const GeometryGenerator::MeshData& mesh, _In_ Color3 color, _In_ GameScene* pScene); ~D3dGeneratedMeshNode(); HRESULT OnPreRender(); HRESULT OnConstruct(); void OnRender(); ID3D11Buffer* VertextBuffer() { return m_pVertexBuffer; } ID3D11Buffer* IndexBuffer() { return m_pIndexBuffer; } size_t VertexCount() const { return m_vertices.size(); } size_t IndexCount() const { return m_indices.size(); } bool RenderWireframe() const { return m_rasterizeDesc.FillMode == D3D11_FILL_WIREFRAME; } bool RenderBackface() const { return m_rasterizeDesc.CullMode != D3D11_CULL_BACK; } protected: VertexList m_vertices; IndexList m_indices; D3dShader m_shader; ID3D11Buffer* m_pVertexBuffer; ID3D11Buffer* m_pIndexBuffer; D3D11_RASTERIZER_DESC m_rasterizeDesc; ID3D11RasterizerState* m_pRasterizeState; }; }
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __itkCopperColormapFunction_h #define __itkCopperColormapFunction_h #include "itkColormapFunction.h" namespace itk { namespace Function { /** * \class CopperColormapFunction * \brief Function object which maps a scalar value into an RGB colormap value. * * \image html CopperColormapFunction.png "Copper colormap." * \author Nicholas Tustison, Hui Zhang, Gaetan Lehmann, Paul Yushkevich * and James C. Gee * * This code was contributed in the Insight Journal paper: * * "Meeting Andy Warhol Somewhere Over the Rainbow: RGB Colormapping and ITK" * http://www.insight-journal.org/browse/publication/285 * http://hdl.handle.net/1926/1452 * * \ingroup ITKColormap */ template< class TScalar, class TRGBPixel > class CopperColormapFunction: public ColormapFunction< TScalar, TRGBPixel > { public: typedef CopperColormapFunction Self; typedef ColormapFunction< TScalar, TRGBPixel > Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); typedef typename Superclass::RGBPixelType RGBPixelType; typedef typename Superclass::ScalarType ScalarType; typedef typename Superclass::RealType RealType; virtual RGBPixelType operator()(const TScalar &) const; protected: CopperColormapFunction() {} ~CopperColormapFunction() {} private: CopperColormapFunction(const Self &); //purposely not implemented void operator=(const Self &); //purposely not implemented }; } // end namespace functor } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkCopperColormapFunction.hxx" #endif #endif
/******************************************************************************* Copyright 2011 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 "CViewController.h" #import "CNotifier.h" #import "CNotifierItemView.h" #import "CNotifierBar.h" @interface CNotifierViewController : CViewController @property (strong, nonatomic) UIViewController *bodyViewController; @property (strong, nonatomic) CNotifier *notifier; @property (nonatomic) NSUInteger rowCapacity; @end
/** * @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/math/strided/special/smsktrunc.h" #include <stdint.h> #include <stdio.h> int main() { // Create an input strided array: float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: int64_t N = 4; // Specify the stride lengths: int64_t strideX = 2; int64_t strideM = 2; int64_t strideY = 2; // Compute the results: stdlib_strided_smsktrunc( N, x, strideX, m, strideM, y, strideY ); // Print the results: for ( int i = 0; i < 8; i++ ) { printf( "y[ %i ] = %f\n", i, y[ i ] ); } }
#pragma once #include <fstream> #include "../SimpleLog.h" class BasicSimpleIO { public: ///@brief read from a file stream ///@param fileStream stream used to read load this object ///@return boolean to know if the operation is a success of not. bool read(std::fstream * fileStream); ///@brief write this object as binary into a file stream ///@param fileStream stream used to write this object ///@return boolean to know if the operation is a success of not. bool write(std::fstream * fileStream) const; };
// This defines the interface to the QsciLexerMatlab class. // // Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com> // // This file is part of QScintilla. // // This file may be used under the terms of the GNU General Public License // version 3.0 as published by the Free Software Foundation and appearing in // the file LICENSE included in the packaging of this file. Please review the // following information to ensure the GNU General Public License version 3.0 // requirements will be met: http://www.gnu.org/copyleft/gpl.html. // // If you do not wish to use this file under the terms of the GPL version 3.0 // then you may purchase a commercial license. For more information contact // info@riverbankcomputing.com. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. #ifndef QSCILEXERMATLAB_H #define QSCILEXERMATLAB_H #ifdef __APPLE__ extern "C++" { #endif #include <qobject.h> #include <Qsci/qsciglobal.h> #include <Qsci/qscilexer.h> //! \brief The QsciLexerMatlab class encapsulates the Scintilla Matlab file //! lexer. class QSCINTILLA_EXPORT QsciLexerMatlab : public QsciLexer { Q_OBJECT public: //! This enum defines the meanings of the different styles used by the //! Matlab file lexer. enum { //! The default. Default = 0, //! A comment. Comment = 1, //! A command. Command = 2, //! A number. Number = 3, //! A keyword. Keyword = 4, //! A single quoted string. SingleQuotedString = 5, //! An operator Operator = 6, //! An identifier. Identifier = 7, //! A double quoted string. DoubleQuotedString = 8 }; //! Construct a QsciLexerMatlab with parent \a parent. \a parent is //! typically the QsciScintilla instance. QsciLexerMatlab(QObject *parent = 0); //! Destroys the QsciLexerMatlab instance. virtual ~QsciLexerMatlab(); //! Returns the name of the language. const char *language() const; //! Returns the name of the lexer. Some lexers support a number of //! languages. const char *lexer() const; //! Returns the foreground colour of the text for style number \a style. //! //! \sa defaultPaper() QColor defaultColor(int style) const; //! Returns the font for style number \a style. QFont defaultFont(int style) const; //! Returns the set of keywords for the keyword set \a set recognised //! by the lexer as a space separated string. const char *keywords(int set) const; //! Returns the descriptive name for style number \a style. If the //! style is invalid for this language then an empty QString is returned. //! This is intended to be used in user preference dialogs. QString description(int style) const; private: QsciLexerMatlab(const QsciLexerMatlab &); QsciLexerMatlab &operator=(const QsciLexerMatlab &); }; #ifdef __APPLE__ } #endif #endif
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Users/tball/tmp/j2objc/guava/sources/com/google/common/collect/ComputationException.java // #include "J2ObjC_header.h" #if !ComGoogleCommonCollectComputationException_RESTRICT #define ComGoogleCommonCollectComputationException_INCLUDE_ALL 1 #endif #undef ComGoogleCommonCollectComputationException_RESTRICT #if !defined (_ComGoogleCommonCollectComputationException_) && (ComGoogleCommonCollectComputationException_INCLUDE_ALL || ComGoogleCommonCollectComputationException_INCLUDE) #define _ComGoogleCommonCollectComputationException_ @class JavaLangThrowable; #define JavaLangRuntimeException_RESTRICT 1 #define JavaLangRuntimeException_INCLUDE 1 #include "java/lang/RuntimeException.h" #define ComGoogleCommonCollectComputationException_serialVersionUID 0LL @interface ComGoogleCommonCollectComputationException : JavaLangRuntimeException { } - (instancetype)initWithJavaLangThrowable:(JavaLangThrowable *)cause; @end J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCollectComputationException) CF_EXTERN_C_BEGIN J2OBJC_STATIC_FIELD_GETTER(ComGoogleCommonCollectComputationException, serialVersionUID, jlong) CF_EXTERN_C_END #endif J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCollectComputationException)
/****************************** Description: Net handler base. Author: M.Wan Date: 3/14/2015 ******************************/ #ifndef __NET_NET_HANDLER__ #define __NET_NET_HANDLER__ #include "../base/mwbase.h" #include <string> MW_FRAMEWORK_BEGIN class MWNetResponse; /** * A handler class to handle the network response. */ class MW_DLL MWNetHandler : public MWObject { public: /** * Create a NetHandler object. * @note This method is just for script. Please don't create it in cpp. */ static MWNetHandler *create(); /** * MWNetHandler destructor. */ virtual ~MWNetHandler() {} /** * Protocols about how to handle successful/failed message. */ virtual void handleSuccessfulMessage(MWNetResponse *response); virtual void handleFailedMessage(MWNetResponse *response); protected: MWNetHandler() {} }; MW_FRAMEWORK_END #endif
// // NSThreadViewController.h // TestOC // // Created by 李亚军 on 2017/1/12. // Copyright © 2017年 zyyj. All rights reserved. // #import <UIKit/UIKit.h> @interface NSThreadViewController : UIViewController @end
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2013 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ // A good bit of this code was derived from the Three20 project // and was customized to work inside EventsAndProperties // // All modifications by EventsAndProperties are licensed under // the Apache License, Version 2.0 // // // Copyright 2009 Facebook // // 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. // #ifdef USE_TI_UIDASHBOARDVIEW #import <UIKit/UIKit.h> @class LauncherButton; @class LauncherItem; @protocol LauncherViewDelegate; @interface LauncherView : UIView<UIScrollViewDelegate> { @private id<LauncherViewDelegate> delegate; UIScrollView *scrollView; UIPageControl *pager; NSMutableArray *pages; NSMutableArray *buttons; NSInteger columnCount; NSInteger rowCount; LauncherButton *dragButton; NSTimer* editHoldTimer; NSTimer* springLoadTimer; UITouch* dragTouch; NSInteger positionOrigin; CGPoint dragOrigin; CGPoint touchOrigin; BOOL editing; BOOL springing; BOOL editable; BOOL renderingButtons; } @property(nonatomic) NSInteger columnCount; @property(nonatomic) NSInteger rowCount; @property(nonatomic) NSInteger currentPageIndex; @property(nonatomic,assign) id<LauncherViewDelegate> delegate; @property(nonatomic,readonly) BOOL editing; @property(nonatomic,assign) BOOL editable; - (void)addItem:(LauncherItem*)item animated:(BOOL)animated; - (void)removeItem:(LauncherItem*)item animated:(BOOL)animated; - (void)beginEditing; - (void)endEditing; - (void)recreateButtons; - (LauncherItem*)itemForIndex:(NSInteger)index; - (NSArray*)items; @end @protocol LauncherViewDelegate <NSObject> @optional - (void)launcherView:(LauncherView*)launcher didAddItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didRemoveItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher willDragItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didDragItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didMoveItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didSelectItem:(LauncherItem*)item; - (void)launcherViewDidBeginEditing:(LauncherView*)launcher; - (void)launcherViewDidEndEditing:(LauncherView*)launcher; - (BOOL)launcherViewShouldWobble:(LauncherView*)launcher; @end #endif
/****************************************************************************** * Copyright 2017 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef MODULES_MONITOR_HWMONITOR_HW_SOCKETCAN_SOCKETCAN_TEST_H_ #define MODULES_MONITOR_HWMONITOR_HW_SOCKETCAN_SOCKETCAN_TEST_H_ #include <linux/can.h> #include <linux/can/raw.h> /** * @namespace apollo::monitor::hw * @brief apollo::monitor::hw */ namespace apollo { namespace monitor { namespace hw { /// Test (check) esdcan of the given id. /// @param stats where to store can bus stats. /// @param details where to store detailed can stats/state information. int socketcan_do_test(int id); } // namespace hw } // namespace monitor } // namespace apollo #endif // MODULES_MONITOR_HWMONITOR_HW_SOCKETCAN_SOCKETCAN_TEST_H_
// // AppDelegate.h // Test // // Created by Ernesto Rivera on 2016/05/06. // Copyright (c) 2016-2017 CyberAgent Inc. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// // UIButton+UECore.h // uecore // // Created by 崔明辉 on 16/9/9. // Copyright © 2016年 YY Inc. All rights reserved. // #import <UIKit/UIKit.h> @interface UIButton (UECore) @property (nonatomic, strong) UIView *uec_maskView; @property (nonatomic, assign) IBInspectable BOOL uec_Rounded; @property (nonatomic, assign) IBInspectable CGFloat uec_CornerRadius; @property (nonatomic, assign) IBInspectable BOOL uec_Animated; @property (nonatomic, strong) IBInspectable UIImage *uec_Placeholder; - (void)uec_setImageWithURL:(NSURL *)URL; @end
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <memory> #include <string> #include <utility> #include <boost/optional.hpp> #include <thrift/compiler/ast/t_throws.h> #include <thrift/compiler/ast/t_type.h> namespace apache { namespace thrift { namespace compiler { /** * A sink contains the types for stream of responses and a final response. * * Exceptions throw during the stream or instead of the final response can also * be specified. */ class t_sink : public t_templated_type { public: explicit t_sink(t_type_ref sink_type, t_type_ref final_response_type) : sink_type_(std::move(sink_type)), final_response_type_(std::move(final_response_type)) {} const t_type_ref& sink_type() const { return sink_type_; } const t_type_ref& final_response_type() const { return final_response_type_; } // Returns nullptr when throws clause is absent. t_throws* sink_exceptions() { return sink_exceptions_.get(); } const t_throws* sink_exceptions() const { return sink_exceptions_.get(); } // Use nullptr to indicate an absent throws clause. void set_sink_exceptions(std::unique_ptr<t_throws> sink_exceptions) { sink_exceptions_ = std::move(sink_exceptions); } // Returns nullptr when throws clause is absent. t_throws* final_response_exceptions() { return final_response_exceptions_.get(); } const t_throws* final_response_exceptions() const { return final_response_exceptions_.get(); } // Use nullptr to indicate an absent throws clause. void set_final_response_exceptions( std::unique_ptr<t_throws> final_response_exceptions) { final_response_exceptions_ = std::move(final_response_exceptions); } void set_first_response_type(boost::optional<t_type_ref> first_response) { first_response_type_ = std::move(first_response); } const boost::optional<t_type_ref>& first_response_type() const { return first_response_type_; } std::string get_full_name() const override { std::string result = "sink<" + sink_type_->get_full_name() + ", " + final_response_type_->get_full_name() + ">"; if (first_response_type_ != boost::none) { result += ", " + first_response_type_->deref().get_full_name(); } return result; } private: t_type_ref sink_type_; std::unique_ptr<t_throws> sink_exceptions_; t_type_ref final_response_type_; std::unique_ptr<t_throws> final_response_exceptions_; boost::optional<t_type_ref> first_response_type_; public: // TODO(afuller): Delete everything below here. It is only provided for // backwards compatibility. explicit t_sink( const t_type* sink_type, std::unique_ptr<t_throws> sink_exceptions, const t_type* final_response_type, std::unique_ptr<t_throws> final_response_exceptions) : t_sink( t_type_ref::from_req_ptr(sink_type), t_type_ref::from_req_ptr(final_response_type)) { set_sink_exceptions(std::move(sink_exceptions)); set_final_response_exceptions(std::move(final_response_exceptions)); } void set_first_response(const t_type* first_response) { set_first_response_type(t_type_ref::from_ptr(first_response)); } bool sink_has_first_response() const { return first_response_type_ != boost::none; } t_throws* get_final_response_xceptions() const { return final_response_exceptions_.get(); } t_throws* get_sink_xceptions() const { return sink_exceptions_.get(); } const t_type* get_sink_type() const { return sink_type().get_type(); } const t_type* get_first_response_type() const { return first_response_type_ == boost::none ? nullptr : first_response_type_->get_type(); } const t_type* get_final_response_type() const { return final_response_type().get_type(); } bool is_sink() const override { return true; } type get_type_value() const override { return type::t_sink; } }; } // namespace compiler } // namespace thrift } // namespace apache
/* ********************************************************************************************************* * uC/GUI * Universal graphic software for embedded applications * * (c) Copyright 2002, Micrium Inc., Weston, FL * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH * * µC/GUI is protected by international copyright laws. Knowledge of the * source code may not be used to write a similar product. This file may * only be used in accordance with a license and should not be redistributed * in any way. We appreciate your understanding and fairness. * ---------------------------------------------------------------------- File : LCDColor.C Purpose : Color conversion routines for LCD-drivers ---------------------------END-OF-HEADER------------------------------ */ #define LCDCOLOR_C #include <stddef.h> /* needed for definition of NULL */ #include "GUI.h" #include "LCD_Private.h" /* inter modul definitions & Config */ #include "GUIDebug.h" /* ********************************************************* * * * Config defaults * * * ********************************************************* */ #ifndef LCD_SIZEOF_COLORCACHE #define LCD_SIZEOF_COLORCACHE 0 #endif /* ********************************************************* * * * Caching (optional) * * * ********************************************************* */ #if LCD_SIZEOF_COLORCACHE static const LCD_LOGPALETTE * pLogPalCache; #endif /* ********************************************************* * * * Build color conversion table * * * ********************************************************* */ LCD_PIXELINDEX LCD__aConvTable[LCD_MAX_LOG_COLORS]; LCD_PIXELINDEX* LCD_GetpPalConvTableUncached(const LCD_LOGPALETTE* pLogPal) { if (pLogPal == NULL) { return NULL; } if (!pLogPal->pPalEntries) { return NULL; } /* Check if sufficient space is available */ if (pLogPal->NumEntries > LCD_MAX_LOG_COLORS) { return NULL; } /* Build conversion table */ { int i; int NumEntries = pLogPal->NumEntries; const LCD_COLOR* pPalEntry = &pLogPal->pPalEntries[0]; for (i=0; i< NumEntries; i++) { LCD__aConvTable[i] = LCD_Color2Index(*(pPalEntry+i)); } } return &LCD__aConvTable[0]; } LCD_PIXELINDEX* LCD_GetpPalConvTable(const LCD_LOGPALETTE* pLogPal) { /* Check cache */ #if LCD_SIZEOF_COLORCACHE if (pLogPalCache == pLogPal) { return &LCD__aConvTable[0]; } pLogPalCache = pLogPal; #endif return LCD_GetpPalConvTableUncached(pLogPal); } /* ********************************************************* * * * LCD_InitLUT * * * ********************************************************* */ void LCD_InitLUT(void) { #if (LCD_BITSPERPIXEL <= 8) { int i; for (i=0; i < LCD_NUM_COLORS; i++) { LCD_COLOR color = LCD_Index2Color((U8)i); #if LCD_REVERSE_LUT color ^= 0xffffff; /* Invert R,G,B components */ #endif LCD_L0_SetLUTEntry((U8)i, color); } } #endif #if (LCD_NUM_DISPLAYS > 1) #if (LCD_BITSPERPIXEL_1 <= 8) { int i; int DisplayOld = GUI_SelLCD(1); for (i=0; i < LCD_NUM_COLORS_1; i++) { LCD_COLOR color = LCD_Index2Color((U8)i); #if LCD_REVERSE_LUT color ^= 0xffffff; /* Invert R,G,B components */ #endif LCD_L0_1_SetLUTEntry((U8)i, color); } GUI_SelLCD(DisplayOld); } #endif #endif }
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\nsILocalFile.idl */ #ifndef __gen_nsILocalFile_h__ #define __gen_nsILocalFile_h__ #ifndef __gen_nsIFile_h__ #include "nsIFile.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif /* starting interface: nsILocalFile */ #define NS_ILOCALFILE_IID_STR "7ba8c6ba-2ce2-48b1-bd60-4c32aac35f9c" #define NS_ILOCALFILE_IID \ {0x7ba8c6ba, 0x2ce2, 0x48b1, \ { 0xbd, 0x60, 0x4c, 0x32, 0xaa, 0xc3, 0x5f, 0x9c }} class NS_NO_VTABLE nsILocalFile : public nsIFile { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILOCALFILE_IID) }; NS_DEFINE_STATIC_IID_ACCESSOR(nsILocalFile, NS_ILOCALFILE_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSILOCALFILE \ /* no methods! */ /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSILOCALFILE(_to) \ /* no methods! */ /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSILOCALFILE(_to) \ /* no methods! */ #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsLocalFile : public nsILocalFile { public: NS_DECL_ISUPPORTS NS_DECL_NSILOCALFILE nsLocalFile(); private: ~nsLocalFile(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS(nsLocalFile, nsILocalFile) nsLocalFile::nsLocalFile() { /* member initializers and constructor code */ } nsLocalFile::~nsLocalFile() { /* destructor code */ } /* End of implementation class template. */ #endif #endif /* __gen_nsILocalFile_h__ */
#pragma once #include "Instruction.h" namespace Hpipe { /** */ class InstructionPrio : public Instruction { public: using Instruction::Instruction; virtual void write_dot ( std::ostream &os, std::vector<std::string> *edge_labels = 0 ) const; virtual bool can_be_deleted() const; virtual Instruction *clone ( PtrPool<Instruction> &inst_pool, const Context &ncx, const Vec<unsigned> &keep_ind ); virtual void get_code_repr ( std::ostream &os ) override; }; } // namespace Hpipe
#ifndef CHASKY_CORE_FRAMEWORK_FUNC_H_ #define CHASKY_CORE_FRAMEWORK_FUNC_H_ #include <vector> #include <memory> #include <unordered_map> #include "chasky/core/common/status.h" #include "chasky/common/strings.h" #include "chasky/common/string_piece.h" #include "chasky/core/framework/argument.pb.h" #include "chasky/core/framework/argument.h" //#include "chasky/core/framework/exec_context.h" #include "chasky/core/framework/function.pb.h" #include "chasky/core/framework/graph.pb.h" namespace chasky { // Interface of Func, func only support two methods: // ForwardCompute, which is like ANN's forward; GradCompute, which // is like ANN's backward class FunctionInterface { public: typedef ::google::protobuf::Map<::std::string, ::chasky::AttrValue> extra_attr_t; // A Node will determine which function to use. And a function will init // itself according to function's definition(attributes). virtual Status InitFromProto(const FunctionDef &def) = 0; virtual Status ForwardCompute() = 0; virtual Status BackwardCompute() = 0; virtual const FunctionDef &Def() { return def_; } private: FunctionDef def_; }; // Base class for all funcs class Function : public FunctionInterface { public: struct ComputationItem { std::vector<ArgumentPtr> inputs; std::vector<ArgumentPtr> input_grads; std::vector<ArgumentPtr> outputs; std::vector<ArgumentPtr> output_grads; // weight's grad to update weight parameter. std::vector<ArgumentPtr> weight_grads; }; // void SetExecContext(ExecContext *context); Function() {} // Set model's parameters before function's compuatation. void SetModelParameters(std::vector<ArgumentPtr> *params) { CHECK(params); params_ = params; } ComputationItem &CompItem() { return comp_item_; } virtual void CheckContext() = 0; // Function registerer must use signature as key. static std::string Signature(const std::string &name, DataType dtype) { return strings::Printf("%s:%d", name.c_str(), dtype); } // Parse signature and extract different infomation fields. // Return true if successfully parsed, else false. static bool ParseSignature(const std::string &sign, std::string *name, DataType *dtype); // Create an func from definition // @def: func's definition // @attrs: node's attrs // The func's attributes is registered in `attrs`, this api should read // definition's field names and try to get value from `attrs`. virtual Status FromDef(FunctionDef &def, const extra_attr_t &attrs) = 0; StringPiece Name() const { return name_; } ArgumentPtr Input(size_t i) { CHECK_LT(i, comp_item_.inputs.size()); return comp_item_.inputs[i]; } ArgumentPtr Output(size_t i) { CHECK_LT(i, comp_item_.outputs.size()); return comp_item_.outputs[i]; } ArgumentPtr InputGrad(size_t i) { CHECK_LT(i, InputGrads().size()); return InputGrads()[i]; } ArgumentPtr OutputGrad(size_t i) { CHECK_LT(i, OutputGrads().size()); return OutputGrads()[i]; } ArgumentPtr &WeightGrad(size_t i) { CHECK_LT(i, WeightGrads().size()); return WeightGrads()[i]; } std::vector<ArgumentPtr> &Inputs() { return comp_item_.inputs; } std::vector<ArgumentPtr> &Outputs() { return comp_item_.outputs; } std::vector<ArgumentPtr> &InputGrads() { return comp_item_.input_grads; } std::vector<ArgumentPtr> &OutputGrads() { return comp_item_.output_grads; } std::vector<ArgumentPtr> &WeightGrads() { return comp_item_.weight_grads; } protected: FunctionDef *def_; // model parameters std::vector<ArgumentPtr> *params_; ComputationItem comp_item_; private: StringPiece name_; }; class FunctionLibrary { public: typedef std::function<std::unique_ptr<Function>()> FunctionCreatorType; // Singleton, the global func library static FunctionLibrary &Instance() { static FunctionLibrary *library = new FunctionLibrary(); return *library; } // Register an func creator with a name, if another func called the // same name exists, then it will not insert the new func and just // return error. // NOTE It is not thread-safe. Status Register(const std::string &name, FunctionCreatorType &&creator) CH_USE_RESULT; // Look up the library for the func which match the name, if not exits, // just return error. // NOTE It is not Rewrie-Read thread-sefe. Status LookUp(const std::string &name, FunctionCreatorType **creator) CH_USE_RESULT; // Human readable description of all the func creator store in // the library. std::string DebugString() const; // Number of func creators in the library size_t Size() const; private: std::unordered_map<std::string, FunctionCreatorType> op_library_; }; // #define REGISTER_OP(NAME, CLASS) \ // FunctionLibrary::Instance().Register( \ // NAME, [] { return std::unique_ptr<Function>(new CLASS); }); } #endif
/** * Created by G-Canvas Open Source Team. * Copyright (c) 2017, Alibaba, Inc. All rights reserved. * * This source code is licensed under the Apache Licence 2.0. * For the full copyright and license information, please view * the LICENSE file in the root directory of this source tree. */ #ifndef GCanvasSDK_h #define GCanvasSDK_h #import "GCanvasViewProtocol.h" #import "GCanvasModuleProtocol.h" #import "GCanvasModule.h" #import "GCanvasObject.h" #import "GCanvasPlugin.h" #import "GCVCommon.h" #import "GCVLog.h" #endif /* GCanvasSDK_h */
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <netinet/tcp.h> #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <netdb.h> int socket_connect(char *host, in_port_t port){ struct hostent *hp; struct sockaddr_in addr; int on = 1, sock; if((hp = gethostbyname(host)) == NULL){ herror("gethostbyname"); exit(1); } bcopy(hp->h_addr, &addr.sin_addr, hp->h_length); addr.sin_port = htons(port); addr.sin_family = AF_INET; sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&on, sizeof(int)); if(sock == -1){ perror("setsockopt"); exit(1); } if(connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1){ perror("connect"); exit(1); } return sock; } #define BUFFER_SIZE 1024 int main(int argc, char *argv[]){ int fd; char buffer[BUFFER_SIZE]; if(argc < 3){ fprintf(stderr, "Usage: %s <hostname> <port>\n", argv[0]); exit(1); } fd = socket_connect(argv[1], atoi(argv[2])); write(fd, "GET /\r\n", strlen("GET /\r\n")); // write(fd, char[]*, len); bzero(buffer, BUFFER_SIZE); while(read(fd, buffer, BUFFER_SIZE - 1) != 0){ fprintf(stderr, "%s", buffer); bzero(buffer, BUFFER_SIZE); } shutdown(fd, SHUT_RDWR); close(fd); return 0; }
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/ssm/SSM_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace SSM { namespace Model { enum class CommandPluginStatus { NOT_SET, Pending, InProgress, Success, TimedOut, Cancelled, Failed }; namespace CommandPluginStatusMapper { AWS_SSM_API CommandPluginStatus GetCommandPluginStatusForName(const Aws::String& name); AWS_SSM_API Aws::String GetNameForCommandPluginStatus(CommandPluginStatus value); } // namespace CommandPluginStatusMapper } // namespace Model } // namespace SSM } // namespace Aws
/* insns.h header file for insns.c * * The Netwide Assembler is copyright (C) 1996 Simon Tatham and * Julian Hall. All rights reserved. The software is * redistributable under the license given in the file "LICENSE" * distributed in the NASM archive. */ #ifndef NASM_INSNS_H #define NASM_INSNS_H #include "nasm.h" #include "tokens.h" #include "iflag.h" /* if changed, ITEMPLATE_END should be also changed accordingly */ struct itemplate { enum opcode opcode; /* the token, passed from "parser.c" */ int operands; /* number of operands */ opflags_t opd[MAX_OPERANDS]; /* bit flags for operand types */ decoflags_t deco[MAX_OPERANDS]; /* bit flags for operand decorators */ const uint8_t *code; /* the code it assembles to */ uint32_t iflag_idx; /* some flags referenced by index */ }; /* Disassembler table structure */ /* * If n == -1, then p points to another table of 256 * struct disasm_index, otherwise p points to a list of n * struct itemplates to consider. */ struct disasm_index { const void *p; int n; }; /* Tables for the assembler and disassembler, respectively */ extern const struct itemplate * const nasm_instructions[]; extern const struct disasm_index itable[256]; extern const struct disasm_index * const itable_vex[NASM_VEX_CLASSES][32][4]; /* Common table for the byte codes */ extern const uint8_t nasm_bytecodes[]; /* * this define is used to signify the end of an itemplate */ #define ITEMPLATE_END {I_none,0,{0,},{0,},NULL,0} /* Width of Dx and RESx instructions */ int const_func idata_bytes(enum opcode opcode); int const_func resv_bytes(enum opcode opcode); /* * Pseudo-op tests */ /* DB-type instruction (DB, DW, ...) */ static inline bool opcode_is_db(enum opcode opcode) { return idata_bytes(opcode) > 0; } /* RESB-type instruction (RESB, RESW, ...) */ static inline bool opcode_is_resb(enum opcode opcode) { return resv_bytes(opcode) > 0; } #endif /* NASM_INSNS_H */
/* * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #include <sys/param.h> #include "esp_mbedtls_dynamic_impl.h" int __real_mbedtls_ssl_handshake_server_step(mbedtls_ssl_context *ssl); int __wrap_mbedtls_ssl_handshake_server_step(mbedtls_ssl_context *ssl); static const char *TAG = "SSL Server"; static int manage_resource(mbedtls_ssl_context *ssl, bool add) { int state = add ? ssl->MBEDTLS_PRIVATE(state) : ssl->MBEDTLS_PRIVATE(state) - 1; if (ssl->MBEDTLS_PRIVATE(state) == MBEDTLS_SSL_HANDSHAKE_OVER || ssl->MBEDTLS_PRIVATE(handshake) == NULL) { return 0; } if (!add) { if (!ssl->MBEDTLS_PRIVATE(out_left)) { CHECK_OK(esp_mbedtls_free_tx_buffer(ssl)); } } switch (state) { case MBEDTLS_SSL_HELLO_REQUEST: ssl->MBEDTLS_PRIVATE(major_ver) = MBEDTLS_SSL_MAJOR_VERSION_3; break; case MBEDTLS_SSL_CLIENT_HELLO: if (add) { CHECK_OK(esp_mbedtls_add_rx_buffer(ssl)); } else { CHECK_OK(esp_mbedtls_free_rx_buffer(ssl)); } break; case MBEDTLS_SSL_SERVER_HELLO: if (add) { size_t buffer_len = MBEDTLS_SSL_OUT_BUFFER_LEN; CHECK_OK(esp_mbedtls_add_tx_buffer(ssl, buffer_len)); } break; case MBEDTLS_SSL_SERVER_CERTIFICATE: if (add) { size_t buffer_len = 3; mbedtls_ssl_key_cert *key_cert = ssl->MBEDTLS_PRIVATE(conf)->MBEDTLS_PRIVATE(key_cert); while (key_cert && key_cert->cert) { size_t num; buffer_len += esp_mbedtls_get_crt_size(key_cert->cert, &num); buffer_len += num * 3; key_cert = key_cert->next; } buffer_len = MAX(buffer_len, MBEDTLS_SSL_OUT_BUFFER_LEN); CHECK_OK(esp_mbedtls_add_tx_buffer(ssl, buffer_len)); } else { #ifdef CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA esp_mbedtls_free_keycert_cert(ssl); #endif } break; case MBEDTLS_SSL_SERVER_KEY_EXCHANGE: if (add) { size_t buffer_len = MBEDTLS_SSL_OUT_BUFFER_LEN; CHECK_OK(esp_mbedtls_add_tx_buffer(ssl, buffer_len)); } else { #ifdef CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA esp_mbedtls_free_dhm(ssl); esp_mbedtls_free_keycert_key(ssl); esp_mbedtls_free_keycert(ssl); #endif } break; case MBEDTLS_SSL_CERTIFICATE_REQUEST: if (add) { size_t buffer_len = MBEDTLS_SSL_OUT_BUFFER_LEN; CHECK_OK(esp_mbedtls_add_tx_buffer(ssl, buffer_len)); } break; case MBEDTLS_SSL_SERVER_HELLO_DONE: if (add) { size_t buffer_len = MBEDTLS_SSL_OUT_BUFFER_LEN; CHECK_OK(esp_mbedtls_add_tx_buffer(ssl, buffer_len)); } break; case MBEDTLS_SSL_CLIENT_CERTIFICATE: if (add) { CHECK_OK(esp_mbedtls_add_rx_buffer(ssl)); } else { CHECK_OK(esp_mbedtls_free_rx_buffer(ssl)); #ifdef CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT esp_mbedtls_free_cacert(ssl); #endif } break; case MBEDTLS_SSL_CLIENT_KEY_EXCHANGE: if (add) { CHECK_OK(esp_mbedtls_add_rx_buffer(ssl)); } else { CHECK_OK(esp_mbedtls_free_rx_buffer(ssl)); } break; case MBEDTLS_SSL_CERTIFICATE_VERIFY: if (add) { CHECK_OK(esp_mbedtls_add_rx_buffer(ssl)); } else { CHECK_OK(esp_mbedtls_free_rx_buffer(ssl)); } break; case MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC: if (add) { CHECK_OK(esp_mbedtls_add_rx_buffer(ssl)); } else { CHECK_OK(esp_mbedtls_free_rx_buffer(ssl)); } break; case MBEDTLS_SSL_CLIENT_FINISHED: if (add) { CHECK_OK(esp_mbedtls_add_rx_buffer(ssl)); } else { CHECK_OK(esp_mbedtls_free_rx_buffer(ssl)); } break; case MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC: if (add) { size_t buffer_len = MBEDTLS_SSL_OUT_BUFFER_LEN; CHECK_OK(esp_mbedtls_add_tx_buffer(ssl, buffer_len)); } break; case MBEDTLS_SSL_SERVER_FINISHED: if (add) { size_t buffer_len = MBEDTLS_SSL_OUT_BUFFER_LEN; CHECK_OK(esp_mbedtls_add_tx_buffer(ssl, buffer_len)); } break; case MBEDTLS_SSL_FLUSH_BUFFERS: break; case MBEDTLS_SSL_HANDSHAKE_WRAPUP: break; default: break; } return 0; } int __wrap_mbedtls_ssl_handshake_server_step(mbedtls_ssl_context *ssl) { CHECK_OK(manage_resource(ssl, true)); CHECK_OK(__real_mbedtls_ssl_handshake_server_step(ssl)); CHECK_OK(manage_resource(ssl, false)); return 0; }
/** * Course: EG1302A - Spring 2014 * Name: Nicholas Tello * Date Created: 1/28/2014 * Assignment: Assignment 5 **/ #include <stdio.h> #include <stdlib.h> int main(){printf("Course: EG1302A - Spring 2014\n"); printf("Name: Nicholas Tello\n");printf("Date Created: %d/%d/%d\n", 1, 28, 2014); printf("Assignment: Assignment 5\n");return 0;}
/* * 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/comprehend/Comprehend_EXPORTS.h> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace Comprehend { namespace Model { /** * <p>Detailed information about the accuracy of an entity recognizer for a * specific entity type. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/EntityTypesEvaluationMetrics">AWS * API Reference</a></p> */ class AWS_COMPREHEND_API EntityTypesEvaluationMetrics { public: EntityTypesEvaluationMetrics(); EntityTypesEvaluationMetrics(Aws::Utils::Json::JsonView jsonValue); EntityTypesEvaluationMetrics& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>A measure of the usefulness of the recognizer results for a specific entity * type in the test data. High precision means that the recognizer returned * substantially more relevant results than irrelevant ones. </p> */ inline double GetPrecision() const{ return m_precision; } /** * <p>A measure of the usefulness of the recognizer results for a specific entity * type in the test data. High precision means that the recognizer returned * substantially more relevant results than irrelevant ones. </p> */ inline bool PrecisionHasBeenSet() const { return m_precisionHasBeenSet; } /** * <p>A measure of the usefulness of the recognizer results for a specific entity * type in the test data. High precision means that the recognizer returned * substantially more relevant results than irrelevant ones. </p> */ inline void SetPrecision(double value) { m_precisionHasBeenSet = true; m_precision = value; } /** * <p>A measure of the usefulness of the recognizer results for a specific entity * type in the test data. High precision means that the recognizer returned * substantially more relevant results than irrelevant ones. </p> */ inline EntityTypesEvaluationMetrics& WithPrecision(double value) { SetPrecision(value); return *this;} /** * <p>A measure of how complete the recognizer results are for a specific entity * type in the test data. High recall means that the recognizer returned most of * the relevant results.</p> */ inline double GetRecall() const{ return m_recall; } /** * <p>A measure of how complete the recognizer results are for a specific entity * type in the test data. High recall means that the recognizer returned most of * the relevant results.</p> */ inline bool RecallHasBeenSet() const { return m_recallHasBeenSet; } /** * <p>A measure of how complete the recognizer results are for a specific entity * type in the test data. High recall means that the recognizer returned most of * the relevant results.</p> */ inline void SetRecall(double value) { m_recallHasBeenSet = true; m_recall = value; } /** * <p>A measure of how complete the recognizer results are for a specific entity * type in the test data. High recall means that the recognizer returned most of * the relevant results.</p> */ inline EntityTypesEvaluationMetrics& WithRecall(double value) { SetRecall(value); return *this;} /** * <p>A measure of how accurate the recognizer results are for for a specific * entity type in the test data. It is derived from the <code>Precision</code> and * <code>Recall</code> values. The <code>F1Score</code> is the harmonic average of * the two scores. The highest score is 1, and the worst score is 0. </p> */ inline double GetF1Score() const{ return m_f1Score; } /** * <p>A measure of how accurate the recognizer results are for for a specific * entity type in the test data. It is derived from the <code>Precision</code> and * <code>Recall</code> values. The <code>F1Score</code> is the harmonic average of * the two scores. The highest score is 1, and the worst score is 0. </p> */ inline bool F1ScoreHasBeenSet() const { return m_f1ScoreHasBeenSet; } /** * <p>A measure of how accurate the recognizer results are for for a specific * entity type in the test data. It is derived from the <code>Precision</code> and * <code>Recall</code> values. The <code>F1Score</code> is the harmonic average of * the two scores. The highest score is 1, and the worst score is 0. </p> */ inline void SetF1Score(double value) { m_f1ScoreHasBeenSet = true; m_f1Score = value; } /** * <p>A measure of how accurate the recognizer results are for for a specific * entity type in the test data. It is derived from the <code>Precision</code> and * <code>Recall</code> values. The <code>F1Score</code> is the harmonic average of * the two scores. The highest score is 1, and the worst score is 0. </p> */ inline EntityTypesEvaluationMetrics& WithF1Score(double value) { SetF1Score(value); return *this;} private: double m_precision; bool m_precisionHasBeenSet; double m_recall; bool m_recallHasBeenSet; double m_f1Score; bool m_f1ScoreHasBeenSet; }; } // namespace Model } // namespace Comprehend } // namespace Aws
//---------------------------------------------------------- -*- Mode: C++ -*- // $Id$ // // Created 2006/03/16 // Author: Sriram Rao // // Copyright 2008-2012,2016 Quantcast Corporation. All rights reserved. // Copyright 2006-2008 Kosmix Corp. // // This file is part of Kosmos File System (KFS). // // 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 _CHUNKSERVER_H #define _CHUNKSERVER_H #include "common/kfsdecls.h" #include "kfsio/NetManagerWatcher.h" #include "RemoteSyncSM.h" #include <vector> #include <string> class QCMutex; namespace KFS { using std::string; using std::vector; // Chunk server globals and main event loop. class ChunkServer { public: bool Init( const ServerLocation& clientListener, bool ipV6OnlyFlag, const string& serverIp, int threadCount, int firstCpuIdx); bool MainLoop( const vector<string>& chunkDirs, const Properties& props); bool IsLocalServer(const ServerLocation& location) const { return mLocation == location; } RemoteSyncSMPtr FindServer( const ServerLocation& location, bool connectFlag, const char* sessionTokenPtr, int sessionTokenLen, const char* sessionKeyPtr, int sessionKeyLen, bool writeMasterFlag, bool shutdownSslFlag, bool shortRpcFmtFlag, int& err, string& errMsg); string GetMyLocation() const { return mLocation.ToString(); } const ServerLocation& GetLocation() const { return mLocation; } void OpInserted() { mOpCount++; } void OpFinished() { mOpCount--; if (mOpCount < 0) { mOpCount = 0; } } int GetNumOps() const { return mOpCount; } bool CanUpdateServerIp() const { return mUpdateServerIpFlag; } Watchdog& GetWatchdog() { return mWatchdog; } void SetParameters(const Properties& props) { mWatchdog.SetParameters("chunkServer.watchdog.", props); } const ServerLocation& GetConfigLocation() const { return mUpdateServerIpFlag ? mLocation : mConfigLocation; } inline void SetLocation(const ServerLocation& loc); private: // # of ops in the system int mOpCount; bool mUpdateServerIpFlag; ServerLocation mLocation; ServerLocation mConfigLocation; RemoteSyncSMList mRemoteSyncers; QCMutex* mMutex; Watchdog mWatchdog; NetManagerWatcher mNetManagerWatcher; ChunkServer(); ~ChunkServer() {} friend class ChunkServerGlobals; private: // No copy. ChunkServer(const ChunkServer&); ChunkServer& operator=(const ChunkServer&); }; extern ChunkServer& gChunkServer; } #endif // _CHUNKSERVER_H
/* * File: fat32-util.c * Author: Ducky * * Created on July 28, 2011, 12:35 PM * * Revision History * Date Author Change * 28 Jul 2011 Ducky Initial implementation. * * @file * Helper funcitons for the FAT32 library. These are all simple calculation * functions and do not involve reading from the card. */ #include <string.h> #include "fat32.h" inline uint16_t FATDataToInt16(uint8_t *data) { uint16_t store; uint8_t *storeByte = (uint8_t*)&store; storeByte[0] = data[0]; storeByte[1] = data[1]; return store; } inline uint32_t FATDataToInt32(uint8_t *data) { uint32_t store; uint8_t *storeByte = (uint8_t*)&store; storeByte[0] = data[0]; storeByte[1] = data[1]; storeByte[2] = data[2]; storeByte[3] = data[3]; return store; } inline uint32_t FATSplitDataToInt32(uint8_t *dataHigh, uint8_t *dataLow) { uint32_t store; uint8_t *storeByte = (uint8_t*)&store; storeByte[0] = dataLow[0]; storeByte[1] = dataLow[1]; storeByte[2] = dataHigh[0]; storeByte[3] = dataHigh[1]; return store; } inline void Int16ToFATData(uint8_t *dest, uint16_t data) { uint8_t *dataByte = (uint8_t*)&data; dest[0] = dataByte[0]; dest[1] = dataByte[1]; } inline void Int32ToFATData(uint8_t *dest, uint32_t data) { uint8_t *dataByte = (uint8_t*)&data; dest[0] = dataByte[0]; dest[1] = dataByte[1]; dest[2] = dataByte[2]; dest[3] = dataByte[3]; } inline void Int32ToFATSplitData(uint8_t *destHigh, uint8_t *destLow, uint32_t data) { uint8_t *dataByte = (uint8_t*)&data; destLow[0] = dataByte[0]; destLow[1] = dataByte[1]; destHigh[0] = dataByte[2]; destHigh[1] = dataByte[3]; } inline uint16_t GetClustersPerBlock(FS_FAT32 *fs) { return fs->bytesPerSector / fs->clusterPointerSize; } inline fs_addr_t GetClusterFATLBA(FS_FAT32 *fs, uint32_t clusterNumber) { return fs->FAT_LBA_Begin + (clusterNumber / GetClustersPerBlock(fs)); } inline uint16_t GetClusterFATOffset(FS_FAT32 *fs, uint32_t clusterNumber) { return (clusterNumber % GetClustersPerBlock(fs)) * fs->clusterPointerSize; } inline fs_addr_t GetClusterLBA(FS_FAT32 *fs, uint32_t clusterNumber) { return fs->Cluster_LBA_Begin + (clusterNumber - 2) * fs->sectorsPerCluster; } void FAT32_FillFSInformationSector(FS_FAT32 *fs, uint8_t *data) { data[0x00] = 0x52; data[0x01] = 0x52; data[0x02] = 0x61; data[0x03] = 0x41; memset(data+0x04, 0, 0x1e4 - 0x04); data[0x1e4] = 0x72; data[0x1e5] = 0x72; data[0x1e6] = 0x41; data[0x1e7] = 0x61; Int32ToFATData(data + 0x1e8, fs->numFreeClusters); Int32ToFATData(data + 0x1ec, fs->mostRecentCluster); memset(data+0x1f0, 0, 0x1fe - 0x1f0); data[0x1fe] = 0x55; data[0x1ff] = 0xaa; }
/* * Copyright (c) 2015 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * snap.h: SNAP definitions * * Copyright (c) 2008 Eliot Dresselhaus * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef included_snap_h #define included_snap_h #include <vnet/vnet.h> #include <vnet/pg/pg.h> #define foreach_ieee_oui \ _ (0x000000, ethernet) \ _ (0x00000c, cisco) typedef enum { #define _(n,f) IEEE_OUI_##f = n, foreach_ieee_oui #undef _ } ieee_oui_t; #define foreach_snap_cisco_protocol \ _ (0x0102, drip) \ _ (0x0104, port_aggregation_protocol) \ _ (0x0105, mls_hello) \ _ (0x010b, per_vlan_spanning_tree) \ _ (0x010c, vlan_bridge) \ _ (0x0111, unidirectional_link_detection) \ _ (0x2000, cdp) \ _ (0x2001, cgmp) \ _ (0x2003, vtp) \ _ (0x2004, dtp) \ _ (0x200a, stp_uplink_fast) typedef enum { #define _(n,f) SNAP_cisco_##f = n, foreach_snap_cisco_protocol #undef _ } snap_cisco_protocol_t; typedef union { /* *INDENT-OFF* */ CLIB_PACKED (struct { /* OUI: organization unique identifier. */ u8 oui[3]; /* Per-OUI protocol. */ u16 protocol; }); /* *INDENT-ON* */ u8 as_u8[5]; } snap_header_t; typedef struct { u32 oui; u32 protocol; } snap_oui_and_protocol_t; typedef struct { /* Name vector string. */ u8 *name; snap_oui_and_protocol_t oui_and_protocol; /* Node which handles this type. */ u32 node_index; /* snap-input next index for this type. */ u32 next_index; } snap_protocol_info_t; always_inline void snap_header_set_protocol (snap_header_t * h, snap_oui_and_protocol_t * p) { u16 protocol = p->protocol; u32 oui = p->oui; h->protocol = clib_host_to_net_u16 (protocol); h->oui[0] = (oui >> 16) & 0xff; h->oui[1] = (oui >> 8) & 0xff; h->oui[2] = (oui >> 0) & 0xff; } #define foreach_snap_error \ _ (NONE, "no error") \ _ (UNKNOWN_PROTOCOL, "unknown oui/snap protocol") typedef enum { #define _(f,s) SNAP_ERROR_##f, foreach_snap_error #undef _ SNAP_N_ERROR, } snap_error_t; typedef struct { vlib_main_t *vlib_main; /* Vector of known SNAP oui/protocol pairs. */ snap_protocol_info_t *protocols; /* Hash table mapping oui/protocol to protocol index. */ mhash_t protocol_hash; /* Hash table mapping protocol by name. */ uword *protocol_info_by_name; } snap_main_t; always_inline u32 snap_header_get_oui (snap_header_t * h) { return (h->oui[0] << 16) | (h->oui[1] << 8) | h->oui[2]; } always_inline snap_protocol_info_t * snap_get_protocol_info (snap_main_t * sm, snap_header_t * h) { snap_oui_and_protocol_t key; uword *p; key.oui = snap_header_get_oui (h); key.protocol = h->protocol; p = mhash_get (&sm->protocol_hash, &key); return p ? vec_elt_at_index (sm->protocols, p[0]) : 0; } extern snap_main_t snap_main; /* Register given node index to take input for given snap type. */ void snap_register_input_protocol (vlib_main_t * vm, char *name, u32 ieee_oui, u16 protocol, u32 node_index); format_function_t format_snap_protocol; format_function_t format_snap_header; format_function_t format_snap_header_with_length; /* Parse snap protocol as 0xXXXX or protocol name. */ unformat_function_t unformat_snap_protocol; /* Parse snap header. */ unformat_function_t unformat_snap_header; unformat_function_t unformat_pg_snap_header; always_inline void snap_setup_node (vlib_main_t * vm, u32 node_index) { vlib_node_t *n = vlib_get_node (vm, node_index); pg_node_t *pn = pg_get_node (node_index); n->format_buffer = format_snap_header_with_length; n->unformat_buffer = unformat_snap_header; pn->unformat_edit = unformat_pg_snap_header; } #endif /* included_snap_h */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */
#pragma once class HuffmanNode { public: HuffmanNode(); HuffmanNode(char c, int freq, HuffmanNode* left, HuffmanNode* right); HuffmanNode(const HuffmanNode& node); bool IsLeaf(); public: char m_c; int m_freq; HuffmanNode* m_left; HuffmanNode* m_right; friend bool operator>(HuffmanNode& node1, HuffmanNode& node2); friend bool operator<(HuffmanNode& node1, HuffmanNode& node2); friend bool operator==(HuffmanNode& node1, HuffmanNode& node2); }; HuffmanNode::HuffmanNode():m_c(0), m_freq(0), m_left(0), m_right(0) {} HuffmanNode::HuffmanNode(char c, int freq, HuffmanNode* left, HuffmanNode* right) :m_c(c), m_freq(freq), m_left(left), m_right(right) {} HuffmanNode::HuffmanNode(const HuffmanNode& node) { this->m_c = node.m_c; this->m_freq = node.m_freq; this->m_left = node.m_left; this->m_right = node.m_right; } bool HuffmanNode::IsLeaf() { return this->m_left == 0 && this->m_right == 0; } bool operator>(HuffmanNode& node1, HuffmanNode& node2) { return node1.m_freq > node2.m_freq; } bool operator<(HuffmanNode& node1, HuffmanNode& node2) { return node1.m_freq < node2.m_freq; } bool operator==(HuffmanNode& node1, HuffmanNode& node2) { return node1.m_freq == node2.m_freq; }
// // SQHomeViewController.h // LYZSJC // // Created by 沈强 on 16/4/14. // Copyright © 2016年 SQ. All rights reserved. // #import <UIKit/UIKit.h> @interface SQHomeViewController : UIViewController @end
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/fsx/FSx_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/fsx/model/DataRepositoryLifecycle.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace FSx { namespace Model { class AWS_FSX_API DeleteDataRepositoryAssociationResult { public: DeleteDataRepositoryAssociationResult(); DeleteDataRepositoryAssociationResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); DeleteDataRepositoryAssociationResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>The ID of the data repository association being deleted.</p> */ inline const Aws::String& GetAssociationId() const{ return m_associationId; } /** * <p>The ID of the data repository association being deleted.</p> */ inline void SetAssociationId(const Aws::String& value) { m_associationId = value; } /** * <p>The ID of the data repository association being deleted.</p> */ inline void SetAssociationId(Aws::String&& value) { m_associationId = std::move(value); } /** * <p>The ID of the data repository association being deleted.</p> */ inline void SetAssociationId(const char* value) { m_associationId.assign(value); } /** * <p>The ID of the data repository association being deleted.</p> */ inline DeleteDataRepositoryAssociationResult& WithAssociationId(const Aws::String& value) { SetAssociationId(value); return *this;} /** * <p>The ID of the data repository association being deleted.</p> */ inline DeleteDataRepositoryAssociationResult& WithAssociationId(Aws::String&& value) { SetAssociationId(std::move(value)); return *this;} /** * <p>The ID of the data repository association being deleted.</p> */ inline DeleteDataRepositoryAssociationResult& WithAssociationId(const char* value) { SetAssociationId(value); return *this;} /** * <p>Describes the lifecycle state of the data repository association being * deleted.</p> */ inline const DataRepositoryLifecycle& GetLifecycle() const{ return m_lifecycle; } /** * <p>Describes the lifecycle state of the data repository association being * deleted.</p> */ inline void SetLifecycle(const DataRepositoryLifecycle& value) { m_lifecycle = value; } /** * <p>Describes the lifecycle state of the data repository association being * deleted.</p> */ inline void SetLifecycle(DataRepositoryLifecycle&& value) { m_lifecycle = std::move(value); } /** * <p>Describes the lifecycle state of the data repository association being * deleted.</p> */ inline DeleteDataRepositoryAssociationResult& WithLifecycle(const DataRepositoryLifecycle& value) { SetLifecycle(value); return *this;} /** * <p>Describes the lifecycle state of the data repository association being * deleted.</p> */ inline DeleteDataRepositoryAssociationResult& WithLifecycle(DataRepositoryLifecycle&& value) { SetLifecycle(std::move(value)); return *this;} /** * <p>Indicates whether data in the file system that corresponds to the data * repository association is being deleted. Default is <code>false</code>.</p> */ inline bool GetDeleteDataInFileSystem() const{ return m_deleteDataInFileSystem; } /** * <p>Indicates whether data in the file system that corresponds to the data * repository association is being deleted. Default is <code>false</code>.</p> */ inline void SetDeleteDataInFileSystem(bool value) { m_deleteDataInFileSystem = value; } /** * <p>Indicates whether data in the file system that corresponds to the data * repository association is being deleted. Default is <code>false</code>.</p> */ inline DeleteDataRepositoryAssociationResult& WithDeleteDataInFileSystem(bool value) { SetDeleteDataInFileSystem(value); return *this;} private: Aws::String m_associationId; DataRepositoryLifecycle m_lifecycle; bool m_deleteDataInFileSystem; }; } // namespace Model } // namespace FSx } // namespace Aws
// // Created by Yao Guai on 16/10/2. // Copyright (c) 2016 minions.jegarn.com. All rights reserved. // #import <Foundation/Foundation.h> #import "JegarnPacket.h" @class JegarnHasSubTypePacketContent; @interface JegarnHasSubTypePacket : JegarnPacket @property (nonatomic, readonly) JegarnHasSubTypePacketContent *content; + (NSString *) packetSubType; @end
// // Created by Ray Jenkins on 4/27/15. // #ifndef CONSERVATOR_GETDATABUILDERIMPL_H #define CONSERVATOR_GETDATABUILDERIMPL_H #include <zookeeper.h> #include "GetDataBuilder.h" #include <iostream> using namespace std; class GetDataBuilderImpl : public GetDataBuilder<string> { public: virtual ~GetDataBuilderImpl() { } GetDataBuilderImpl(zhandle_t *zk, int znode_size); Pathable<string>* withWatcher(watcher_fn watcherFn, void * watcherCtx); Pathable<string>* storingStatIn(struct Stat* stat); string forPath(string path); string forPath(string path, int length); private: zhandle_t *zk = NULL; struct Stat* stat = NULL; watcher_fn watcherFn = NULL; void * watcherCtx = NULL; int znode_size; }; #endif //CONSERVATOR_GETDATABUILDERIMPL_H
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/cognito-idp/CognitoIdentityProvider_EXPORTS.h> #include <aws/cognito-idp/model/PasswordPolicyType.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace CognitoIdentityProvider { namespace Model { /** * <p>The policy associated with a user pool.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UserPoolPolicyType">AWS * API Reference</a></p> */ class AWS_COGNITOIDENTITYPROVIDER_API UserPoolPolicyType { public: UserPoolPolicyType(); UserPoolPolicyType(Aws::Utils::Json::JsonView jsonValue); UserPoolPolicyType& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The password policy.</p> */ inline const PasswordPolicyType& GetPasswordPolicy() const{ return m_passwordPolicy; } /** * <p>The password policy.</p> */ inline bool PasswordPolicyHasBeenSet() const { return m_passwordPolicyHasBeenSet; } /** * <p>The password policy.</p> */ inline void SetPasswordPolicy(const PasswordPolicyType& value) { m_passwordPolicyHasBeenSet = true; m_passwordPolicy = value; } /** * <p>The password policy.</p> */ inline void SetPasswordPolicy(PasswordPolicyType&& value) { m_passwordPolicyHasBeenSet = true; m_passwordPolicy = std::move(value); } /** * <p>The password policy.</p> */ inline UserPoolPolicyType& WithPasswordPolicy(const PasswordPolicyType& value) { SetPasswordPolicy(value); return *this;} /** * <p>The password policy.</p> */ inline UserPoolPolicyType& WithPasswordPolicy(PasswordPolicyType&& value) { SetPasswordPolicy(std::move(value)); return *this;} private: PasswordPolicyType m_passwordPolicy; bool m_passwordPolicyHasBeenSet; }; } // namespace Model } // namespace CognitoIdentityProvider } // namespace Aws
/* * Copyright (c) 2003, 2007-8 Matteo Frigo * Copyright (c) 2003, 2007-8 Massachusetts Institute of Technology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "../codelet-rdft.h" #include "r2cf.h" const kr2c_genus fftwf_rdft_r2cf_genus = { R2HC, 1 }; #include "r2cfII.h" const kr2c_genus fftwf_rdft_r2cfII_genus = { R2HCII, 1 }; #include "r2cb.h" const kr2c_genus fftwf_rdft_r2cb_genus = { HC2R, 1 }; #include "r2cbIII.h" const kr2c_genus fftwf_rdft_r2cbIII_genus = { HC2RIII, 1 };
/* * Licensed under the Apache License, Version 2.0 (the "License") = 0; * 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 <mutex> #include "../Scan.h" #include "../scanrequest/ScanIdentifier.h" #include "../scanrequest/ScanRequest.h" #include "AccumuloFacade.h" #include "data/constructs/security/AuthInfo.h" #include "data/constructs/security/Permissions.h" #include "data/extern/thrift/ThriftWrapper.h" #include "data/extern/thriftv2/ThriftV2Wrapper.h" #include "logging/Logger.h" namespace interconnect { class AccumuloServerFacade { private: std::shared_ptr<logging::Logger> logger; protected: uint8_t accumuloVersion; public: explicit AccumuloServerFacade(int version); virtual ~AccumuloServerFacade() {} virtual Scan *multiScan( std::atomic<bool> *isRunning, ScanRequest<ScanIdentifier<std::shared_ptr<cclient::data::KeyExtent>, std::shared_ptr<cclient::data::Range>>> *request) = 0; virtual Scan *singleScan( std::atomic<bool> *isRunning, ScanRequest<ScanIdentifier<std::shared_ptr<cclient::data::KeyExtent>, std::shared_ptr<cclient::data::Range>>> *request) = 0; virtual Scan *beginScan( std::atomic<bool> *isRunning, ScanRequest<ScanIdentifier<std::shared_ptr<cclient::data::KeyExtent>, std::shared_ptr<cclient::data::Range>>> *request) = 0; virtual Scan *continueScan(Scan *originalScan) = 0; virtual void *write( cclient::data::security::AuthInfo *auth, std::map<cclient::data::KeyExtent, std::vector<std::shared_ptr<cclient::data::Mutation>>> *request) = 0; virtual bool dropUser(cclient::data::security::AuthInfo *auth, const std::string &user) = 0; virtual bool changeUserPassword(cclient::data::security::AuthInfo *auth, const std::string &user, const std::string &password) = 0; virtual bool createUser(cclient::data::security::AuthInfo *auth, const std::string &user, const std::string &password) = 0; virtual std::map<std::string, std::string> getTableConfiguration( cclient::data::security::AuthInfo *auth, const std::string &table) = 0; virtual cclient::data::security::Authorizations *getUserAuths( cclient::data::security::AuthInfo *auth, const std::string &user) = 0; virtual void changeUserAuths( cclient::data::security::AuthInfo *auth, const std::string &user, cclient::data::security::Authorizations *auths) = 0; virtual void splitTablet( cclient::data::security::AuthInfo *auth, const std::shared_ptr<cclient::data::KeyExtent> extent, std::string split) = 0; virtual void registerService(std::string instance, std::string clusterManagers) = 0; virtual void close() = 0; virtual void initialize( std::shared_ptr<apache::thrift::protocol::TProtocol> protocolPtr, bool callRegistration = true) = 0; virtual std::map<std::string, std::string> getNamespaceConfiguration( cclient::data::security::AuthInfo *auth, const std::string &nameSpaceName) = 0; virtual void authenticate(cclient::data::security::AuthInfo *auth) = 0; /** * Permissions */ virtual bool hasPermission(cclient::data::security::AuthInfo *auth, const std::string &user, cclient::data::SystemPermissions perm) = 0; virtual bool hasPermission(cclient::data::security::AuthInfo *auth, const std::string &user, const std::string &table, cclient::data::TablePermissions perm) = 0; virtual bool hasPermission(cclient::data::security::AuthInfo *auth, const std::string &user, const std::string &nsp, cclient::data::NamespacePermissions perm) = 0; virtual bool grant(cclient::data::security::AuthInfo *auth, const std::string user, cclient::data::SystemPermissions perm) = 0; virtual bool grant(cclient::data::security::AuthInfo *auth, const std::string user, const std::string &table, cclient::data::TablePermissions perm) = 0; virtual bool grant(cclient::data::security::AuthInfo *auth, const std::string user, const std::string &nsp, cclient::data::NamespacePermissions perm) = 0; virtual bool revoke(cclient::data::security::AuthInfo *auth, const std::string user, cclient::data::SystemPermissions perm) = 0; virtual bool revoke(cclient::data::security::AuthInfo *auth, const std::string user, const std::string &table, cclient::data::TablePermissions perm) = 0; virtual bool revoke(cclient::data::security::AuthInfo *auth, const std::string user, const std::string &nsp, cclient::data::NamespacePermissions perm) = 0; }; } // namespace interconnect
/*******************************************ÉêÃ÷*************************************** ±¾Ç¶Èëʽ²Ù×÷ϵͳδ¾­ÊÚȨ£¬½ûÖ¹Ó¦ÓÃÓÚÈκÎÉÌÒµÓÃ; °æÈ¨ËùÓУ¬ÇÖȨ±Ø¾¿ http://www.trtos.com/ **************************************************************************************/ #include <Include.h> #if defined(USBHID_ENABLE) //#include <..\USB\USB_Include.h> //#include <..\USB\WHID\Usb_All.c> #include <..\USB\JoystickUsb\Usb_All.c> #endif
#pragma once #include "Painter.h" #include "Piece.h" #define FIELD_WIDTH 10 // blocks #define FIELD_HEIGHT 20 // blocks #define FIELD_X_PX 10 #define FIELD_Y_PX 10 #define FIELD_WIDTH_PX (BLOCK_SIZE_PX * FIELD_WIDTH) #define FIELD_HEIGHT_PX (BLOCK_SIZE_PX * FIELD_HEIGHT) #define BLANK -1 class Field { public: Field(Painter *painter); void draw(); void reset(); void drawPiece(Piece *piece, int posX, int posY); Uint8 checkCollisions(Piece *piece, int posX, int posY, Uint8 what); int clearRows(); void copyPieceToHeap(Piece *piece, int posX, int posY); bool checkNotBlank(int x, int y); enum { COLLIDED_LEFT = 1, COLLIDED_RIGHT = 2, COLLIDED_HEAP = 4, COLLIDED_TOP = 8 }; private: void drawHeap(); Painter *m_painter; int m_field[FIELD_WIDTH][FIELD_HEIGHT]; };
#ifndef INCLUDED_GET_CANDS #define INCLUDED_GET_CANDS typedef struct cross_rec Cross; typedef struct f0_params F0_params; void get_fast_cands(const float* const fdata, const float* const fdsdata, const int ind, const int step, const int size, const int dec, const int start, const int nlags, float* engref, int* maxloc, float* maxval, Cross* cp, float* peaks, int* locs, int* ncand, const F0_params* const par); const float* downsample(const float* input, int samsin, int state_idx, double freq, int* samsout, int decimate, int first_time, int last_time); #endif
#ifndef BABYLON_CULLING_OCTREES_IOCTREE_CONTAINER_H #define BABYLON_CULLING_OCTREES_IOCTREE_CONTAINER_H #include <vector> #include <babylon/babylon_api.h> namespace BABYLON { template <class T> class OctreeBlock; /** * @brief Contains an array of blocks representing the octree. */ template <class T> struct BABYLON_SHARED_EXPORT IOctreeContainer { /** * Blocks within the octree */ static std::vector<OctreeBlock<T>> blocks; }; // end of struct IOctreeContainer<T> template <class T> std::vector<OctreeBlock<T>> IOctreeContainer<T>::blocks; } // end of namespace BABYLON #endif // end of BABYLON_CULLING_OCTREES_IOCTREE_CONTAINER_H
/** @file * Copyright (c) 2018, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * * 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 <val_interface.h> #include <val_sdei_interface.h> #define TEST_DESC "Verify SDEI_FEATURES Call " #define VALID_FEATURE 0 #define INVALID_FEATURE 0x10 static void payload(void) { uint64_t num_slots, shared_slots, private_slots; int32_t err; /* Check SDEI_FEATURES valid call */ err = val_sdei_features(VALID_FEATURE, &num_slots); if (err) { val_print(ACS_LOG_ERR, "\n SDEI_FEATURES failed with err %d", err); val_test_pe_set_status(val_pe_get_index(), SDEI_TEST_FAIL); return; } else { private_slots = __EXTRACT_BITS(num_slots, 0, 16); shared_slots = __EXTRACT_BITS(num_slots, 16, 16); if (__EXTRACT_BITS(num_slots, 32, 32) || (private_slots < 2) || (shared_slots < 2)) { val_print(ACS_LOG_ERR, "\n SDEI_FEATURES expected value mismatch"); val_test_pe_set_status(val_pe_get_index(), SDEI_TEST_FAIL); return; } } /* Check Invalid Parameters call */ err = val_sdei_features(INVALID_FEATURE, &num_slots); if (err != SDEI_STATUS_INVALID) { val_print(ACS_LOG_ERR, "\n SDEI_FEATURES failed with err %d", err); val_test_pe_set_status(val_pe_get_index(), SDEI_TEST_FAIL); return; } val_test_pe_set_status(val_pe_get_index(), SDEI_TEST_PASS); } static void test_entry(void) { payload(); } SDEI_SET_TEST_DEPS(test_017_deps, TEST_NONE_ID); SDEI_PUBLISH_TEST(test_017, TEST_017_ID, TEST_DESC, test_017_deps, test_entry, FALSE);
// Copyright 2022 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generated by the Codegen C++ plugin. // If you make any local changes, they will be lost. // source: google/cloud/functions/v1/functions.proto #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CONNECTION_IDEMPOTENCY_POLICY_H #include "google/cloud/idempotency.h" #include "google/cloud/internal/retry_policy.h" #include "google/cloud/version.h" #include <google/cloud/functions/v1/functions.grpc.pb.h> #include <memory> namespace google { namespace cloud { namespace functions { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN class CloudFunctionsServiceConnectionIdempotencyPolicy { public: virtual ~CloudFunctionsServiceConnectionIdempotencyPolicy() = 0; /// Create a new copy of this object. virtual std::unique_ptr<CloudFunctionsServiceConnectionIdempotencyPolicy> clone() const = 0; virtual google::cloud::Idempotency ListFunctions( google::cloud::functions::v1::ListFunctionsRequest request) = 0; virtual google::cloud::Idempotency GetFunction( google::cloud::functions::v1::GetFunctionRequest const& request) = 0; virtual google::cloud::Idempotency CreateFunction( google::cloud::functions::v1::CreateFunctionRequest const& request) = 0; virtual google::cloud::Idempotency UpdateFunction( google::cloud::functions::v1::UpdateFunctionRequest const& request) = 0; virtual google::cloud::Idempotency DeleteFunction( google::cloud::functions::v1::DeleteFunctionRequest const& request) = 0; virtual google::cloud::Idempotency CallFunction( google::cloud::functions::v1::CallFunctionRequest const& request) = 0; virtual google::cloud::Idempotency GenerateUploadUrl( google::cloud::functions::v1::GenerateUploadUrlRequest const& request) = 0; virtual google::cloud::Idempotency GenerateDownloadUrl( google::cloud::functions::v1::GenerateDownloadUrlRequest const& request) = 0; virtual google::cloud::Idempotency SetIamPolicy( google::iam::v1::SetIamPolicyRequest const& request) = 0; virtual google::cloud::Idempotency GetIamPolicy( google::iam::v1::GetIamPolicyRequest const& request) = 0; virtual google::cloud::Idempotency TestIamPermissions( google::iam::v1::TestIamPermissionsRequest const& request) = 0; }; std::unique_ptr<CloudFunctionsServiceConnectionIdempotencyPolicy> MakeDefaultCloudFunctionsServiceConnectionIdempotencyPolicy(); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions } // namespace cloud } // namespace google #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CONNECTION_IDEMPOTENCY_POLICY_H
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2011 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ // A good bit of this code was derived from the Three20 project // and was customized to work inside spfc_me // // All modifications by spfc_me are licensed under // the Apache License, Version 2.0 // // // Copyright 2009 Facebook // // 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. // #ifdef USE_TI_UIDASHBOARDVIEW #import <UIKit/UIKit.h> @class LauncherButton; @class LauncherItem; @protocol LauncherViewDelegate; @interface LauncherView : UIView<UIScrollViewDelegate> { @private id<LauncherViewDelegate> delegate; UIScrollView *scrollView; UIPageControl *pager; NSMutableArray *pages; NSMutableArray *buttons; NSInteger columnCount; NSInteger rowCount; LauncherButton *dragButton; NSTimer* editHoldTimer; NSTimer* springLoadTimer; UITouch* dragTouch; NSInteger positionOrigin; CGPoint dragOrigin; CGPoint touchOrigin; BOOL editing; BOOL springing; BOOL editable; } @property(nonatomic) NSInteger columnCount; @property(nonatomic) NSInteger rowCount; @property(nonatomic) NSInteger currentPageIndex; @property(nonatomic,assign) id<LauncherViewDelegate> delegate; @property(nonatomic,readonly) BOOL editing; @property(nonatomic,assign) BOOL editable; - (void)addItem:(LauncherItem*)item animated:(BOOL)animated; - (void)removeItem:(LauncherItem*)item animated:(BOOL)animated; - (void)beginEditing; - (void)endEditing; - (LauncherItem*)itemForIndex:(NSInteger)index; - (NSArray*)items; @end @protocol LauncherViewDelegate <NSObject> @optional - (void)launcherView:(LauncherView*)launcher didAddItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didRemoveItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher willDragItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didDragItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didMoveItem:(LauncherItem*)item; - (void)launcherView:(LauncherView*)launcher didSelectItem:(LauncherItem*)item; - (void)launcherViewDidBeginEditing:(LauncherView*)launcher; - (void)launcherViewDidEndEditing:(LauncherView*)launcher; - (BOOL)launcherViewShouldWobble:(LauncherView*)launcher; @end #endif