text
stringlengths 4
6.14k
|
|---|
/*
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
For example,
If n = 4 and k = 2, a solution is:
[
[2,4],
[3,4],
[2,3],
[1,2],
[1,3],
[1,4],
]
Solution:
recursive impl of DFS.
*/
#include <vector>
using namespace std;
class Solution {
public:
vector<vector<int> > combine(int n, int k) {
vector<int> v;
vector<vector<int> > vv;
dfs(n, k, 1, v, vv);
return vv;
}
void dfs(int n, int k, int s, vector<int> &v, vector<vector<int> > &vv)
{
if(k == 0)
{
vv.push_back(v);
return;
}
for(int i = s; i <= n-k+1; ++i)
{
v.push_back(i);
dfs(n, k-1, i+1, v, vv);
v.pop_back();
}
}
};
|
#ifndef _AA0_H
#define _AA0_H
char const * aa0 (int x);
#endif
|
//
// Created by ShareSDK.cn on 13-1-14.
// 官网地址:http://www.ShareSDK.cn
// 技术支持邮箱:support@sharesdk.cn
// 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
// 商务QQ:4006852216
// Copyright (c) 2013年 ShareSDK.cn. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
* @brief 图片视图
*/
@interface CMImageView : UIControl
{
@private
UIImageView *_imageView;
UIImage *_image;
UIImage *_defaultImage;
BOOL _bNeedLayout;
}
/**
* @brief 图片对象
*/
@property (nonatomic,retain) UIImage *image;
/**
* @brief 默认图片对象,在没有设置图片时显示
*/
@property (nonatomic,retain) UIImage *defaultImage;
@end
|
// Generated by gencpp from file robot_arm_aansturing/positionResult.msg
// DO NOT EDIT!
#ifndef ROBOT_ARM_AANSTURING_MESSAGE_POSITIONRESULT_H
#define ROBOT_ARM_AANSTURING_MESSAGE_POSITIONRESULT_H
#include <string>
#include <vector>
#include <map>
#include <ros/types.h>
#include <ros/serialization.h>
#include <ros/builtin_message_traits.h>
#include <ros/message_operations.h>
namespace robot_arm_aansturing
{
template <class ContainerAllocator>
struct positionResult_
{
typedef positionResult_<ContainerAllocator> Type;
positionResult_()
: arrived(false) {
}
positionResult_(const ContainerAllocator& _alloc)
: arrived(false) {
(void)_alloc;
}
typedef uint8_t _arrived_type;
_arrived_type arrived;
typedef boost::shared_ptr< ::robot_arm_aansturing::positionResult_<ContainerAllocator> > Ptr;
typedef boost::shared_ptr< ::robot_arm_aansturing::positionResult_<ContainerAllocator> const> ConstPtr;
}; // struct positionResult_
typedef ::robot_arm_aansturing::positionResult_<std::allocator<void> > positionResult;
typedef boost::shared_ptr< ::robot_arm_aansturing::positionResult > positionResultPtr;
typedef boost::shared_ptr< ::robot_arm_aansturing::positionResult const> positionResultConstPtr;
// constants requiring out of line definition
template<typename ContainerAllocator>
std::ostream& operator<<(std::ostream& s, const ::robot_arm_aansturing::positionResult_<ContainerAllocator> & v)
{
ros::message_operations::Printer< ::robot_arm_aansturing::positionResult_<ContainerAllocator> >::stream(s, "", v);
return s;
}
} // namespace robot_arm_aansturing
namespace ros
{
namespace message_traits
{
// BOOLTRAITS {'IsFixedSize': True, 'IsMessage': True, 'HasHeader': False}
// {'actionlib_msgs': ['/opt/ros/kinetic/share/actionlib_msgs/cmake/../msg'], 'std_msgs': ['/opt/ros/kinetic/share/std_msgs/cmake/../msg'], 'robot_arm_aansturing': ['/home/nico/Documents/HAN/WoR World/Simulation/robot_simulation/application/devel/share/robot_arm_aansturing/msg']}
// !!!!!!!!!!! ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_parsed_fields', 'constants', 'fields', 'full_name', 'has_header', 'header_present', 'names', 'package', 'parsed_fields', 'short_name', 'text', 'types']
template <class ContainerAllocator>
struct IsFixedSize< ::robot_arm_aansturing::positionResult_<ContainerAllocator> >
: TrueType
{ };
template <class ContainerAllocator>
struct IsFixedSize< ::robot_arm_aansturing::positionResult_<ContainerAllocator> const>
: TrueType
{ };
template <class ContainerAllocator>
struct IsMessage< ::robot_arm_aansturing::positionResult_<ContainerAllocator> >
: TrueType
{ };
template <class ContainerAllocator>
struct IsMessage< ::robot_arm_aansturing::positionResult_<ContainerAllocator> const>
: TrueType
{ };
template <class ContainerAllocator>
struct HasHeader< ::robot_arm_aansturing::positionResult_<ContainerAllocator> >
: FalseType
{ };
template <class ContainerAllocator>
struct HasHeader< ::robot_arm_aansturing::positionResult_<ContainerAllocator> const>
: FalseType
{ };
template<class ContainerAllocator>
struct MD5Sum< ::robot_arm_aansturing::positionResult_<ContainerAllocator> >
{
static const char* value()
{
return "ea115e3ceb83b7b5fbcc7f283be1718c";
}
static const char* value(const ::robot_arm_aansturing::positionResult_<ContainerAllocator>&) { return value(); }
static const uint64_t static_value1 = 0xea115e3ceb83b7b5ULL;
static const uint64_t static_value2 = 0xfbcc7f283be1718cULL;
};
template<class ContainerAllocator>
struct DataType< ::robot_arm_aansturing::positionResult_<ContainerAllocator> >
{
static const char* value()
{
return "robot_arm_aansturing/positionResult";
}
static const char* value(const ::robot_arm_aansturing::positionResult_<ContainerAllocator>&) { return value(); }
};
template<class ContainerAllocator>
struct Definition< ::robot_arm_aansturing::positionResult_<ContainerAllocator> >
{
static const char* value()
{
return "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======\n\
#result definition\n\
bool arrived\n\
";
}
static const char* value(const ::robot_arm_aansturing::positionResult_<ContainerAllocator>&) { return value(); }
};
} // namespace message_traits
} // namespace ros
namespace ros
{
namespace serialization
{
template<class ContainerAllocator> struct Serializer< ::robot_arm_aansturing::positionResult_<ContainerAllocator> >
{
template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
{
stream.next(m.arrived);
}
ROS_DECLARE_ALLINONE_SERIALIZER
}; // struct positionResult_
} // namespace serialization
} // namespace ros
namespace ros
{
namespace message_operations
{
template<class ContainerAllocator>
struct Printer< ::robot_arm_aansturing::positionResult_<ContainerAllocator> >
{
template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::robot_arm_aansturing::positionResult_<ContainerAllocator>& v)
{
s << indent << "arrived: ";
Printer<uint8_t>::stream(s, indent + " ", v.arrived);
}
};
} // namespace message_operations
} // namespace ros
#endif // ROBOT_ARM_AANSTURING_MESSAGE_POSITIONRESULT_H
|
////////////////////////////////////////////////////////////////////////////////
/// @brief version request handler
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2014 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// 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.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Achim Brandt
/// @author Copyright 2014, ArangoDB GmbH, Cologne, Germany
/// @author Copyright 2010-2014, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
#ifndef ARANGODB_ADMIN_REST_VERSION_HANDLER_H
#define ARANGODB_ADMIN_REST_VERSION_HANDLER_H 1
#include "Basics/Common.h"
#include "Admin/RestBaseHandler.h"
#include "Rest/HttpResponse.h"
namespace triagens {
namespace admin {
// -----------------------------------------------------------------------------
// --SECTION-- class RestVersionHandler
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @brief version request handler
////////////////////////////////////////////////////////////////////////////////
class RestVersionHandler : public RestBaseHandler {
// -----------------------------------------------------------------------------
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
public:
////////////////////////////////////////////////////////////////////////////////
/// @brief constructor
////////////////////////////////////////////////////////////////////////////////
RestVersionHandler (rest::HttpRequest*);
// -----------------------------------------------------------------------------
// --SECTION-- Handler methods
// -----------------------------------------------------------------------------
public:
////////////////////////////////////////////////////////////////////////////////
/// {@inheritDoc}
////////////////////////////////////////////////////////////////////////////////
bool isDirect ();
////////////////////////////////////////////////////////////////////////////////
/// {@inheritDoc}
////////////////////////////////////////////////////////////////////////////////
std::string const& queue () const;
////////////////////////////////////////////////////////////////////////////////
/// @brief returns the server version number
////////////////////////////////////////////////////////////////////////////////
status_t execute ();
// -----------------------------------------------------------------------------
// --SECTION-- private variables
// -----------------------------------------------------------------------------
private:
////////////////////////////////////////////////////////////////////////////////
/// @brief name of the queue
////////////////////////////////////////////////////////////////////////////////
static const std::string QUEUE_NAME;
};
}
}
#endif
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// Local Variables:
// mode: outline-minor
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|// --SECTION--\\|/// @\\}"
// End:
|
/*======================================================
//º¯ÊýÃû£ºsdminv
//¹¦ÄÜÃèÊö£º¶Ô³ÆÕý¶¨¾ØÕóÔµØÇóÄæ
//ÊäÈë²ÎÊý£ºmat Ö¸Ïò´ý·Ö½âµÄ¾ØÕóµÄÖ¸Õë
n ¾ØÕó½×Êý
//·µ»ØÖµ£ºÕûÐÍ¡£ÔËÐгɹ¦Ôò·µ»Ø1,ʧ°ÜÔò·µ»Ø0
=========================================================*/
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
int sdminv(mat, n, eps)
double *mat;
int n;
double eps;
{
int i,j,k;
double p,q,*c;
if(mat == NULL) /* ¼ì²éÖ¸ÕëÊÇ·ñΪ¿Õ*/
{
printf("The matrix pointer is NULL\n");
return(0);
}
c = (double *)malloc(n*sizeof(double)); /* ΪÁÙʱ±äÁ¿·ÖÅä¿Õ¼ä²¢¼ì²éÊÇ·ñ³É¹¦*/
if(c == NULL)
{
printf("Memory alloc failed\n");
return(0);
}
for(k=0; k<n; k++) /* Ñ»·Çó½â*/
{
p = mat[0];
if(p < eps) /* ÅжÏÊÇ·ñÂú×ãÕý¶¨µÄÌõ¼þ*/
{
printf("Fail to invert\n");
free(c);
return(0);
}
p = 1.0/p; /* ½«Òª½øÐеĶà´Î³ý·¨×ª»¯Îª³Ë·¨*/
for(i=1; i<n-k; i++) /* Çó³ö¾ØÕóÏÂÈý½Ç²¿·Öǰn-kÐеÄÖµ*/
{
q = mat[i*n];
c[i] = -q*p;
for(j=1; j<i+1; j++)
mat[(i-1)*n+j-1] = mat[i*n+j] + q*c[j];
}
for(i=n-k; i<n; i++) /* Çó³ö¾ØÕóÏÂÈý½Ç²¿·ÖÖеÚn-kÐÐÖÁµÚn-1ÐеÄÖµ*/
{
q = mat[i*n];
c[i] = q*p;
for(j=1; j<i+1; j++)
mat[(i-1)*n+j-1] = mat[i*n+j] + q*c[j];
}
mat[n*n-1] = p; /* Çó³ö¾ØÕóÏÂÈý½Ç²¿·ÖÖеÚnÐеÄÖµ*/
for(i=1; i<n; i++)
mat[(n-1)*n+i-1] = c[i];
}
for(i=0; i<n-1; i++) /* ÒÀ¾Ý¶Ô³ÆÐÔ¶Ô¾ØÕóµÄÉÏÈý½Ç²¿·Ö½øÐи³Öµ*/
for(j=i+1; j<n; j++)
mat[i*n+j] = mat[j*n+i];
free(c); /* ÊÍ·Å·ÖÅäµÄ¿Õ¼ä*/
return(1);
}
|
/**
* Class describing a basic get ok frame
*
* @copyright 2014 Copernica BV
*/
/**
* Set up namespace
*/
namespace AMQP{
/**
* Class implementation
*/
class BasicGetOKFrame : public BasicFrame
{
private:
/**
* server-assigned and channel specific delivery tag
* @var uint64_t
*/
uint64_t _deliveryTag;
/**
* indicates whether the message has been previously delivered to this (or another) client
* @var BooleanSet
*/
BooleanSet _redelivered;
/**
* the name of the exchange to publish to. An empty exchange name means the default exchange.
* @var ShortString
*/
ShortString _exchange;
/**
* Message routing key
* @var ShortString
*/
ShortString _routingKey;
/**
* number of messages in the queue
* @var uint32_t
*/
uint32_t _messageCount;
protected:
/**
* Encode a frame on a string buffer
*
* @param buffer buffer to write frame to
*/
virtual void fill(OutBuffer& buffer) const override
{
// call base
BasicFrame::fill(buffer);
// encode rest of the fields
buffer.add(_deliveryTag);
_redelivered.fill(buffer);
_exchange.fill(buffer);
_routingKey.fill(buffer);
buffer.add(_messageCount);
}
public:
/**
* Construct a basic get ok frame
*
* @param channel channel we're working on
* @param deliveryTag server-assigned and channel specific delivery tag
* @param redelivered indicates whether the message has been previously delivered to this (or another) client
* @param exchange name of exchange to publish to
* @param routingKey message routing key
* @param messageCount number of messages in the queue
*/
BasicGetOKFrame(uint16_t channel, uint64_t deliveryTag, bool redelivered, const std::string& exchange, const std::string& routingKey, uint32_t messageCount) :
BasicFrame(channel, (uint32_t) (exchange.length() + routingKey.length() + 15)), // string length, +1 for each shortsrting length + 8 (uint64_t) + 4 (uint32_t) + 1 (bool)
_deliveryTag(deliveryTag),
_redelivered(redelivered),
_exchange(exchange),
_routingKey(routingKey),
_messageCount(messageCount)
{}
/**
* Construct a basic get ok frame from a received frame
*
* @param frame received frame
*/
BasicGetOKFrame(ReceivedFrame &frame) :
BasicFrame(frame),
_deliveryTag(frame.nextUint64()),
_redelivered(frame),
_exchange(frame),
_routingKey(frame),
_messageCount(frame.nextUint32())
{}
/**
* Destructor
*/
virtual ~BasicGetOKFrame() {}
/**
* Return the name of the exchange to publish to
* @return string
*/
const std::string& exchange() const
{
return _exchange;
}
/**
* Return the routing key
* @return string
*/
const std::string& routingKey() const
{
return _routingKey;
}
/**
* Return the method ID
* @return uint16_t
*/
virtual uint16_t methodID() const override
{
return 71;
}
/**
* Return the server-assigned and channel specific delivery tag
* @return uint64_t
*/
uint64_t deliveryTag() const
{
return _deliveryTag;
}
/**
* Return the number of messages in the queue
* @return uint32_t
*/
uint32_t messageCount() const
{
return _messageCount;
}
/**
* Return whether the message has been previously delivered to (another) client
* @return bool
*/
bool redelivered() const
{
return _redelivered.get(0);
}
/**
* Process the frame
* @param connection The connection over which it was received
* @return bool Was it succesfully processed?
*/
virtual bool process(ConnectionImpl *connection) override
{
// we need the appropriate channel
auto channel = connection->channel(this->channel());
// channel does not exist
if (!channel) return false;
// report success for the get operation
channel->reportSuccess(messageCount(), deliveryTag(), redelivered());
// check if we have a valid consumer
if (!channel->consumer()) return false;
// pass on to consumer
channel->consumer()->process(*this);
// done
return true;
}
};
/**
* end namespace
*/
}
|
// Copyright 2013 Velodyne Acoustics, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*=========================================================================
Program: Visualization Toolkit
Module: vtkVelodyneHDLReader.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkPlaneFitter - class for finding a plane fit to polydata
// .Section Description
//
#ifndef _vtkPlaneFitter_h
#define _vtkPlaneFitter_h
#include <vtkObject.h>
class vtkPointSet;
class VTK_EXPORT vtkPlaneFitter : public vtkObject
{
public:
static vtkPlaneFitter *New();
vtkTypeMacro(vtkPlaneFitter, vtkObject);
virtual void PrintSelf(ostream& os, vtkIndent indent);
static void PlaneFit(vtkPointSet* pts, double origin[3], double normal[3],
double &minDist, double &maxDist, double &stdDev,
double channelMean[32], double channelStdDev[32],
vtkIdType channelNpts[32]);
protected:
vtkPlaneFitter();
virtual ~vtkPlaneFitter();
private:
vtkPlaneFitter(const vtkPlaneFitter&);
void operator=(const vtkPlaneFitter&);
};
#endif
|
/*-------------------------------------------------------------------------
*
* translator.c
* Author: Ying Ni yni6@hawk.iit.edu
* One-line description
*
* Here starts the more detailed description where we
* explain in more detail how this works.
*
*-------------------------------------------------------------------------
*/
#include "common.h"
#include "instrumentation/timing_instrumentation.h"
#include "mem_manager/mem_mgr.h"
#include "log/logger.h"
#include "model/node/nodetype.h"
#include "model/list/list.h"
#include "model/expression/expression.h"
#include "model/query_block/query_block.h"
#include "model/query_operator/query_operator.h"
#include "model/query_operator/operator_property.h"
#include "analysis_and_translate/analyzer.h"
#include "analysis_and_translate/translator.h"
#include "analysis_and_translate/translator_oracle.h"
#include "analysis_and_translate/translator_dl.h"
#include "parser/parser.h"
// plugin
static TranslatorPlugin *plugin = NULL;
// function defs
//static Node *parseInternal (void);
static TranslatorPlugin *assembleOraclePlugin(void);
static TranslatorPlugin *assemblePostgresPlugin(void);
static TranslatorPlugin *assembleHivePlugin(void);
static TranslatorPlugin *assembleDLPlugin(void);
static TranslatorPlugin *assembleDummyPlugin(void);
static Node *echoNode (Node *in);
static QueryOperator *echoNodeAsQB (Node *in);
Node *
translateParse(Node *q)
{
Node *result;
ASSERT(plugin);
NEW_AND_ACQUIRE_MEMCONTEXT("TRANSLATOR_CONTEXT");
analyzeParseModel(q);
result = plugin->translateParse(q);
FREE_MEM_CONTEXT_AND_RETURN_COPY(Node,result);
}
QueryOperator *
translateQuery (Node *node)
{
ASSERT(plugin);
DEBUG_LOG("translate query <%s>", nodeToString(node));
return plugin->translateQuery(node);
}
// plugin management
void
chooseTranslatorPlugin(TranslatorPluginType type)
{
switch(type)
{
case TRANSLATOR_PLUGIN_ORACLE:
plugin = assembleOraclePlugin();
break;
case TRANSLATOR_PLUGIN_POSTGRES:
plugin = assemblePostgresPlugin();
break;
case TRANSLATOR_PLUGIN_HIVE:
plugin = assembleHivePlugin();
break;
case TRANSLATOR_PLUGIN_DL:
plugin = assembleDLPlugin();
break;
case TRANSLATOR_PLUGIN_DUMMY:
plugin = assembleDummyPlugin();
break;
}
}
static TranslatorPlugin *
assembleOraclePlugin(void)
{
TranslatorPlugin *p = NEW(TranslatorPlugin);
p->translateParse = translateParseOracle;
p->translateQuery = translateQueryOracle;
return p;
}
static TranslatorPlugin *
assemblePostgresPlugin(void)
{
TranslatorPlugin *p = NEW(TranslatorPlugin);
FATAL_LOG("not implemented yet");
return p;
}
static TranslatorPlugin *
assembleHivePlugin(void)
{
TranslatorPlugin *p = NEW(TranslatorPlugin);
FATAL_LOG("not implemented yet");
return p;
}
static TranslatorPlugin *
assembleDLPlugin(void)
{
TranslatorPlugin *p = NEW(TranslatorPlugin);
p->translateParse = translateParseDL;
p->translateQuery = translateQueryDL;
return p;
}
static TranslatorPlugin *
assembleDummyPlugin(void)
{
TranslatorPlugin *p = NEW(TranslatorPlugin);
p->translateParse = echoNode;
p->translateQuery = echoNodeAsQB;
return p;
}
static Node *
echoNode (Node *in)
{
return in;
}
static QueryOperator *
echoNodeAsQB (Node *in)
{
return NULL;
}
void
chooseTranslatorPluginFromString(char *type)
{
INFO_LOG("PLUGIN translator: <%s>", type);
if (streq(type,"oracle"))
chooseTranslatorPlugin(TRANSLATOR_PLUGIN_ORACLE);
else if (streq(type,"postgres"))
chooseTranslatorPlugin(TRANSLATOR_PLUGIN_POSTGRES);
else if (streq(type,"hive"))
chooseTranslatorPlugin(TRANSLATOR_PLUGIN_HIVE);
else if (streq(type,"dl"))
chooseTranslatorPlugin(TRANSLATOR_PLUGIN_DL);
else if (streq(type,"dummy"))
chooseTranslatorPlugin(TRANSLATOR_PLUGIN_DUMMY);
else
FATAL_LOG("unkown translator plugin type: <%s>", type);
}
|
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#ifdef WIN32
#ifdef _DEBUG
#include <crtdbg.h>
#define _CRTDBG_MAP_ALLOC
#endif
//#define _CRT_SECURE_NO_WARNINGS
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include "targetver.h"
// Windows Header Files:
#include <windows.h>
#include <winsock2.h>
#else
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#include <string>
#include <vector>
#include <map>
#include <queue>
using namespace std;
#include "../libs/libutils/Exception.h"
#include "../libs/libutils/logging.h"
#include "../libs/libutils/strutils.h"
|
//
// GADMAdapterNendNativeVideoAd.h
// NendAdapter
//
// Copyright © 2019 FAN Communications. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <GoogleMobileAds/GoogleMobileAds.h>
#import <NendAd/NendAd.h>
@interface GADMAdapterNendNativeVideoAd : NSObject <GADMediationNativeAd>
- (nonnull instancetype)
initWithVideo:(nonnull NADNativeVideo *)ad
delegate:(nonnull id<NADNativeVideoDelegate, NADNativeVideoViewDelegate>)delegate;
@end
|
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* POP3 example showing how to perform a noop
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>
/* This is a simple example showing how to perform a noop using libcurl's POP3
* capabilities.
*
* Note that this example requires libcurl 7.26.0 or above.
*/
int main(void)
{
CURL *curl;
CURLcode res = CURLE_OK;
curl = curl_easy_init();
if(curl) {
/* Set username and password */
curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
/* This is just the server URL */
curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com");
/* Set the NOOP command */
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "NOOP");
/* Do not perform a transfer as NOOP returns no data */
curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
/* Perform the custom request */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
/* Always cleanup */
curl_easy_cleanup(curl);
}
return (int)res;
}
|
////////////////////////////////////////////////////////////////////////////////
//
// TYPHOON REST CLIENT
// Copyright 2015, Typhoon Rest Client Contributors
// All Rights Reserved.
//
// NOTICE: The authors permit you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
#import <Foundation/Foundation.h>
#import "TRCRequest.h"
@interface RequestToGetIssue : NSObject <TRCRequest>
- (instancetype)initWithIssueId:(NSNumber *)issueId;
@end
|
#pragma once
#include <iostream>
#include "layer.h"
class DummyLayer : public Layer {
// dummy layer that adds delta to matrix when ff, and substracts when bp
public:
DummyLayer(FloatT delta_) : delta(delta_) {}
virtual void forward_cpu(
const std::vector<Blob> & inputs,
const std::vector<Blob> & outputs) {
std::cout << "ff cpu" << std::endl;
}
virtual void forward_gpu(
const std::vector<Blob> & inputs,
const std::vector<Blob> & outputs) {
std::cout << "ff gpu" << std::endl;
}
virtual void backward_cpu(
const std::vector<Blob> & inputs,
const std::vector<Blob> & outputs,
const std::vector<bool> & propagate_down = {}) {
std::cout << "bp cpu" << std::endl;
}
virtual void backward_gpu(
const std::vector<Blob> & inputs,
const std::vector<Blob> & outputs,
const std::vector<bool> & propagate_down = {}) {
std::cout << "bp gpu" << std::endl;
}
private:
FloatT delta;
};
|
/**
* © Copyright 2013 Carl N. Baldwin
*
* 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 _LCS_MERGE_H
#define _LCS_MERGE_H
#include <stddef.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Merges changes made between base and theirs in to ours. It is assumed that
* base was the common starting point for ours and theirs.
*
* While most merge tools work at the line level this function works at the
* byte level. It is capable of merging where both files have changes to the
* same line.
*
* Conflict markers are similar to diff3. However, the conflict markers do not
* appear on a line by themselves. Since this is a byte-level merge the
* conflict markers appear inline.
*
* The following sequences are not null terminated. The length of each
* sequence must be passed using the _len arguments.
*
* base - Pointer to the sequence that serves as the common base.
* ours - Pointer to our sequence.
* theirs - Pointer to their sequence.
*
* The following arguments are callback funtions called to handled merged or
* conflicted sections.
*
* merged - Receives a single merged sequence. Can be copied to output.
* conflicted - Receives three sequences: base, ours, theirs in that order.
* A section that could not be resolved.
*
* handlerData - A void pointer that will be passed to each of the callbacks.
*
* Returns true if conflicts occurred.
*/
bool
textile_merge(
const char *base, size_t base_len,
const char *ours, size_t ours_len,
const char *theirs, size_t theirs_len,
void (*merged)(void *, const char *, size_t),
void (*conflicted)(void *,
const char *, size_t,
const char *, size_t,
const char *, size_t),
void *handlerData);
#ifdef __cplusplus
}
#endif
#endif
|
#import <Foundation/Foundation.h>
#import "PBObject.h"
/**
* Location Intelligence APIs
* Incorporate our extensive geodata into everyday applications, business processes and workflows.
*
* OpenAPI spec version: 8.5.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* 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.
*/
@protocol PBField
@end
@interface PBField : PBObject
@property(nonatomic) NSString* value;
@property(nonatomic) NSString* _description;
@end
|
// NOTE: This file was generated by the ServiceGenerator.
// ----------------------------------------------------------------------------
// API:
// Fact Check Tools API (factchecktools/v1alpha1)
// Documentation:
// https://developers.google.com/fact-check/tools/api/
#if SWIFT_PACKAGE || GTLR_USE_MODULAR_IMPORT
@import GoogleAPIClientForRESTCore;
#elif GTLR_BUILT_AS_FRAMEWORK
#import "GTLR/GTLRService.h"
#else
#import "GTLRService.h"
#endif
#if GTLR_RUNTIME_VERSION != 3000
#error This file was generated by a different version of ServiceGenerator which is incompatible with this GTLR library source.
#endif
// Generated comments include content from the discovery document; avoid them
// causing warnings since clang's checks are some what arbitrary.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
NS_ASSUME_NONNULL_BEGIN
// ----------------------------------------------------------------------------
// Authorization scope
/**
* Authorization scope: See your primary Google Account email address
*
* Value "https://www.googleapis.com/auth/userinfo.email"
*/
FOUNDATION_EXTERN NSString * const kGTLRAuthScopeFactCheckToolsUserinfoEmail;
// ----------------------------------------------------------------------------
// GTLRFactCheckToolsService
//
/**
* Service for executing Fact Check Tools API queries.
*/
@interface GTLRFactCheckToolsService : GTLRService
// No new methods
// Clients should create a standard query with any of the class methods in
// GTLRFactCheckToolsQuery.h. The query can the be sent with GTLRService's
// execute methods,
//
// - (GTLRServiceTicket *)executeQuery:(GTLRQuery *)query
// completionHandler:(void (^)(GTLRServiceTicket *ticket,
// id object, NSError *error))handler;
// or
// - (GTLRServiceTicket *)executeQuery:(GTLRQuery *)query
// delegate:(id)delegate
// didFinishSelector:(SEL)finishedSelector;
//
// where finishedSelector has a signature of:
//
// - (void)serviceTicket:(GTLRServiceTicket *)ticket
// finishedWithObject:(id)object
// error:(NSError *)error;
//
// The object passed to the completion handler or delegate method
// is a subclass of GTLRObject, determined by the query method executed.
@end
NS_ASSUME_NONNULL_END
#pragma clang diagnostic pop
|
/* BEGIN HEADER */
#ifndef t11_INCLUDE_
#define t11_INCLUDE_
#include <assert.h>
#include <unordered_map>
#include <utility>
#include "classp.h"
// Include files generated by bison
#include "t11.yacc.hh"
#include "location.hh"
#include "position.hh"
namespace t11 {
using std::istream;
using std::ostream;
using classp::classpPrint;
using classp::classpFormat;
using classp::AttributeMap;
// Location and state information from the parser.
typedef location ParseState;
extern ParseState defaultParseState;
class AstNode;
/* BEGIN FORWARD DECLARATIONS */
class A;
/* END FORWARD DECLARATIONS */
// Base class for t11 AST nodes
class AstNode : public classp::ClasspNode {
public:
string className() override { return "AstNode"; }
AstNode(ParseState parseState)
: parseState(parseState) {
}
// Write out a bracketed form of this AST from the declared syntax.
virtual void bracketFormat(std::ostream& out, AstNode* self) {
assert(false);
}
ParseState parseState;
};
/* BEGIN CLASS DEFINITIONS */
class A: public AstNode {
public:
string className() override { return "A"; }
A(ParseState parseState, AttributeMap& keyword_args);
static A* parse(istream& input, ostream& errors);
void printMembers(ostream& out) override;
void format(ostream& out, int precedence) override;
bool b;
};
/* END CLASS DEFINITIONS */
} // namespace t11
#endif // t11_INCLUDE_
/* END HEADER */
|
//
// IDevice.h
//
// Library: IoT/Devices
// Package: Generated
// Module: IDevice
//
// This file has been generated.
// Warning: All changes to this will be lost when the file is re-generated.
//
// Copyright (c) 2014-2015, Applied Informatics Software Engineering GmbH.
// All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
//
#ifndef IoT_Devices_IDevice_INCLUDED
#define IoT_Devices_IDevice_INCLUDED
#include "IoT/Devices/Device.h"
#include "Poco/AutoPtr.h"
#include "Poco/OSP/Service.h"
#include "Poco/RemotingNG/Identifiable.h"
namespace IoT {
namespace Devices {
class IDevice: public Poco::OSP::Service
/// The base class for all devices and sensors.
///
/// This class defines a generic interface for setting
/// and querying device properties and features.
///
/// Every implementation of Device should expose the
/// following properties:
/// - symbolicName (string): A name in reverse DNS notation
/// that identifies the device type (e.g., "io.macchina.serialport").
/// - name (string): A human-readable device type (e.g., "Serial Port").
{
public:
typedef Poco::AutoPtr<IDevice> Ptr;
IDevice();
/// Creates a IDevice.
virtual ~IDevice();
/// Destroys the IDevice.
virtual bool getFeature(const std::string& name) const = 0;
/// Returns true if the feature with the given name
/// is enabled, or false otherwise.
virtual bool getPropertyBool(const std::string& name) const = 0;
/// Returns the value of the device property with
/// the given name.
///
/// Throws a Poco::NotFoundException if the property
/// with the given name is unknown.
virtual double getPropertyDouble(const std::string& name) const = 0;
/// Returns the value of the device property with
/// the given name.
///
/// Throws a Poco::NotFoundException if the property
/// with the given name is unknown.
virtual int getPropertyInt(const std::string& name) const = 0;
/// Returns the value of the device property with
/// the given name.
///
/// Throws a Poco::NotFoundException if the property
/// with the given name is unknown.
virtual std::string getPropertyString(const std::string& name) const = 0;
/// Returns the value of the device property with
/// the given name.
///
/// Throws a Poco::NotFoundException if the property
/// with the given name is unknown.
virtual bool hasFeature(const std::string& name) const = 0;
/// Returns true if the feature with the given name
/// is known, or false otherwise.
virtual bool hasProperty(const std::string& name) const = 0;
/// Returns true if the property with the given name
/// exists, or false otherwise.
bool isA(const std::type_info& otherType) const;
/// Returns true if the class is a subclass of the class given by otherType.
static const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId();
/// Returns the TypeId of the class.
virtual bool sentPaMessage(const std::string& name) const = 0;
/// Returns true if the feature with the given name
/// is known, or false otherwise.
virtual void setFeature(const std::string& name, bool enable) = 0;
/// Enables or disables the feature with the given name.
///
/// Which features are supported is defined by the
/// actual device implementation.
virtual void setPropertyBool(const std::string& name, bool value) = 0;
/// Sets a device property.
///
/// Which properties are supported is defined by the
/// actual device implementation.
virtual void setPropertyDouble(const std::string& name, double value) = 0;
/// Sets a device property.
///
/// Which properties are supported is defined by the
/// actual device implementation.
virtual void setPropertyInt(const std::string& name, int value) = 0;
/// Sets a device property.
///
/// Which properties are supported is defined by the
/// actual device implementation.
virtual void setPropertyString(const std::string& name, const std::string& value) = 0;
/// Sets a device property.
///
/// Which properties are supported is defined by the
/// actual device implementation.
const std::type_info& type() const;
/// Returns the type information for the object's class.
};
} // namespace Devices
} // namespace IoT
#endif // IoT_Devices_IDevice_INCLUDED
|
/*******************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/
//
// Created by raver119 on 20/04/18.
//
#ifndef LIBND4J_DEBUGHELPER_H
#define LIBND4J_DEBUGHELPER_H
#include <system/pointercast.h>
#include <system/op_boilerplate.h>
#include <system/Environment.h>
#include <helpers/StringUtils.h>
#include <string>
#ifdef __CUDACC__
#include <cuda.h>
#include <driver_types.h>
#include <cuda_runtime_api.h>
#endif
#include <helpers/DebugInfo.h>
namespace sd {
class NDArray;
class ND4J_EXPORT DebugHelper {
public:
// cuda-specific debug functions
#ifdef __CUDACC__
static FORCEINLINE void checkErrorCode(cudaStream_t *stream, int opNum = 0) {
if (Environment::getInstance()->isDebug()) {
cudaError_t res = cudaStreamSynchronize(*stream);
if (res != 0) {
//PRINT_FIRST("Kernel OpNum failed: [%i]\n", opNum);
std::string op = "Kernel OpNum failed: [";
op += StringUtils::valueToString<int>(opNum);
op += "]";
throw std::runtime_error(op);
}
}
}
static FORCEINLINE void checkErrorCode(cudaStream_t *stream, const char *failMessage = nullptr) {
cudaError_t res = cudaStreamSynchronize(*stream);
if (res != 0) {
if (failMessage == nullptr) {
std::string op = "CUDA call ended with error code [" + StringUtils::valueToString<int>(res) + std::string("]");
throw std::runtime_error(op);
} else {
std::string op = std::string(failMessage) + std::string("Error code [") + StringUtils::valueToString<int>(res) + std::string("]");
throw std::runtime_error(op);
}
}
}
#endif
static DebugInfo debugStatistics(NDArray const* input);
static void retrieveDebugStatistics(DebugInfo* statistics, NDArray const* input);
};
}
#endif //LIBND4J_DEBUGHELPER_H
|
/*******************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/
//
// @author raver119@gmail.com
//
#ifndef LIBND4J_INT8_H
#define LIBND4J_INT8_H
#include <stdint.h>
#include <system/op_boilerplate.h>
namespace sd {
float _CUDA_HD FORCEINLINE cpu_int82float(int8_t data);
int8_t _CUDA_HD FORCEINLINE cpu_float2int8(float data);
struct int8 {
int8_t data;
_CUDA_HD FORCEINLINE int8();
_CUDA_HD FORCEINLINE ~int8() = default;
template <class T>
_CUDA_HD FORCEINLINE int8(const T& rhs);
template <class T>
_CUDA_HD FORCEINLINE int8& operator=(const T& rhs);
_CUDA_HD FORCEINLINE operator float() const;
_CUDA_HD FORCEINLINE void assign(double rhs);
_CUDA_HD FORCEINLINE void assign(float rhs);
};
float cpu_int82float(int8_t data) {
return (float) ((int) data);
}
int8_t cpu_float2int8(float data) {
int t = (int) data;
if (t > 127) t = 127;
if (t < -128) t = -128;
return (int8_t) t;
}
int8::int8() {
data = cpu_float2int8(0.0f);
}
template <class T>
int8::int8(const T& rhs) {
assign(rhs);
}
template <class T>
int8& int8::operator=(const T& rhs) {
assign(rhs); return *this;
}
int8::operator float() const {
return cpu_int82float(data);
}
void int8::assign(double rhs) {
assign((float)rhs);
}
void int8::assign(float rhs) {
data = cpu_float2int8(rhs);
}
}
#endif //LIBND4J_INT8_H
|
/*
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
C * *
C * copyright (c) 2011 by UCAR *
C * *
C * University Corporation for Atmospheric Research *
C * *
C * all rights reserved *
C * *
C * FFTPACK version 5.1 *
C * *
C * A Fortran Package of Fast Fourier *
C * *
C * Subroutines and Example Programs *
C * *
C * by *
C * *
C * Paul Swarztrauber and Dick Valent *
C * *
C * of *
C * *
C * the National Center for Atmospheric Research *
C * *
C * Boulder, Colorado (80307) U.S.A. *
C * *
C * which is sponsored by *
C * *
C * the National Science Foundation *
C * *
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
/**
@file fftpack.h
@brief Fortran API for FFTPACK 5.1
@author Paul N. Swarztrauber and Richard A. Valent
FFTPACK 5.1, traditional Fortran API converted by f2c.
Authors: Paul N. Swarztrauber and Richard A. Valent
Converted to C and cleaned up a little: Roy Zywina
This code is in the public domain.
*/
#ifndef _FFTPACKD_H_
#define _FFTPACKD_H_
#include <math.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C"{
#endif
/*
This type is binary compatable with C's "double _Complex" or
C++'s "std::complex<double>" or an array of length 2*N of
double. (or float if you redefine double)
*/
typedef struct{
double r;
double i;
}fft_complexd_t;
/* Fortran API */
/// FFT
int cfft1b_d(int *n, int *inc, fft_complexd_t *c__, int *
lenc, double *wsave, int *lensav, double *work, int *lenwrk,
int *ier);
/// IFFT
int cfft1f_d(int *n, int *inc, fft_complexd_t *c__, int *
lenc, double *wsave, int *lensav, double *work, int *lenwrk,
int *ier);
/// initialize constants array for #cfft1b_ and #cfft1f_d
int cfft1i_d(int *n, double *wsave, int *lensav,int *ier);
/// 2D FFT
int cfft2b_d(int *ldim, int *l, int *m, fft_complexd_t *
c__, double *wsave, int *lensav, double *work, int *lenwrk,
int *ier);
/// 2D IFFT
int cfft2f_d(int *ldim, int *l, int *m, fft_complexd_t *
c__, double *wsave, int *lensav, double *work, int *lenwrk,
int *ier);
/// initialize constants array for #cfft2b_d and #cfft2f_d
int cfft2i_d(int *l, int *m, double *wsave, int *
lensav, int *ier);
/// initialize DCT-I constants
int cost1i_d(int *n, double *wsave, int *lensav,
int *ier);
/// DCT-I
int cost1b_d(int *n, int *inc, double *x, int *lenx,
double *wsave, int *lensav, double *work, int *lenwrk, int *ier);
/// DCT-I with scaling applied to properly invert
int cost1f_d(int *n, int *inc, double *x, int *lenx,
double *wsave, int *lensav, double *work, int *lenwrk, int *ier);
/// initialize constants for DCT
int cosq1i_d(int *n, double *wsave, int *lensav,
int *ier);
/// DCT (DCT-III)
int cosq1f_d(int *n, int *inc, double *x, int *lenx,
double *wsave, int *lensav, double *work, int *lenwrk, int *ier);
/// IDCT (DCT-II)
int cosq1b_d(int *n, int *inc, double *x, int *lenx,
double *wsave, int *lensav, double *work, int *lenwrk, int *ier);
// DST 2 and 3 (aka DST and IDST)
/// DST (DST-III)
int sinq1b_d(int *n, int *inc, double *x, int *lenx,
double *wsave, int *lensav, double *work, int *lenwrk, int *ier);
/// IDST (DST-II)
int sinq1f_d(int *n, int *inc, double *x, int *lenx,
double *wsave, int *lensav, double *work, int *lenwrk, int *ier);
/// initialize constants for #sinq1b_d and #sinq1f
int sinq1i_d(int *n, double *wsave, int *lensav, int *ier);
/// DST (DST-I)
int sint1b_d(int *n, int *inc, double *x, int *lenx,
double *wsave, int *lensav, double *work, int *lenwrk, int *ier);
/// IDST (DST-I)
int sint1f_d(int *n, int *inc, double *x, int *lenx,
double *wsave, int *lensav, double *work, int *lenwrk, int *ier);
/// initialize constants for #sint1b_d and #sint1f
int sint1i_d(int *n, double *wsave, int *lensav, int *ier);
/// RFFT init
int rfft1i_d(int *n, double *wsave, int *lensav, int *ier);
/// RFFT
int rfft1f_d(int *n, int *inc, double *r__, int *
lenr, double *wsave, int *lensav, double *work, int *lenwrk,
int *ier);
/// IRFFT
int rfft1b_d(int *n, int *inc, double *r__, int *
lenr, double *wsave, int *lensav, double *work, int *lenwrk,
int *ier);
/// multi DCT init
int cosqmi_d(int *n, double *wsave, int *lensav,int *ier);
/// multi DCT-III
int cosqmf_d(int *lot, int *jump, int *n, int
*inc, double *x, int *lenx, double *wsave, int *lensav, double *
work, int *lenwrk, int *ier);
/// multi DCT-II
int cosqmb_d(int *lot, int *jump, int *n, int
*inc, double *x, int *lenx, double *wsave, int *lensav, double *
work, int *lenwrk, int *ier);
#ifdef __cplusplus
}; // extern"C"
#endif
#endif
|
/*
* Generated by asn1c-0.9.22.1409 (http://lionet.info/asn1c)
* From ASN.1 module "SPNEGO"
* found in "spnego.asn1"
* `asn1c -fnative-types -fskeletons-copy -fcompound-names`
*/
#include "asn_internal.h"
#include "MechTypeList.h"
static asn_TYPE_member_t asn_MBR_MechTypeList_1[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
0,
&asn_DEF_MechType,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
""
},
};
static ber_tlv_tag_t asn_DEF_MechTypeList_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_MechTypeList_specs_1 = {
sizeof(struct MechTypeList),
offsetof(struct MechTypeList, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
asn_TYPE_descriptor_t asn_DEF_MechTypeList = {
"MechTypeList",
"MechTypeList",
SEQUENCE_OF_free,
SEQUENCE_OF_print,
SEQUENCE_OF_constraint,
SEQUENCE_OF_decode_ber,
SEQUENCE_OF_encode_der,
SEQUENCE_OF_decode_xer,
SEQUENCE_OF_encode_xer,
0, 0, /* No PER support, use "-gen-PER" to enable */
0, /* Use generic outmost tag fetcher */
asn_DEF_MechTypeList_tags_1,
sizeof(asn_DEF_MechTypeList_tags_1)
/sizeof(asn_DEF_MechTypeList_tags_1[0]), /* 1 */
asn_DEF_MechTypeList_tags_1, /* Same as above */
sizeof(asn_DEF_MechTypeList_tags_1)
/sizeof(asn_DEF_MechTypeList_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
asn_MBR_MechTypeList_1,
1, /* Single element */
&asn_SPC_MechTypeList_specs_1 /* Additional specs */
};
|
//
// YGListDetailController.h
// WangYe
//
// Created by 阳光 on 2017/2/13.
// Copyright © 2017年 YG. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface YGListDetailController : UITableViewController
/** 名称 */
@property(nonatomic, strong) NSString *listName;
- (instancetype)initWithListName:(NSString *)listName;
@end
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/rekognition/Rekognition_EXPORTS.h>
#include <aws/rekognition/model/Face.h>
#include <aws/rekognition/model/FaceDetail.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace Rekognition
{
namespace Model
{
/**
* <p>Object containing both the face metadata (stored in the backend database),
* and facial attributes that are detected but aren't stored in the
* database.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/rekognition-2016-06-27/FaceRecord">AWS
* API Reference</a></p>
*/
class AWS_REKOGNITION_API FaceRecord
{
public:
FaceRecord();
FaceRecord(Aws::Utils::Json::JsonView jsonValue);
FaceRecord& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>Describes the face properties such as the bounding box, face ID, image ID of
* the input image, and external image ID that you assigned. </p>
*/
inline const Face& GetFace() const{ return m_face; }
/**
* <p>Describes the face properties such as the bounding box, face ID, image ID of
* the input image, and external image ID that you assigned. </p>
*/
inline void SetFace(const Face& value) { m_faceHasBeenSet = true; m_face = value; }
/**
* <p>Describes the face properties such as the bounding box, face ID, image ID of
* the input image, and external image ID that you assigned. </p>
*/
inline void SetFace(Face&& value) { m_faceHasBeenSet = true; m_face = std::move(value); }
/**
* <p>Describes the face properties such as the bounding box, face ID, image ID of
* the input image, and external image ID that you assigned. </p>
*/
inline FaceRecord& WithFace(const Face& value) { SetFace(value); return *this;}
/**
* <p>Describes the face properties such as the bounding box, face ID, image ID of
* the input image, and external image ID that you assigned. </p>
*/
inline FaceRecord& WithFace(Face&& value) { SetFace(std::move(value)); return *this;}
/**
* <p>Structure containing attributes of the face that the algorithm detected.</p>
*/
inline const FaceDetail& GetFaceDetail() const{ return m_faceDetail; }
/**
* <p>Structure containing attributes of the face that the algorithm detected.</p>
*/
inline void SetFaceDetail(const FaceDetail& value) { m_faceDetailHasBeenSet = true; m_faceDetail = value; }
/**
* <p>Structure containing attributes of the face that the algorithm detected.</p>
*/
inline void SetFaceDetail(FaceDetail&& value) { m_faceDetailHasBeenSet = true; m_faceDetail = std::move(value); }
/**
* <p>Structure containing attributes of the face that the algorithm detected.</p>
*/
inline FaceRecord& WithFaceDetail(const FaceDetail& value) { SetFaceDetail(value); return *this;}
/**
* <p>Structure containing attributes of the face that the algorithm detected.</p>
*/
inline FaceRecord& WithFaceDetail(FaceDetail&& value) { SetFaceDetail(std::move(value)); return *this;}
private:
Face m_face;
bool m_faceHasBeenSet;
FaceDetail m_faceDetail;
bool m_faceDetailHasBeenSet;
};
} // namespace Model
} // namespace Rekognition
} // namespace Aws
|
//
// BGAPublishPhotosView.h
// WeiBo
//
// Created by bingoogol on 15/7/15.
// Copyright (c) 2015年 bingoogolapple. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BGAPublishPhotosView : UIView
@property (nonatomic, strong, readonly) NSMutableArray *photos;
- (void)addPhoto:(UIImage *)photo;
// 默认会自动生成setter和getter的声明和实现、_开头的成员变量
// 如果手动实现了setter和getter,那么就不会再生成settter、getter的实现、_开头的成员变量
//@property (nonatomic, strong, readonly) NSMutableArray *addedPhotos;
// 默认会自动生成getter的声明和实现、_开头的成员变量
// 如果手动实现了getter,那么就不会再生成getter的实现、_开头的成员变量
@end
|
/******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_CANBUS_VEHICLE_GEM_PROTOCOL_PARKING_BRAKE_STATUS_RPT_80_H_
#define MODULES_CANBUS_VEHICLE_GEM_PROTOCOL_PARKING_BRAKE_STATUS_RPT_80_H_
#include "modules/canbus/proto/chassis_detail.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace canbus {
namespace gem {
class Parkingbrakestatusrpt80 : public ::apollo::drivers::canbus::ProtocolData<
::apollo::canbus::ChassisDetail> {
public:
static const int32_t ID;
Parkingbrakestatusrpt80();
void Parse(const std::uint8_t* bytes, int32_t length,
ChassisDetail* chassis) const override;
private:
// config detail: {'name': 'PARKING_BRAKE_ENABLED', 'enum': {0:
// 'PARKING_BRAKE_ENABLED_OFF', 1: 'PARKING_BRAKE_ENABLED_ON'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Parking_brake_status_rpt_80::Parking_brake_enabledType parking_brake_enabled(
const std::uint8_t* bytes, const int32_t length) const;
};
} // namespace gem
} // namespace canbus
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_GEM_PROTOCOL_PARKING_BRAKE_STATUS_RPT_80_H_
|
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/codedeploy/CodeDeploy_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace CodeDeploy
{
namespace Model
{
enum class ErrorCode
{
NOT_SET,
DEPLOYMENT_GROUP_MISSING,
APPLICATION_MISSING,
REVISION_MISSING,
IAM_ROLE_MISSING,
IAM_ROLE_PERMISSIONS,
NO_EC2_SUBSCRIPTION,
OVER_MAX_INSTANCES,
NO_INSTANCES,
TIMEOUT,
HEALTH_CONSTRAINTS_INVALID,
HEALTH_CONSTRAINTS,
INTERNAL_ERROR,
THROTTLED,
ALARM_ACTIVE,
AGENT_ISSUE,
AUTO_SCALING_IAM_ROLE_PERMISSIONS,
AUTO_SCALING_CONFIGURATION,
MANUAL_STOP
};
namespace ErrorCodeMapper
{
AWS_CODEDEPLOY_API ErrorCode GetErrorCodeForName(const Aws::String& name);
AWS_CODEDEPLOY_API Aws::String GetNameForErrorCode(ErrorCode value);
} // namespace ErrorCodeMapper
} // namespace Model
} // namespace CodeDeploy
} // namespace Aws
|
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_ice_jni_registry_RegistryKey */
#ifndef _Included_com_ice_jni_registry_RegistryKey
#define _Included_com_ice_jni_registry_RegistryKey
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: openSubKey
* Signature: (Ljava/lang/String;I)Lcom/ice/jni/registry/RegistryKey;
*/
JNIEXPORT jobject JNICALL Java_com_ice_jni_registry_RegistryKey_openSubKey
(JNIEnv *, jobject, jstring, jint);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: connectRegistry
* Signature: (Ljava/lang/String;Ljava/lang/String;)Lcom/ice/jni/registry/RegistryKey;
*/
JNIEXPORT jobject JNICALL Java_com_ice_jni_registry_RegistryKey_connectRegistry
(JNIEnv *, jclass, jstring);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: createSubKey
* Signature: (Ljava/lang/String;Ljava/lang/String;I)Lcom/ice/jni/registry/RegistryKey;
*/
JNIEXPORT jobject JNICALL Java_com_ice_jni_registry_RegistryKey_createSubKey
(JNIEnv *, jobject, jstring, jstring, jint);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: closeKey
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_ice_jni_registry_RegistryKey_closeKey
(JNIEnv *, jobject);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: deleteSubKey
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_ice_jni_registry_RegistryKey_deleteSubKey
(JNIEnv *, jobject, jstring);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: deleteValue
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_ice_jni_registry_RegistryKey_deleteValue
(JNIEnv *, jobject, jstring);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: flushKey
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_ice_jni_registry_RegistryKey_flushKey
(JNIEnv *, jobject);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: getValue
* Signature: (Ljava/lang/String;)Lcom/ice/jni/registry/RegistryValue;
*/
JNIEXPORT jobject JNICALL Java_com_ice_jni_registry_RegistryKey_getValue
(JNIEnv *, jobject, jstring);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: setValue
* Signature: (Ljava/lang/String;Lcom/ice/jni/registry/RegistryValue;)Z
*/
JNIEXPORT void JNICALL Java_com_ice_jni_registry_RegistryKey_setValue
(JNIEnv *, jobject, jstring, jobject);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: getStringValue
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_ice_jni_registry_RegistryKey_getStringValue
(JNIEnv *, jobject, jstring);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: getDefaultValue
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_ice_jni_registry_RegistryKey_getDefaultValue
(JNIEnv *, jobject);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: hasDefaultValue
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_com_ice_jni_registry_RegistryKey_hasDefaultValue
(JNIEnv *, jobject);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: hasOnlyDefaultValue
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_com_ice_jni_registry_RegistryKey_hasOnlyDefaultValue
(JNIEnv *, jobject);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: getNumberSubkeys
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_ice_jni_registry_RegistryKey_getNumberSubkeys
(JNIEnv *, jobject);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: getMaxSubkeyLength
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_ice_jni_registry_RegistryKey_getMaxSubkeyLength
(JNIEnv *, jobject);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: regEnumKey
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_ice_jni_registry_RegistryKey_regEnumKey
(JNIEnv *, jobject, jint);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: getNumberValues
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_ice_jni_registry_RegistryKey_getNumberValues
(JNIEnv *, jobject);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: getMaxValueDataLength
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_ice_jni_registry_RegistryKey_getMaxValueDataLength
(JNIEnv *, jobject);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: getMaxValueNameLength
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_ice_jni_registry_RegistryKey_getMaxValueNameLength
(JNIEnv *, jobject);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: regEnumValue
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_ice_jni_registry_RegistryKey_regEnumValue
(JNIEnv *, jobject, jint);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: incrDoubleWord
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_com_ice_jni_registry_RegistryKey_incrDoubleWord
(JNIEnv *, jobject, jstring);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: decrDoubleWord
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_com_ice_jni_registry_RegistryKey_decrDoubleWord
(JNIEnv *, jobject, jstring);
/*
* Class: com_ice_jni_registry_RegistryKey
* Method: expandEnvStrings
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_ice_jni_registry_RegistryKey_expandEnvStrings
(JNIEnv *, jobject, jstring);
#ifdef __cplusplus
}
#endif
#endif
|
//
// LQModelShare.h
// MiaoSha
//
// Created by liqiang on 16/7/20.
// Copyright © 2016年 LiQiang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface LQModelShare : NSObject
@property (nonatomic, copy) NSString *sid;
@property (nonatomic, copy) NSString *remarks;
@property (nonatomic, copy) NSString *createDate;
@property (nonatomic, copy) NSString *updateDate;
@property (nonatomic, strong) LQModelUser *user;
@property (nonatomic, strong) LQModelProductDetail *period;
@property (nonatomic, copy) NSString *image;
@property (nonatomic, copy) NSString *sdescription;
@property (nonatomic, strong) NSArray *imageList;
@property (nonatomic, copy) NSString *userCount;
@end
|
#pragma once
#include <QtWidgets/QWidget>
class QPrivateWidgetChildren;
class QPrivateWidget : public QWidget
{
Q_OBJECT
public:
QPrivateWidget(QWidget *parent = 0);
protected:
QPrivateWidgetChildren* children;
};
|
//
// CollectViewController.h
// ViewLuoYang
//
// Created by scjy on 16/3/19.
// Copyright © 2016年 秦俊珍. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CollectViewController : UIViewController
@property (nonatomic, strong) NSMutableArray *urlArray;
@end
|
// Copyright 2022 DeepMind Technologies 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.
#ifndef THIRD_PARTY_PY_ENVLOGGER_PLATFORM_PARSE_TEXT_PROTO_H_
#define THIRD_PARTY_PY_ENVLOGGER_PLATFORM_PARSE_TEXT_PROTO_H_
#include "envlogger/platform/default/parse_text_proto.h"
#endif // THIRD_PARTY_PY_ENVLOGGER_PLATFORM_PARSE_TEXT_PROTO_H_
|
/*
Copyright 2012 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include <stdio.h>
#include <strings.h>
#include <fcntl.h>
#include <syscall.h>
static int entries = 0;
static int depth_max = 0;
#define PERM 666
#define paste(front, back) front ## back
static int create_main(int max_depth)
{
int i,j,k,rval;
FILE * fp_main;
char filename[100];
fp_main = fopen("FOO_main.c","w+");
fprintf (fp_main,"//\n");
fprintf (fp_main,"//\n");
fprintf (fp_main,"#include <stdio.h>\n");
fprintf (fp_main,"\n");
fprintf (fp_main,"int main(int argc, char* argv[])\n");
fprintf (fp_main,"{\n");
fprintf (fp_main,"\tlong i=0;\n");
fprintf (fp_main,"\tlong j,k;\n");
fprintf (fp_main,"\tj=atol(argv[1]);\n");
fprintf (fp_main,"\tfor(k=0;k<j;k++){\n");
fprintf (fp_main,"\t__asm__( \n");
fprintf (fp_main,"\t\"xorq %%rdx, %%rdx\\n\\t\"\n");
fprintf (fp_main,"\t\"xorq %%rcx, %%rcx\\n\\t\"\n");
fprintf (fp_main,"\t\"inc %%rcx\\n\\t\"\n");
fprintf (fp_main,"\t\".align 16\\n\\t\"\n");
for(j=0;j<max_depth;j++){
fprintf (fp_main,"\t\"cmp %%rdx, %%rcx\\n\\t\"\n");
fprintf (fp_main,"\t\"je LP_%06d\\n\\t\"\n",j);
fprintf (fp_main,"\t\"xorq %%rdx, %%rcx\\n\\t\"\n");
fprintf (fp_main,"\t\".align 16\\n\\t\"\n");
fprintf (fp_main,"\t\"LP_%06d:\\n\\t\"\n",j);
}
fprintf (fp_main,"\t);\n");
fprintf (fp_main,"\t}\n");
fprintf (fp_main,"\n");
fprintf (fp_main,"\treturn 0;\n");
fprintf (fp_main,"}\n");
rval=fclose(fp_main);
return 0;
}
main(int argc, char* argv[])
{
int max_so,max_chain,max_depth, rval;
if(argc < 2){
printf("generator needs one input number, argc = %d\n",argc);
exit(1);
}
max_depth = atoi(argv[1]);
printf (" max_depth= %d\n",max_depth);
rval = create_main(max_depth);
}
|
//
// XQQVoicePlayAnimationTool.h
// XQQChatProj
//
// Created by XQQ on 2016/11/25.
// Copyright © 2016年 UIP. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "XQQChatBtn.h"
@interface XQQVoicePlayAnimationTool : NSObject
+ (instancetype)sharedTool;
/*开始动画*/
- (void)startAnimationWithBtn:(XQQChatBtn*)button
isMine:(BOOL)isMine;
/*停止动画*/
- (void)endAnimation;
@end
|
/* 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.
*/
#include "tomcrypt_private.h"
/**
@file crypt_unregister_hash.c
Unregister a hash, Tom St Denis
*/
/**
Unregister a hash from the descriptor table
@param hash The hash descriptor to remove
@return CRYPT_OK on success
*/
int unregister_hash(const struct ltc_hash_descriptor *hash)
{
int x;
LTC_ARGCHK(hash != NULL);
/* is it already registered? */
LTC_MUTEX_LOCK(<c_hash_mutex);
for (x = 0; x < TAB_SIZE; x++) {
if (XMEMCMP(&hash_descriptor[x], hash, sizeof(struct ltc_hash_descriptor)) == 0) {
hash_descriptor[x].name = NULL;
LTC_MUTEX_UNLOCK(<c_hash_mutex);
return CRYPT_OK;
}
}
LTC_MUTEX_UNLOCK(<c_hash_mutex);
return CRYPT_ERROR;
}
/* ref: HEAD -> develop */
/* git commit: 9c0d7085234bd6baba2ab8fd9eee62254599341c */
/* commit time: 2018-10-15 10:51:17 +0200 */
|
//
// AppDelegate.h
// ReportChart
//
// Created by fzhang on 16/3/30.
// Copyright © 2016年 fzhang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@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.
*/
/*
* log_command.c
*
* \date Jun 26, 2011
* \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
* \copyright Apache License, Version 2.0
*/
#include <stdlib.h>
#include <string.h>
#include "bundle_context.h"
#include "log_reader_service.h"
#include "linked_list_iterator.h"
celix_status_t logCommand_levelAsString(bundle_context_pt context, log_level_t level, char **string);
void logCommand_execute(bundle_context_pt context, char *line, FILE *outStream, FILE *errStream) {
service_reference_pt readerService = NULL;
bundleContext_getServiceReference(context, (char *) OSGI_LOGSERVICE_READER_SERVICE_NAME, &readerService);
if (readerService != NULL) {
linked_list_pt list = NULL;
linked_list_iterator_pt iter = NULL;
log_reader_service_pt reader = NULL;
bundleContext_getService(context, readerService, (void **) &reader);
reader->getLog(reader->reader, &list);
iter = linkedListIterator_create(list, 0);
while (linkedListIterator_hasNext(iter)) {
log_entry_pt entry = linkedListIterator_next(iter);
char time[20];
char *level = NULL;
char errorString[256];
strftime(time, 20, "%Y-%m-%d %H:%M:%S", localtime(&entry->time));
logCommand_levelAsString(context, entry->level, &level);
if (entry->errorCode > 0) {
celix_strerror(entry->errorCode, errorString, 256);
fprintf(outStream, "%s - Bundle: %s - %s - %d %s\n", time, entry->bundleSymbolicName, entry->message, entry->errorCode, errorString);
} else {
fprintf(outStream, "%s - Bundle: %s - %s\n", time, entry->bundleSymbolicName, entry->message);
}
}
linkedListIterator_destroy(iter);
linkedList_destroy(list);
bool result = true;
bundleContext_ungetService(context, readerService, &result);
bundleContext_ungetServiceReference(context, readerService);
} else {
fprintf(outStream, "No log reader available\n");
}
}
celix_status_t logCommand_levelAsString(bundle_context_pt context, log_level_t level, char **string) {
switch (level) {
case OSGI_LOGSERVICE_ERROR:
*string = "ERROR";
break;
case OSGI_LOGSERVICE_WARNING:
*string = "WARNING";
break;
case OSGI_LOGSERVICE_INFO:
*string = "INFO";
break;
case OSGI_LOGSERVICE_DEBUG:
default:
*string = "DEBUG";
break;
}
return CELIX_SUCCESS;
}
|
//
// NSFetchedResultsController+DXHelper.h
// DXHelper
//
// Created by doorxp on 2017/6/19.
// Copyright © 2017年 doorxp. All rights reserved.
//
#import <CoreData/CoreData.h>
@interface NSFetchedResultsController (DXHelper)
+ (nullable instancetype)fetchRequest:(nullable NSFetchRequest *)fetchRequest managedObjectContext: (nullable NSManagedObjectContext *)context sectionNameKeyPath:(nullable NSString *)sectionNameKeyPath cacheName:(nullable NSString *)name;
@end
@compatibility_alias NSFetcher NSFetchedResultsController;
|
/*
Copyright 2010-2013 SourceGear, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
*
* @file sg_wc_prescan_row.c
*
* @details Routines to manipulate a sg_wc_prescan_row.
*
*/
//////////////////////////////////////////////////////////////////
#include <sg.h>
#include "sg_wc__public_typedefs.h"
#include "sg_wc__public_prototypes.h"
#include "sg_wc__private.h"
//////////////////////////////////////////////////////////////////
void sg_wc_prescan_row__free(SG_context * pCtx, sg_wc_prescan_row * pPrescanRow)
{
if (!pPrescanRow)
return;
// we do not own the pPrescanDir backptrs.
SG_WC_READDIR__ROW__NULLFREE(pCtx, pPrescanRow->pRD);
SG_WC_DB__TNE_ROW__NULLFREE(pCtx, pPrescanRow->pTneRow);
SG_WC_DB__PC_ROW__NULLFREE(pCtx, pPrescanRow->pPcRow_Ref);
SG_STRING_NULLFREE(pCtx, pPrescanRow->pStringEntryname);
SG_NULLFREE(pCtx, pPrescanRow);
}
//////////////////////////////////////////////////////////////////
void sg_wc_prescan_row__get_tne_type(SG_context * pCtx,
const sg_wc_prescan_row * pPrescanRow,
SG_treenode_entry_type * pTneType)
{
SG_UNUSED( pCtx );
*pTneType = pPrescanRow->tneType;
}
//////////////////////////////////////////////////////////////////
void sg_wc_prescan_row__get_current_entryname(SG_context * pCtx,
const sg_wc_prescan_row * pPrescanRow,
const char ** ppszEntryname)
{
SG_UNUSED( pCtx );
*ppszEntryname = SG_string__sz(pPrescanRow->pStringEntryname);
// TODO 2011/08/24 I should assert that this value matches the
// TODO current values in both the pRD and the pPT.
}
void sg_wc_prescan_row__get_current_parent_alias(SG_context * pCtx,
const sg_wc_prescan_row * pPrescanRow,
SG_uint64 * puiAliasGidParent)
{
SG_UNUSED( pCtx );
*puiAliasGidParent = pPrescanRow->pPrescanDir_Ref->uiAliasGidDir;
// TODO 2011/08/24 I should assert that this value matches
// TODO the value in pRD and the pPT.
}
|
// NOTE: This file was generated by the ServiceGenerator.
// ----------------------------------------------------------------------------
// API:
// Chrome UX Report API (chromeuxreport/v1)
// Description:
// The Chrome UX Report API lets you view real user experience data for
// millions of websites.
// Documentation:
// https://developers.google.com/web/tools/chrome-user-experience-report/api/reference
#import "GTLRChromeUXReportObjects.h"
#import "GTLRChromeUXReportQuery.h"
#import "GTLRChromeUXReportService.h"
|
#include "libmockspotify.h"
#include "util.h"
sp_track *
mocksp_track_create(const char *name, int num_artists, sp_artist **artists, sp_album *album,
int duration, int popularity, int disc, int index, sp_error error,
bool is_loaded, sp_track_availability availability, sp_track_offline_status status,
bool is_local, bool is_autolinked, sp_track *playable,
bool is_starred, bool is_placeholder)
{
sp_track *track = ALLOC(sp_track);
if ( ! playable)
{
playable = track;
}
track->name = strclone(name);
track->album = album;
track->duration = duration;
track->popularity = popularity;
track->disc = disc;
track->index = index;
track->error = error;
track->is_loaded = is_loaded;
track->availability = availability;
track->offline_status = status;
track->is_local = is_local;
track->is_autolinked = is_autolinked;
track->get_playable = playable;
track->is_starred = is_starred;
track->is_placeholder = is_placeholder;
track->artists = ALLOC_N(sp_artist *, num_artists);
track->num_artists = num_artists;
MEMCPY_N(track->artists, artists, sp_artist*, num_artists);
return track;
}
DEFINE_REFCOUNTERS_FOR(track);
DEFINE_READER(track, name, const char *);
DEFINE_READER(track, album, sp_album *);
DEFINE_READER(track, duration, int);
DEFINE_READER(track, popularity, int);
DEFINE_READER(track, disc, int);
DEFINE_READER(track, index, int);
DEFINE_READER(track, error, sp_error);
DEFINE_READER(track, is_loaded, bool);
DEFINE_READER(track, is_placeholder, bool);
DEFINE_SESSION_READER(track, get_playable, sp_track *);
DEFINE_SESSION_READER(track, is_local, bool);
DEFINE_SESSION_READER(track, is_autolinked, bool);
DEFINE_SESSION_READER(track, is_starred, bool);
DEFINE_READER(track, num_artists, int);
DEFINE_ARRAY_READER(track, artist, sp_artist *);
sp_track_availability
sp_track_get_availability(sp_session *UNUSED(session), sp_track *track)
{
return sp_track_is_loaded(track) ? track->availability : SP_TRACK_AVAILABILITY_UNAVAILABLE;
}
sp_track *
sp_localtrack_create(const char *artist, const char *title, const char *album, int length)
{
sp_artist *partist = mocksp_artist_create(artist, NULL, true);
sp_album *palbum = NULL;
if (strlen(album) > 0)
{
palbum = mocksp_album_create(album, partist, 2011, NULL, SP_ALBUMTYPE_UNKNOWN, 1, 1);
}
return mocksp_track_create(title, 1, &partist, palbum, length, 0, 0, 0, SP_ERROR_OK, true, SP_TRACK_AVAILABILITY_AVAILABLE, SP_TRACK_OFFLINE_DONE, true, false, NULL, false, false);
}
sp_error
sp_track_set_starred(sp_session *UNUSED(session), sp_track *const *tracks, int num_tracks, bool starred)
{
int i;
for (i = 0; i < num_tracks; i++)
{
tracks[i]->is_starred = starred;
}
return SP_ERROR_OK;
}
sp_track_offline_status
sp_track_offline_get_status(sp_track *track)
{
return track->offline_status;
}
|
/* Copyright (c) 2019-2022, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 the "License";
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "common/vk_common.h"
#include "platform/window.h"
struct GLFWwindow;
namespace vkb
{
class Platform;
/**
* @brief An implementation of GLFW, inheriting the behaviour of the Window interface
*/
class GlfwWindow : public Window
{
public:
GlfwWindow(Platform *platform, const Window::Properties &properties);
virtual ~GlfwWindow();
VkSurfaceKHR create_surface(Instance &instance) override;
VkSurfaceKHR create_surface(VkInstance instance, VkPhysicalDevice physical_device) override;
bool should_close() override;
void process_events() override;
void close() override;
float get_dpi_factor() const override;
float get_content_scale_factor() const override;
private:
GLFWwindow *handle = nullptr;
};
} // namespace vkb
|
//
// WKListTableViewCell.h
// Walking
//
// Created by lanou on 16/4/19.
// Copyright © 2016年 xqy. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "WKRecommendListModel.h"
@interface WKListTableViewCell : UITableViewCell
@property (strong, nonatomic) IBOutlet UIImageView *backImageV;
@property (strong, nonatomic) IBOutlet UILabel *titleLabel;
@property (strong, nonatomic) IBOutlet UILabel *timeLabel;
@property (strong, nonatomic) IBOutlet UILabel *addressLabel;
@property (strong, nonatomic) IBOutlet UIImageView *icon;
@property (strong, nonatomic) IBOutlet UILabel *userName;
@property (strong, nonatomic) IBOutlet UIView *view;
@property (nonatomic, strong) WKRecommendListModel *listModel;
@end
|
#ifndef WaSet_H
#define WaSet_H
#include "Synthesizer.h"
#include "Orchestra.h"
#include <string>
#include <map>
#define HAVE_WriteWaPlot 0
//! A vocal sound
struct Wa {
Synthesizer::Waveform waveform;
float freq; // Frequency of wa in Hz
float duration; // Duration of wa in seconds
};
//! A collection of Was
class WaSet: public Synthesizer::SoundSet {
public:
//! Construct WaSet from given .wav file of was.
WaSet( const std::string& wavFilename );
//! Find closest match Wa
const Wa* lookup( float pitch, float duration ) const;
//! Apply f to each Wa
template<typename F>
void forEach(F f) const {
for( const Wa& w: myArray )
f(w);
}
/*override*/ Midi::Instrument* makeInstrument() const;
#if HAVE_WriteWaPlot
// For debugging
void writeWaPlot( const char* filename ) const;
#endif
private:
SimpleArray<Wa> myArray;
};
#if HAVE_WriteWaPlot
void WriteWaPlot( const char* filename, const MidiTrack& track, double ticksPerSec );
#endif
#endif /* WaSet_H */
|
//
// UIButton+BLBlock.h
// MyFreeMall
//
// Created by boundlessocean on 16/11/11.
// Copyright © 2016年 GXCloud. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void (^BLButtonActionBlock)(id sender);
@interface UIButton (BLBlock)
/**
* 处理事件
*
* @param actionBlock 事件回调
* @param controlEvent 事件类型
*/
- (void)bl_handleWithBlock:(BLButtonActionBlock)actionBlock controlEvent:(UIControlEvents)controlEvent;
/**
* 扩大 UIButton 的点击范围
* 上下左右需要延伸的范围
*
* @param top <#top description#>
* @param right <#right description#>
* @param bottom <#bottom description#>
* @param left <#left description#>
*/
- (void)bl_setEnlargeEdgeWithTop:(CGFloat)top right:(CGFloat)right bottom:(CGFloat)bottom left:(CGFloat)left;
@end
|
/*
* Copyright 2008-2012 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <thrust/detail/config.h>
// this system has no special scatter functions
|
//
// Generated by gen_resource_source.py
//
#ifndef _COM_IBM_ICU_IMPL_DATA_ICUDT58B_ZONE_EBU_RES_H
#define _COM_IBM_ICU_IMPL_DATA_ICUDT58B_ZONE_EBU_RES_H
static jbyte _com_ibm_icu_impl_data_icudt58b_zone_ebu_res[] = {
0x00, 0x20, 0xDA, 0x27, 0x00, 0x14, 0x00, 0x00, 0x01, 0x00,
0x02, 0x00, 0x52, 0x65, 0x73, 0x42, 0x03, 0x00, 0x00, 0x00,
0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x50, 0x00, 0x00, 0x01, 0x00, 0x1B, 0xF3, 0x08,
0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00,
0x00, 0x0B, 0x00, 0x00, 0x00, 0x01, 0x1B, 0xF3, 0x00, 0x04,
0x00, 0x00, 0x00, 0x0B, 0xF9, 0x85, 0x50, 0x53, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x1B, 0xF2, 0xAA, 0xAA, 0xAA, 0xAA,
};
J2OBJC_RESOURCE(\
_com_ibm_icu_impl_data_icudt58b_zone_ebu_res, \
80, \
0x30664fc5);
#endif
|
//////////////////////////////////////////////////////////////////////////
// Name: plate_detect Header
// Version: 1.2
// Date: 2014-09-28
// MDate: 2015-03-13
// Author: liuruoze
// Copyright: liuruoze
// Reference: Mastering OpenCV with Practical Computer Vision Projects
// Reference: CSDN Bloger taotao1233
// Desciption:
// Defines CPlateDetect
//////////////////////////////////////////////////////////////////////////
#ifndef EASYPR_CORE_PLATEDETECT_H_
#define EASYPR_CORE_PLATEDETECT_H_
#include "easypr/core/plate_locate.h"
#include "easypr/core/plate_judge.h"
/*! \namespace easypr
Namespace where all the C++ EasyPR functionality resides
*/
namespace easypr {
class CPlateDetect {
public:
CPlateDetect();
~CPlateDetect();
//! Éî¶È³µÅƼì²â£¬Ê¹ÓÃÑÕÉ«Óë¶þ´ÎSobel·¨×ÛºÏ
int plateDetect(Mat src, std::vector<CPlate>& resultVec,
bool showDetectArea = true, int index = 0);
//! չʾÖмäµÄ½á¹û
int showResult(const Mat& result);
//! ×°ÔØSVMÄ£ÐÍ
void LoadSVM(std::string s);
//! Éú»îģʽÓ빤ҵģʽÇл»
inline void setPDLifemode(bool param) { m_plateLocate->setLifemode(param); }
//! ÊÇ·ñ¿ªÆôµ÷ÊÔģʽ
inline void setPDDebug(bool param) { m_plateLocate->setDebug(param); }
//! »ñÈ¡µ÷ÊÔģʽ״̬
inline bool getPDDebug() { return m_plateLocate->getDebug(); }
//! ÉèÖÃÓë¶ÁÈ¡±äÁ¿
inline void setGaussianBlurSize(int param) {
m_plateLocate->setGaussianBlurSize(param);
}
inline int getGaussianBlurSize() const {
return m_plateLocate->getGaussianBlurSize();
}
inline void setMorphSizeWidth(int param) {
m_plateLocate->setMorphSizeWidth(param);
}
inline int getMorphSizeWidth() const {
return m_plateLocate->getMorphSizeWidth();
}
inline void setMorphSizeHeight(int param) {
m_plateLocate->setMorphSizeHeight(param);
}
inline int getMorphSizeHeight() const {
return m_plateLocate->getMorphSizeHeight();
}
inline void setVerifyError(float param) {
m_plateLocate->setVerifyError(param);
}
inline float getVerifyError() const {
return m_plateLocate->getVerifyError();
}
inline void setVerifyAspect(float param) {
m_plateLocate->setVerifyAspect(param);
}
inline float getVerifyAspect() const {
return m_plateLocate->getVerifyAspect();
}
inline void setVerifyMin(int param) { m_plateLocate->setVerifyMin(param); }
inline void setVerifyMax(int param) { m_plateLocate->setVerifyMax(param); }
inline void setJudgeAngle(int param) { m_plateLocate->setJudgeAngle(param); }
inline void setMaxPlates(int param) { m_maxPlates = param; }
inline int getMaxPlates() const { return m_maxPlates; }
private:
//! ÉèÖÃÒ»·ùͼÖÐ×î¶àÓжàÉÙ³µÅÆ
int m_maxPlates;
//! ³µÅƶ¨Î»
CPlateLocate* m_plateLocate;
};
} /*! \namespace easypr*/
#endif // EASYPR_CORE_PLATEDETECT_H_
|
/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __CONFIG_H__
#define __CONFIG_H__
#ifdef CONFIG_NET_CONFIG_SETTINGS
#ifdef CONFIG_NET_IPV6
#define ZEPHYR_ADDR CONFIG_NET_CONFIG_MY_IPV6_ADDR
#define SERVER_ADDR CONFIG_NET_CONFIG_PEER_IPV6_ADDR
#else
#define ZEPHYR_ADDR CONFIG_NET_CONFIG_MY_IPV4_ADDR
#define SERVER_ADDR CONFIG_NET_CONFIG_PEER_IPV4_ADDR
#endif
#else
#ifdef CONFIG_NET_IPV6
#define ZEPHYR_ADDR "2001:db8::1"
#define SERVER_ADDR "2001:db8::2"
#else
#define ZEPHYR_ADDR "192.168.1.101"
#define SERVER_ADDR "192.168.1.10"
#endif
#endif
#ifdef CONFIG_MQTT_LIB_TLS
#define SERVER_PORT 8883
#else
#define SERVER_PORT 1883
#endif
#define APP_SLEEP_MSECS 500
#define APP_TX_RX_TIMEOUT 300
#define APP_NET_INIT_TIMEOUT 10000
#define APP_CONNECT_TRIES 10
#define APP_MAX_ITERATIONS 100
#define APP_MQTT_BUFFER_SIZE 128
#define MQTT_CLIENTID "zephyr_publisher"
/* Set the following to 1 to enable the Bluemix topic format */
#define APP_BLUEMIX_TOPIC 0
/* These are the parameters for the Bluemix topic format */
#if APP_BLUEMIX_TOPIC
#define BLUEMIX_DEVTYPE "sensor"
#define BLUEMIX_DEVID "carbon"
#define BLUEMIX_EVENT "status"
#define BLUEMIX_FORMAT "json"
#endif
#endif
|
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the );
// 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 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 PRIVACY_NET_KRYPTON_CRYPTO_RSA_FDH_BLINDER_H_
#define PRIVACY_NET_KRYPTON_CRYPTO_RSA_FDH_BLINDER_H_
#include <memory>
#include <string_view>
#include <vector>
#include "third_party/absl/status/statusor.h"
#include "third_party/absl/strings/escaping.h"
#include "third_party/absl/strings/string_view.h"
#include "third_party/openssl/base.h"
#include "third_party/openssl/bn.h"
#include "third_party/openssl/rsa.h"
#include "third_party/tink/cc/subtle/subtle_util_boringssl.h"
namespace privacy {
namespace krypton {
namespace crypto {
// RsaFdhBlinder represents a blinded value (probably an FDH hash), ready for
// signing. It can also unblind a blinded value assuming it was signed by the
// matching key used in the initialization call to `Blind`.
class RsaFdhBlinder {
public:
~RsaFdhBlinder() = default;
// Blind `message` using n and e derived from an RSA public key.
// `message` will first be hashed with a Shake256 Full Domain Hash of the
// message. This hash matches that used by RsaVerifier.
static absl::StatusOr<std::unique_ptr<RsaFdhBlinder>> Blind(
const absl::string_view message, bssl::UniquePtr<RSA> signer_public_key,
BN_CTX* bn_ctx);
const absl::string_view blind() const { return blind_; }
// Unblinds `blind_signature`.
absl::StatusOr<std::string> Unblind(const absl::string_view blind_signature,
BN_CTX* bn_ctx) const;
private:
// Use `Blind` to construct
RsaFdhBlinder(bssl::UniquePtr<BIGNUM> r, bssl::UniquePtr<RSA> public_key,
std::string blind);
const bssl::UniquePtr<BIGNUM> r_;
bssl::UniquePtr<RSA> public_key_;
std::string blind_;
};
// RsaFdhBlindSigner signs a set of blinded data with the given key, resulting
// in an unblindable signature.
class RsaFdhBlindSigner {
public:
~RsaFdhBlindSigner() = default;
static absl::StatusOr<std::unique_ptr<RsaFdhBlindSigner>> New(
const ::crypto::tink::subtle::SubtleUtilBoringSSL::RsaPrivateKey&
private_key);
absl::StatusOr<std::string> Sign(const absl::string_view blinded_data) const;
private:
// Use New to construct.
explicit RsaFdhBlindSigner(bssl::UniquePtr<RSA> signing_key)
: signing_key_(std::move(signing_key)) {}
const bssl::UniquePtr<RSA> signing_key_;
};
// RsaFdhVerifier verifies a hash matches a signature with a given public key.
class RsaFdhVerifier {
public:
~RsaFdhVerifier() = default;
static absl::StatusOr<std::unique_ptr<RsaFdhVerifier>> New(
const ::crypto::tink::subtle::SubtleUtilBoringSSL::RsaPublicKey&
public_key);
absl::Status Verify(const absl::string_view message,
const absl::string_view signature, BN_CTX* bn_ctx) const;
private:
// Use New to construct.
explicit RsaFdhVerifier(bssl::UniquePtr<RSA> verification_key)
: verification_key_(std::move(verification_key)) {}
const bssl::UniquePtr<RSA> verification_key_;
};
} // namespace crypto
} // namespace krypton
} // namespace privacy
#endif // PRIVACY_NET_KRYPTON_CRYPTO_RSA_FDH_BLINDER_H_
|
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2008-2010 Ricardo Quesada
Copyright (c) 2011 Zynga Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CCSHAPE_H_
#define __CCSHAPE_H_
#include "draw_nodes/CCDrawingPrimitives.h"
#include "base_nodes/CCNode.h"
#include "cocoa/CCPointArray.h"
NS_CC_BEGIN
class CCShapeNode : public CCNode
{
public:
const ccColor4F& getColor(void) {
return m_color;
}
void setColor(const ccColor4F& color) {
m_color = color;
}
float getLineWidth(void) {
return m_lineWidth;
}
void setLineWidth(float lineWidth) {
m_lineWidth = lineWidth;
}
GLushort getLineStipple(void) {
return m_lineStipple;
}
void setLineStipple(GLushort pattern) {
m_lineStipple = pattern;
}
bool isLineStippleEnabled(void) {
return m_lineStippleEnabled;
}
void setLineStippleEnabled(bool lineStippleEnabled) {
m_lineStippleEnabled = lineStippleEnabled;
}
void draw(void);
protected:
CCShapeNode(void)
: m_lineWidth(1.0f)
, m_lineStipple(0xFFFF)
, m_lineStippleEnabled(false)
{
m_color = ccc4f(0, 0, 0, 1);
}
ccColor4F m_color;
float m_lineWidth;
GLushort m_lineStipple;
bool m_lineStippleEnabled;
virtual void beforeDraw(void);
virtual void drawProc(void) = 0;
virtual void afterDraw(void);
inline const CCPoint getDrawPosition(void) {
const CCSize& size = getParent()->getContentSize();
return CCPointMake(size.width / 2, size.height / 2);
}
};
#pragma mark -
class CCCircleShape : public CCShapeNode
{
public:
static CCCircleShape* create(float radius);
float getRadius(void) {
return m_radius;
}
void setRadius(float radius) {
m_radius = radius;
}
float getAngle(void) {
return m_angle;
}
void setAngle(float angle) {
m_angle = angle;
}
unsigned int getSegments(void) {
return m_segments;
}
void setSegments(unsigned int segments) {
m_segments = segments;
}
bool isDrawLineToCenter(void) {
return m_drawLineToCenter;
}
void setDrawLineToCenter(bool drawLineToCenter) {
m_drawLineToCenter = drawLineToCenter;
}
float getScaleX(void) {
return m_scaleX;
}
void setScaleX(float xScale) {
m_scaleX = xScale;
}
float getScaleY(void) {
return m_scaleY;
}
void setScaleY(float yScale) {
m_scaleY = yScale;
}
protected:
CCCircleShape(float radius)
: m_radius(radius)
, m_angle(0)
, m_segments(32)
, m_drawLineToCenter(false)
, m_scaleX(1.0f)
, m_scaleY(1.0f)
{
}
float m_radius;
float m_angle;
unsigned int m_segments;
bool m_drawLineToCenter;
float m_scaleX;
float m_scaleY;
virtual void drawProc(void);
};
#pragma mark -
class CCRectShape : public CCShapeNode
{
public:
static CCRectShape* create(const CCSize& size);
const CCSize& getSize(void) {
return m_size;
}
void setSize(const CCSize& size) {
m_size = size;
}
bool isFill(void) {
return m_fill;
}
void setFill(bool fill) {
m_fill = fill;
}
protected:
CCRectShape(const CCSize& size)
: m_size(size)
, m_fill(false)
{
}
CCSize m_size;
bool m_fill;
virtual void drawProc(void);
};
#pragma mark -
class CCPointShape : public CCShapeNode
{
public:
static CCPointShape* create(void);
protected:
virtual void drawProc(void);
};
#pragma mark -
class CCPolygonShape : public CCShapeNode
{
public:
static CCPolygonShape* create(CCPoint* vertices, unsigned int numVertices);
static CCPolygonShape* create(CCPointArray* vertices);
~CCPolygonShape(void);
bool isFill(void) {
return m_fill;
}
void setFill(bool fill) {
m_fill = fill;
}
bool isClose(void) {
return m_close;
}
void setClose(bool close) {
m_close = close;
}
protected:
CCPolygonShape(void)
: m_vertices(NULL)
, m_verticesDraw(NULL)
, m_numberOfVertices(0)
, m_fill(false)
, m_close(false)
{
}
bool initWithVertices(CCPoint* vertices, unsigned int numVertices);
bool initWithVertices(CCPointArray* vertices);
CCPoint* m_vertices;
CCPoint* m_verticesDraw;
unsigned int m_numberOfVertices;
bool m_fill;
bool m_close;
virtual void drawProc(void);
};
NS_CC_END
#endif /* __CCSHAPE_H_ */
|
/*
* Report.h
*
* Report AP information and environment to Manger
* If Manger send command, execute proper action.
*/
#ifndef REPORT_H_
#define REPORT_H_
#include "Packet.h"
#include "APInformation.h"
#include "Socket.h"
#include "hostap.h"
#include "Database.h"
#include "Action.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
const unsigned short PORT_NUMBER = 3000;
const unsigned short UPDATE_TIME = 10;
class Report {
private:
// Baisc AP info
APInformation m_APInfo;
// Socket connection variable
Socket* m_sock;
Database m_db;
// For time stamp to print on terminal
time_t m_time;
struct tm *m_ptm;
std::string PrintTime();
// Make connection with OpenWinNet Manager
// When AP wake up, send basic AP Information
// to OpenwinNet Manger for registration
void Initialize();
// to experiment
void testBed(int i);
public:
hostap* m_ap;
Report(int i);
Report(hostap *);
Report();
virtual ~Report();
/*
* Send Message to manager
*/
void SendAPRegistrationRequest();
void SendAPStateUpdateRequest();
};
#endif /* REPORT_H_ */
|
#ifndef __UTILS_H__
#define __UTILS_H__
/*
* Copyright 2014 Open Connectome Project (http://openconnecto.me)
* Written by Da Zheng (zhengda1936@gmail.com)
*
* This file is part of FlashGraph.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdlib.h>
#include <vector>
#include <memory>
#include "graph_file_header.h"
#include "FG_basic_types.h"
namespace fg
{
class in_mem_graph;
class vertex_index;
class vertex_index;
class in_mem_vertex;
class ext_mem_undirected_vertex;
class vertex_index_construct;
namespace utils
{
/**
* The type of edge data.
*/
enum {
DEFAULT_TYPE,
EDGE_COUNT,
EDGE_TIMESTAMP,
};
class serial_subgraph;
/*
* This class serializes a graph and stores it in contiguous memory.
*/
class serial_graph
{
size_t num_edges;
size_t num_vertices;
size_t num_non_empty;
std::shared_ptr<vertex_index_construct> index;
size_t edge_data_size;
public:
typedef std::shared_ptr<serial_graph> ptr;
serial_graph(std::shared_ptr<vertex_index_construct> index,
size_t edge_data_size) {
num_edges = 0;
num_vertices = 0;
num_non_empty = 0;
this->index = index;
this->edge_data_size = edge_data_size;
}
virtual ~serial_graph();
virtual void add_vertex(const in_mem_vertex &v);
// This needs to be redefined for undirected graphs.
virtual size_t get_num_edges() const {
return num_edges;
}
size_t get_num_vertices() const {
return num_vertices;
}
bool has_edge_data() const {
return edge_data_size > 0;
}
size_t get_edge_data_size() const {
return edge_data_size;
}
size_t get_num_non_empty_vertices() const {
return num_non_empty;
}
vertex_index_construct &get_index() {
return *index;
}
std::shared_ptr<vertex_index> dump_index(bool compressed) const;
virtual void finalize_graph_file() {
}
virtual graph_type get_graph_type() const = 0;
virtual void add_vertices(const serial_subgraph &subg) = 0;
virtual std::shared_ptr<in_mem_graph> dump_graph(
const std::string &graph_name) = 0;
};
/*
* The interface defines a graph represented by edges.
*/
class edge_graph
{
size_t edge_data_size;
public:
typedef std::shared_ptr<edge_graph> ptr;
edge_graph(size_t edge_data_size) {
this->edge_data_size = edge_data_size;
}
virtual ~edge_graph() {
}
virtual void sort_edges() = 0;
virtual void check_vertices(
const std::vector<ext_mem_undirected_vertex *> &vertices,
bool in_part, std::vector<off_t> &edge_offs) const = 0;
virtual size_t get_num_edges() const = 0;
bool has_edge_data() const {
return edge_data_size > 0;
}
size_t get_edge_data_size() const {
return edge_data_size;
}
};
/*
* This interface serializes a graph into a single piece of memory.
*/
class mem_serial_graph: public serial_graph
{
protected:
mem_serial_graph(std::shared_ptr<vertex_index_construct> index,
size_t edge_data_size): serial_graph(index, edge_data_size) {
}
public:
typedef std::shared_ptr<mem_serial_graph> ptr;
static ptr create(bool directed, size_t edge_data_size);
virtual void add_empty_vertex(vertex_id_t id) = 0;
};
}
}
#endif
|
//
// ViewController.h
// examination
//
// Created by 李晓 on 15/9/7.
// Copyright (c) 2015年 exam. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#include "imesample.h"
#include "helper.h"
#include <stdarg.h>
/**********************************************************************/
/* */
/* UI_IsIMEMessage(message) */
/* */
/* Any UI window should not pass the IME messages to DefWindowProc. */
/* */
/**********************************************************************/
BOOL Helper_IsIMEMessage(UINT message)
{
switch(message)
{
case WM_IME_STARTCOMPOSITION:
case WM_IME_ENDCOMPOSITION:
case WM_IME_COMPOSITION:
case WM_IME_NOTIFY:
case WM_IME_SETCONTEXT:
case WM_IME_CONTROL:
case WM_IME_COMPOSITIONFULL:
case WM_IME_SELECT:
case WM_IME_CHAR:
return TRUE;
default:
return FALSE;
}
}
//*****************************************************
// ¹¤¾ß½Ó¿Ú£ºÏÔʾλͼ
//******************************************************
void Helper_DrawBMP(HDC hdc,RECT rc,UINT bmpID)
{
HDC memdc=CreateCompatibleDC(hdc);
HBITMAP hbkbmp=(HBITMAP)LoadBitmap(g_hInst,MAKEINTRESOURCE(bmpID));
HBITMAP holdbmp=(HBITMAP) SelectObject(memdc,hbkbmp);
BitBlt(hdc,rc.left,rc.top,rc.right,rc.bottom,memdc,0,0,SRCCOPY);
SelectObject(memdc,holdbmp);
DeleteObject(hbkbmp);
DeleteDC(memdc);
}
void Helper_Trace(char * pszFormat,...)
{
va_list args;
char buf[1024];
va_start( args, pszFormat );
_vsnprintf(buf,sizeof(buf)-1, pszFormat,args);
va_end (args);
buf[sizeof(buf)-1]=0;
OutputDebugString(buf);
#ifdef LOGFILE
{
FILE *f=fopen(LOGFILE,"a+");
if(f)
{
fprintf(f,buf);
fclose(f);
}
}
#endif
}
void Helper_CenterWindow(HWND hWnd)
{
RECT rc,screenrc;
int x,y;
SystemParametersInfo(SPI_GETWORKAREA,
0,
&screenrc,
0);
GetWindowRect(hWnd,&rc);
x=(screenrc.right-rc.right+rc.left)/2;
y=(screenrc.bottom-rc.bottom+rc.top)/2;
SetWindowPos(hWnd,NULL,x,y,0,0,SWP_NOSIZE|SWP_NOZORDER);
}
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2011 by colorPicker, 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.
*/
#ifdef USE_TI_FACEBOOK
#import "FacebookModule.h"
#import "KrollCallback.h"
#import "FBConnect/Facebook.h"
@interface TiFacebookRequest : NSObject<FBRequestDelegate2> {
NSString *path;
KrollCallback *callback;
FacebookModule *module;
BOOL graph;
}
-(id)initWithPath:(NSString*)path_ callback:(KrollCallback*)callback_ module:(FacebookModule*)module_ graph:(BOOL)graph_;
@end
#endif
|
// Copyright 2011 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef XPAF_BASE_WEBUTIL_H_
#define XPAF_BASE_WEBUTIL_H_
#include "base/integral_types.h"
namespace xpaf {
class HTTPUtils {
public:
// Takes a pointer to the full HTTP document text (including headers) and
// returns a pointer to the body of the text (possibly an empty string).
// Returns NULL if the end of headers was not found. In this case, depending
// on the application, the caller might check whether the initial characters
// resemble an HTTP status line, and if not, assume the HTTP headers are
// missing and that all of content is body.
//
// Note: The implementation is based on a simple scan for "\r\n\r\n", and
// makes no attempt to parse the headers or detect a malformed HTTP response.
//
static const char* SkipHttpHeaders(const char* content, uint32 content_len);
};
} // namespace xpaf
#endif // XPAF_BASE_WEBUTIL_H_
|
/*
* File: Consola.h
* Author: Dmytro Yaremyshyn
*
* Created on 6 de Dezembro de 2016, 16:06
*/
#ifndef CONSOLA_H
#define CONSOLA_H
#include <windows.h>
class Consola {
HANDLE hconsola;
HANDLE hStdin;
HWND hwnd;
public:
// para usar nas cores
const static int PRETO = 0;
const static int AZUL = 1;
const static int VERDE = 2;
const static int CYAN = 3;
const static int VERMELHO = 4;
const static int ROXO = 5;
const static int AMARELO = 6;
const static int BRANCO = 7;
const static int CINZENTO = 8;
const static int AZUL_CLARO = 9;
const static int VERDE_CLARO = 10;
const static int CYAN_CLARO = 11;
const static int VERMELHO_CLARO = 12;
const static int COR_DE_ROSA = 13;
const static int AMARELO_CLARO = 14;
const static int BRANCO_CLARO = 15;
// para usar em getch
const static char ESQUERDA = 1;
const static char DIREITA = 2;
const static char CIMA = 3;
const static char BAIXO = 4;
const static char ENTER = 13;
const static char ESCAPE = 27;
Consola();
// Posiciona o cursor na posição x,y
// - Os proximos cout/cin serão feitos a partir daí
void gotoxy(int x, int y);
// Limpa o ecrã
// - Usa a côr de fundo que estiver definida
void clrscr();
void clrscr_comandline();
// Muda a côr das letras
// - Os cout/cin seguintes usarão essa côr
void setTextColor(WORD color);
// Muda a côr de fundo
// - Os printf/cout seguintes usarão essa côr
// - Os clrsrc() seguintes usarão essa côr de fundo
void setBackgroundColor(WORD color);
// Muda a dimensão do ecrã para NLinhas x NCols
// - O redimensionamento pode falhar se o tamanho
// indicado for excessivo ou se for demasiado
// pequeno
// - Limpa o ecrã usando a côr que estiver definida?
void setScreenSize(int nLinhas, int nCols);
// Muda (tenta mudar) o tamanho da letra
// - Esta função pode falhar em determinadas situações
// (falhar = não muda nada)
// É mais provável falhar no sistemas antigos (XP)
// - Ver também setSTextSizeXP
void setTextSize(int x, int y);
// Muda (tenta mudar) o tamanho da letra para XP (alguém ainda usa isso?)
// - Esta função é para usar apenas no caso do sistema
// ser o XP
// No outros sistemas existe a função setTextSize
// - Pode falhar em determinadas situações
// (falhar = não muda nada)
// - Ver também setSTextSizeXP
void setTextSizeXP(int x, int y);
// Lê um caracter sem precisar de "enter" no fim
// - Util para fazer pausas do tipo
// "press any key to continue"
// - Esta funcionalidade também se consegue de
// outras formas
char getch(void);
// As duas funções seguintes são pouco interessantes
// Desenha uma linha usando pixeis (não é com caracteres)
// - Esta é uma função gráfica. Trabalha com pixeis
// - Os pixeis da linha ficam sobrepostos ao texto
// Esta função é pouco interessante porque:
// - A linha não fica memorizada. Desaparece quando:
// . Se oculta e volta a mostrar a janela da consola
// . Se redimensiona a janela
void drawLine(int x1, int y1, int x2, int y2, int cor);
// Desenha um círculo usando pixeis (não é com caracteres)
// - Esta é uma função gráfica. Trabalha com pixeis
// - Os pixeis do círculo ficam sobrepostos ao texto
// Esta função é pouco interessante porque:
// - O círculo não fica memorizado. Desaparece quando:
// . Se oculta e volta a mostrar a janela da consola
// . Se redimensiona a janela
void drawCircle(int X, int Y, int R, int Pen, int Fill);
};
#endif /* CONSOLA_H */
|
/*
* Copyright 2011-2012 the Redfish authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef REDFISH_UTIL_SAFE_IO
#define REDFISH_UTIL_SAFE_IO
#include "util/compiler.h"
#include <unistd.h>
ssize_t safe_write(int fd, const void *b, size_t c) WARN_UNUSED_RES;
ssize_t safe_pwrite(int fd, const void *b, size_t c, off_t off) WARN_UNUSED_RES;
ssize_t safe_read(int fd, void *b, size_t c) WARN_UNUSED_RES;
ssize_t safe_pread(int fd, void *b, size_t c, off_t off) WARN_UNUSED_RES;
ssize_t safe_read_exact(int fd, void *b, size_t c) WARN_UNUSED_RES;
ssize_t safe_pread_exact(int fd, void *b, size_t c, off_t off) WARN_UNUSED_RES;
int safe_close(int fd);
#endif
|
/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_NIOS2_ASM_INLINE_GCC_H_
#define ZEPHYR_INCLUDE_ARCH_NIOS2_ASM_INLINE_GCC_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* The file must not be included directly
* Include arch/cpu.h instead
*/
#ifndef _ASMLANGUAGE
#include <zephyr/types.h>
#include <toolchain.h>
#endif /* _ASMLANGUAGE */
#ifdef __cplusplus
}
#endif
#endif /* _ASM_INLINE_GCC_PUBLIC_GCC_H */
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include "client.h"
#include "common/clipboard.h"
#include "common/recording.h"
#include "common-ssh/sftp.h"
#include "ssh.h"
#include "terminal/terminal.h"
#include "user.h"
#include <langinfo.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <guacamole/client.h>
int guac_client_init(guac_client* client) {
/* Set client args */
client->args = GUAC_SSH_CLIENT_ARGS;
/* Allocate client instance data */
guac_ssh_client* ssh_client = calloc(1, sizeof(guac_ssh_client));
client->data = ssh_client;
/* Init clipboard */
ssh_client->clipboard = guac_common_clipboard_alloc(GUAC_SSH_CLIPBOARD_MAX_LENGTH);
/* Set handlers */
client->join_handler = guac_ssh_user_join_handler;
client->free_handler = guac_ssh_client_free_handler;
/* Set locale and warn if not UTF-8 */
setlocale(LC_CTYPE, "");
if (strcmp(nl_langinfo(CODESET), "UTF-8") != 0) {
guac_client_log(client, GUAC_LOG_INFO,
"Current locale does not use UTF-8. Some characters may "
"not render correctly.");
}
/* Success */
return 0;
}
int guac_ssh_client_free_handler(guac_client* client) {
guac_ssh_client* ssh_client = (guac_ssh_client*) client->data;
/* Close SSH channel */
if (ssh_client->term_channel != NULL) {
libssh2_channel_send_eof(ssh_client->term_channel);
libssh2_channel_close(ssh_client->term_channel);
}
/* Free terminal (which may still be using term_channel) */
if (ssh_client->term != NULL) {
/* Stop the terminal to unblock any pending reads/writes */
guac_terminal_stop(ssh_client->term);
/* Wait ssh_client_thread to finish before freeing the terminal */
pthread_join(ssh_client->client_thread, NULL);
guac_terminal_free(ssh_client->term);
}
/* Free terminal channel now that the terminal is finished */
if (ssh_client->term_channel != NULL)
libssh2_channel_free(ssh_client->term_channel);
/* Clean up the SFTP filesystem object and session */
if (ssh_client->sftp_filesystem) {
guac_common_ssh_destroy_sftp_filesystem(ssh_client->sftp_filesystem);
guac_common_ssh_destroy_session(ssh_client->sftp_session);
}
/* Clean up recording, if in progress */
if (ssh_client->recording != NULL)
guac_common_recording_free(ssh_client->recording);
/* Free interactive SSH session */
if (ssh_client->session != NULL)
guac_common_ssh_destroy_session(ssh_client->session);
/* Free SSH client credentials */
if (ssh_client->user != NULL)
guac_common_ssh_destroy_user(ssh_client->user);
/* Free parsed settings */
if (ssh_client->settings != NULL)
guac_ssh_settings_free(ssh_client->settings);
/* Free client structure */
guac_common_clipboard_free(ssh_client->clipboard);
free(ssh_client);
guac_common_ssh_uninit();
return 0;
}
|
/*
* Copyright (C) 2017 Sergey Koshkin <koshkin.sergey@gmail.com>
* 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
*
* 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.
*
* Project: RTE Device Configuration for STMicroelectronics STM32F0xx
*/
//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
#ifndef RTE_DEVICE_H_
#define RTE_DEVICE_H_
/*******************************************************************************
* defines and macros
******************************************************************************/
#if !defined(RTE_HSI)
#define RTE_HSI ((uint32_t)8000000) /* Default value of the Internal oscillator in Hz */
#endif // RTE_HSI
#if !defined(RTE_HSE)
#define RTE_HSE ((uint32_t)8000000) /* Default value of the External oscillator in Hz */
#endif // RTE_HSE
#if !defined(RTE_HSI14)
#define RTE_HSI14 ((uint32_t)14000000) /* Default value of the HSI14 Internal oscillator in Hz */
#endif // RTE_HSI14
#if !defined(RTE_HSI48)
#define RTE_HSI48 ((uint32_t)48000000) /* Default value of the HSI48 Internal oscillator in Hz */
#endif // RTE_HSI48
// <e> I2C1 (Inter-integrated Circuit Interface 1) [Driver_I2C1]
// <i> Configuration settings for Driver_I2C1 in component ::Drivers:I2C
#define RTE_I2C1 1
// <o> I2C1_SCL Pin <0=>PB6 <1=>PB8
#define RTE_I2C1_SCL_PORT_ID 0
#if (RTE_I2C1_SCL_PORT_ID == 0)
#define RTE_I2C1_SCL_PORT GPIO_PORT_B
#define RTE_I2C1_SCL_PIN GPIO_PIN_6
#define RTE_I2C1_SCL_FUNC GPIO_PIN_FUNC_1
#elif (RTE_I2C1_SCL_PORT_ID == 1)
#define RTE_I2C1_SCL_PORT GPIO_PORT_B
#define RTE_I2C1_SCL_PIN GPIO_PIN_8
#define RTE_I2C1_SCL_FUNC GPIO_PIN_FUNC_1
#else
#error "Invalid I2C1_SCL Pin Configuration!"
#endif
// <o> I2C1_SDA Pin <0=>PB7 <1=>PB9
#define RTE_I2C1_SDA_PORT_ID 0
#if (RTE_I2C1_SDA_PORT_ID == 0)
#define RTE_I2C1_SDA_PORT GPIO_PORT_B
#define RTE_I2C1_SDA_PIN GPIO_PIN_7
#define RTE_I2C1_SDA_FUNC GPIO_PIN_FUNC_1
#elif (RTE_I2C1_SDA_PORT_ID == 1)
#define RTE_I2C1_SDA_PORT GPIO_PORT_B
#define RTE_I2C1_SDA_PIN GPIO_PIN_9
#define RTE_I2C1_SDA_FUNC GPIO_PIN_FUNC_1
#else
#error "Invalid I2C1_SDA Pin Configuration!"
#endif
// </e> I2C1 (Inter-integrated Circuit Interface 1) [Driver_I2C1]
// <e> I2C2 (Inter-integrated Circuit Interface 2) [Driver_I2C2]
// <i> Configuration settings for Driver_I2C2 in component ::Drivers:I2C
#define RTE_I2C2 0
// <o> I2C2_SCL Pin <0=>PB10 <1=>PF6
#define RTE_I2C2_SCL_PORT_ID 0
#if (RTE_I2C2_SCL_PORT_ID == 0)
#define RTE_I2C2_SCL_PORT GPIO_PORT_B
#define RTE_I2C2_SCL_PIN GPIO_PIN_10
#define RTE_I2C2_SCL_FUNC GPIO_PIN_FUNC_1
#elif (RTE_I2C2_SCL_PORT_ID == 1)
#define RTE_I2C2_SCL_PORT GPIO_PORT_F
#define RTE_I2C2_SCL_PIN GPIO_PIN_6
#define RTE_I2C2_SCL_FUNC GPIO_PIN_FUNC_0
#else
#error "Invalid I2C2_SCL Pin Configuration!"
#endif
// <o> I2C2_SDA Pin <0=>PB11 <1=>PF7
#define RTE_I2C2_SDA_PORT_ID 0
#if (RTE_I2C2_SDA_PORT_ID == 0)
#define RTE_I2C2_SDA_PORT GPIO_PORT_B
#define RTE_I2C2_SDA_PIN GPIO_PIN_11
#define RTE_I2C2_SDA_FUNC GPIO_PIN_FUNC_1
#elif (RTE_I2C2_SDA_PORT_ID == 1)
#define RTE_I2C2_SDA_PORT GPIO_PORT_F
#define RTE_I2C2_SDA_PIN GPIO_PIN_7
#define RTE_I2C2_SDA_FUNC GPIO_PIN_FUNC_0
#else
#error "Invalid I2C2_SDA Pin Configuration!"
#endif
// </e> I2C2 (Inter-integrated Circuit Interface 2) [Driver_I2C2]
#endif /* RTE_DEVICE_H_ */
/* ----------------------------- End of file ---------------------------------*/
|
//
// WGAsiaViewController.h
// WeygoIPhone
//
// Created by muma on 2017/5/8.
// Copyright © 2017年 weygo.com. All rights reserved.
//
#import "WGTabViewController.h"
#import "WGHome.h"
#import "WGHomeTabContentViewController.h"
#import "WGHomeTabContentResponse.h"
@interface WGTabAsiaViewController : WGTabViewController
{
WGHome *_data;
WGHomeTabContentViewController *_contentVC;
WGHomeTabContentResponse *_dataResponse;
BOOL _hadReadCache;
}
- (void)refreshUI;
@end
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/mediaconvert/MediaConvert_EXPORTS.h>
#include <aws/mediaconvert/model/SrtStylePassthrough.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace MediaConvert
{
namespace Model
{
/**
* SRT Destination Settings<p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/SrtDestinationSettings">AWS
* API Reference</a></p>
*/
class AWS_MEDIACONVERT_API SrtDestinationSettings
{
public:
SrtDestinationSettings();
SrtDestinationSettings(Aws::Utils::Json::JsonView jsonValue);
SrtDestinationSettings& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* Choose Enabled (ENABLED) to have MediaConvert use the font style, color, and
* position information from the captions source in the input. Keep the default
* value, Disabled (DISABLED), for simplified output captions.
*/
inline const SrtStylePassthrough& GetStylePassthrough() const{ return m_stylePassthrough; }
/**
* Choose Enabled (ENABLED) to have MediaConvert use the font style, color, and
* position information from the captions source in the input. Keep the default
* value, Disabled (DISABLED), for simplified output captions.
*/
inline bool StylePassthroughHasBeenSet() const { return m_stylePassthroughHasBeenSet; }
/**
* Choose Enabled (ENABLED) to have MediaConvert use the font style, color, and
* position information from the captions source in the input. Keep the default
* value, Disabled (DISABLED), for simplified output captions.
*/
inline void SetStylePassthrough(const SrtStylePassthrough& value) { m_stylePassthroughHasBeenSet = true; m_stylePassthrough = value; }
/**
* Choose Enabled (ENABLED) to have MediaConvert use the font style, color, and
* position information from the captions source in the input. Keep the default
* value, Disabled (DISABLED), for simplified output captions.
*/
inline void SetStylePassthrough(SrtStylePassthrough&& value) { m_stylePassthroughHasBeenSet = true; m_stylePassthrough = std::move(value); }
/**
* Choose Enabled (ENABLED) to have MediaConvert use the font style, color, and
* position information from the captions source in the input. Keep the default
* value, Disabled (DISABLED), for simplified output captions.
*/
inline SrtDestinationSettings& WithStylePassthrough(const SrtStylePassthrough& value) { SetStylePassthrough(value); return *this;}
/**
* Choose Enabled (ENABLED) to have MediaConvert use the font style, color, and
* position information from the captions source in the input. Keep the default
* value, Disabled (DISABLED), for simplified output captions.
*/
inline SrtDestinationSettings& WithStylePassthrough(SrtStylePassthrough&& value) { SetStylePassthrough(std::move(value)); return *this;}
private:
SrtStylePassthrough m_stylePassthrough;
bool m_stylePassthroughHasBeenSet;
};
} // namespace Model
} // namespace MediaConvert
} // namespace Aws
|
/*
* Copyright (c) 2016 Nordic Semiconductor ASA
* Copyright (c) 2016 Vinayak Kariappa Chettimada
*
* 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 _UTIL_H_
#define _UTIL_H_
uint8_t util_ones_count_get(uint8_t *octets, uint8_t octets_len);
#endif
|
/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license that can
* be found in the License.html file in the root of the source tree.
*/
//---------------------------------------------------------------------------
#ifndef File__ReferenceFilesHelperH
#define File__ReferenceFilesHelperH
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include "MediaInfo/File__Analyze.h"
#include "MediaInfo/MediaInfo_Internal.h"
#include <vector>
//---------------------------------------------------------------------------
namespace MediaInfoLib
{
//***************************************************************************
// Class File__ReferenceFilesHelper
//***************************************************************************
class File__ReferenceFilesHelper
{
public :
//In
struct reference
{
ZtringList FileNames;
Ztring Source; //Source file name (relative path)
stream_t StreamKind;
size_t StreamPos;
size_t MenuPos;
int64u StreamID;
float64 FrameRate;
int64u Delay;
int64u FileSize;
bool IsCircular;
bool IsMain;
#if MEDIAINFO_ADVANCED || MEDIAINFO_MD5
bool List_Compute_Done;
#endif //MEDIAINFO_ADVANCED || MEDIAINFO_MD5
size_t State;
std::map<std::string, Ztring> Infos;
MediaInfo_Internal* MI;
struct completeduration
{
Ztring FileName;
MediaInfo_Internal* MI;
#if MEDIAINFO_DEMUX
int64u Demux_Offset_Frame;
int64u Demux_Offset_DTS;
int64u Demux_Offset_FileSize;
#endif //MEDIAINFO_DEMUX
completeduration()
{
MI=NULL;
#if MEDIAINFO_DEMUX
Demux_Offset_Frame=0;
Demux_Offset_DTS=0;
Demux_Offset_FileSize=0;
#endif //MEDIAINFO_DEMUX
}
~completeduration()
{
delete MI;
}
};
vector<completeduration*> CompleteDuration;
size_t CompleteDuration_Pos;
#if MEDIAINFO_FILTER
int64u Enabled;
#endif //MEDIAINFO_FILTER
std::bitset<32> Status;
#if MEDIAINFO_NEXTPACKET && MEDIAINFO_IBI
ibi::stream IbiStream;
#endif //MEDIAINFO_NEXTPACKET && MEDIAINFO_IBI
reference()
{
FileNames.Separator_Set(0, __T(","));
StreamKind=Stream_Max;
StreamPos=(size_t)-1;
MenuPos=(size_t)-1;
StreamID=(int64u)-1;
FrameRate=0;
Delay=0;
FileSize=(int64u)-1;
IsCircular=false;
IsMain=false;
#if MEDIAINFO_ADVANCED || MEDIAINFO_MD5
List_Compute_Done=false;
#endif //MEDIAINFO_ADVANCED || MEDIAINFO_MD5
State=0;
MI=NULL;
CompleteDuration_Pos=0;
#if MEDIAINFO_FILTER
Enabled=true;
#endif //MEDIAINFO_FILTER
}
~reference()
{
for (size_t Pos=0; Pos<CompleteDuration.size(); Pos++)
delete CompleteDuration[Pos]; //CompleteDuration[Pos]=NULL;
}
};
typedef std::vector<reference> references;
references References;
bool TestContinuousFileNames;
bool FilesForStorage;
bool ContainerHasNoId;
bool HasMainFile;
bool HasMainFile_Filled;
int64u ID_Max;
//Streams management
bool ParseReference_Init();
void ParseReferences();
//Constructor / Destructor
File__ReferenceFilesHelper(File__Analyze* MI, MediaInfo_Config_MediaInfo* Config);
~File__ReferenceFilesHelper();
#if MEDIAINFO_SEEK
size_t Read_Buffer_Seek (size_t Method, int64u Value, int64u ID);
#endif //MEDIAINFO_SEEK
private :
//Streams management
void ParseReference ();
void ParseReference_Finalize ();
void ParseReference_Finalize_PerStream ();
void Open_Buffer_Unsynch() {Read_Buffer_Unsynched();}
//Buffer - Global
void Read_Buffer_Unsynched();
//temp
File__Analyze* MI;
MediaInfo_Config_MediaInfo* Config;
references::iterator Reference;
bool Init_Done;
bool Demux_Interleave;
size_t CountOfReferencesToParse;
float64 FrameRate;
float64 Duration;
stream_t StreamKind_Last;
size_t StreamPos_From;
size_t StreamPos_To;
#if MEDIAINFO_NEXTPACKET
int64u DTS_Minimal;
int64u DTS_Interval;
#endif //MEDIAINFO_NEXTPACKET
//Helpers
size_t Stream_Prepare(stream_t StreamKind, size_t StreamPos=(size_t)-1);
void FileSize_Compute();
MediaInfo_Internal* MI_Create();
#if MEDIAINFO_ADVANCED || MEDIAINFO_MD5
void List_Compute();
#endif //MEDIAINFO_ADVANCED || MEDIAINFO_MD5
#if MEDIAINFO_EVENTS
void SubFile_Start();
int64u StreamID_Previous;
#endif //MEDIAINFO_EVENTS
#if MEDIAINFO_DEMUX
int64u Offset_Video_DTS;
#endif //MEDIAINFO_DEMUX
};
} //NameSpace
#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/cloudfront/CloudFront_EXPORTS.h>
#include <aws/core/AmazonSerializableWebServiceRequest.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <aws/core/http/HttpRequest.h>
namespace Aws
{
namespace CloudFront
{
class AWS_CLOUDFRONT_API CloudFrontRequest : public AmazonSerializableWebServiceRequest
{
public:
virtual ~CloudFrontRequest () {}
virtual Aws::String SerializePayload() const override = 0;
void AddParametersToRequest(Aws::Http::HttpRequest& httpRequest) const { AWS_UNREFERENCED_PARAM(httpRequest); }
inline Aws::Http::HeaderValueCollection GetHeaders() const override
{
auto headers = GetRequestSpecificHeaders();
if(headers.size() == 0 || (headers.size() > 0 && headers.count(Aws::Http::CONTENT_TYPE_HEADER) == 0))
{
headers.insert(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, AMZN_XML_CONTENT_TYPE ));
}
return headers;
}
protected:
virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); }
};
} // namespace CloudFront
} // namespace Aws
|
/*
Copyright 2008 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GGADGET_CLUTTER_KEY_CONVERT_H__
#define GGADGET_CLUTTER_KEY_CONVERT_H__
#include <glib.h>
namespace ggadget {
namespace clutter {
/**
* @ingroup GtkLibrary
* @{
*/
/**
* Convert a Clutter keyval to a key code accepted by @c ggadget::KeyboardEvent
* whose type is @c ggadget::Event::EVENT_KEY_DOWN or
* @c ggadget::Event::EVENT_KEY_UP).
*/
unsigned int ConvertClutterKeyvalToKeyCode(guint keyval);
/**
* Convert a ClutterModifierType to a value understood by the modifier fields in
* Event classes.
*/
int ConvertClutterModifierToModifier(guint state);
/**
* Convert a ClutterModifierType to a value understood by the button fields in
* Event classes.
*/
int ConvertClutterModifierToButton(guint state);
/** @} */
} // namespace clutter
} // namespace ggadget
#endif // GGADGET_CLUTTER_KEY_CONVERT_H__
|
#pragma once
#include <memory>
#include <BWAPI.h>
#include "Common.h"
namespace BlackCrow {
class BlackCrow;
class ScoutSquad;
class AttackSquad;
class Base;
class Army {
public:
Army(BlackCrow &blackrow);
void onStart();
void onFrame();
// Variables
std::vector<SquadUnitPtr> sunits;
std::vector<SquadPtr> squads;
// Functions
void onUnitCreated(BWAPI::Unit unit);
void onUnitDestroyed(BWAPI::Unit unit);
SquadUnitPtr& addToArmy(BWAPI::Unit unit);
void releaseFromArmy(SquadUnitPtr& sunit);
SquadUnitPtr findSquadUnit(BWAPI::Unit unit);
void assignToSquad(SquadUnitPtr& sunit);
void startInitialScout();
void workerUnderAttack(WorkerPtr& worker, Base& base);
private:
BlackCrow &bc;
void runSquadsAndUnits();
SquadPtr& createSquad();
SquadPtr& getOrCreateSquadIfNoneExist();
};
}
|
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
HDC hDC = GetDC(GetConsoleWindow());
HPEN Pen = CreatePen( PS_SOLID, 2, RGB(255, 255, 255));
SelectObject( hDC, Pen );
MoveToEx( hDC, 20, 50, NULL );
LineTo( hDC, 100, 50 );
MoveToEx( hDC, 20, 60, NULL );
LineTo( hDC, 100, 60 );
system("pause");
return 0;
}
#include <stdlib.h>
#include <windows.h>
//#include <iostream>
#define _WIN32_WINNT 0x0500
int main()
{
HDC hDC = GetDC(GetConsoleWindow());
HPEN Pen = CreatePen( PS_SOLID, 2, RGB(255, 255, 255));
SelectObject( hDC, Pen );
MoveToEx( hDC, 20, 50, NULL );
LineTo( hDC, 100, 50 );
MoveToEx( hDC, 20, 60, NULL );
LineTo( hDC, 100, 60 );
system("pause");
return 0;
}
|
//
// XWPlaceholderTextView.h
// Spread
//
// Created by 邱学伟 on 16/4/18.
// Copyright © 2016年 邱学伟. All rights reserved.
// 有占位文字的UITextView
#import <UIKit/UIKit.h>
@interface XWPlaceholderTextView : UITextView
/**
* 占位文字
* 我们将根据您反馈的意见和问题, 提升产品的体验感!
*/
@property (nonatomic, copy) NSString *placeholderStr;
/**
* 工厂方法
*
* @param frame textView的尺寸
* @param placeholderStr 占位文字
*/
+(instancetype)shareWithFrame:(CGRect)frame withPlaceholder:(NSString *)placeholderStr;
/**
* 初始化
*/
-(instancetype)initWithFrame:(CGRect)frame withPlaceholder:(NSString *)placeholderStr;
@end
|
#ifndef STATION_H
#define STATION_H
class Station {
char *name;
public:
Station(const char* ptr);
char* getName();
char* getName() const;
void printName();
bool operator<(const Station &rhs) const;
bool operator==(const Station &rhs) const;
bool operator!=(const Station &rhs) const;
};
#endif
|
//
// ViewController.h
// LCEiTimerDiary
//
// Created by 妖狐小子 on 2017/9/26.
// Copyright © 2017年 妖狐小子. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
// Copyright 2020 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MEDIAPIPE_FACE_GEOMETRY_LIBS_GEOMETRY_PIPELINE_H_
#define MEDIAPIPE_FACE_GEOMETRY_LIBS_GEOMETRY_PIPELINE_H_
#include <memory>
#include <vector>
#include "mediapipe/framework/formats/landmark.pb.h"
#include "mediapipe/framework/port/statusor.h"
#include "mediapipe/modules/face_geometry/protos/environment.pb.h"
#include "mediapipe/modules/face_geometry/protos/face_geometry.pb.h"
#include "mediapipe/modules/face_geometry/protos/geometry_pipeline_metadata.pb.h"
namespace mediapipe::face_geometry {
// Encapsulates a stateless estimator of facial geometry in a Metric space based
// on the normalized face landmarks in the Screen space.
class GeometryPipeline {
public:
virtual ~GeometryPipeline() = default;
// Estimates geometry data for multiple faces.
//
// Returns an error status if any of the passed arguments is invalid.
//
// The result includes face geometry data for a subset of the input faces,
// however geometry data for some faces might be missing. This may happen if
// it'd be unstable to estimate the facial geometry based on a corresponding
// face landmark list for any reason (for example, if the landmark list is too
// compact).
//
// Each face landmark list must have the same number of landmarks as was
// passed upon initialization via the canonical face mesh (as a part of the
// geometry pipeline metadata).
//
// Both `frame_width` and `frame_height` must be positive.
virtual absl::StatusOr<std::vector<FaceGeometry>> EstimateFaceGeometry(
const std::vector<NormalizedLandmarkList>& multi_face_landmarks,
int frame_width, int frame_height) const = 0;
};
// Creates an instance of `GeometryPipeline`.
//
// Both `environment` and `metadata` must be valid (for details, please refer to
// the proto message definition comments and/or `validation_utils.h/cc`).
//
// Canonical face mesh (defined as a part of `metadata`) must have the
// `POSITION` and the `TEX_COORD` vertex components.
absl::StatusOr<std::unique_ptr<GeometryPipeline>> CreateGeometryPipeline(
const Environment& environment, const GeometryPipelineMetadata& metadata);
} // namespace mediapipe::face_geometry
#endif // MEDIAPIPE_FACE_GEOMETRY_LIBS_GEOMETRY_PIPELINE_H_
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2011 by BgooAppi, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#if defined(USE_TI_XML) || defined(USE_TI_NETWORK)
#import "TiProxy.h"
#import "GDataXMLNode.h"
@interface TIDOMDOMImplementation : TiProxy {
}
@end
#endif
|
#ifndef WEBGLPROGRAM_H
#define WEBGLPROGRAM_H
#include <napi.h>
#include <GL/gl.h>
namespace NodeBinding
{
class WebGLProgram : public Napi::ObjectWrap<WebGLProgram>
{
public:
WebGLProgram(const Napi::CallbackInfo &info);
static void Init(Napi::Env env);
static Napi::Object NewInstance(Napi::Env env, const Napi::Value arg);
inline GLuint getId() const { return mId; }
private:
GLuint mId = 0;
static Napi::FunctionReference constructor;
};
} // namespace NodeBinding
#endif
|
#ifndef PointTreeModel_H
#define PointTreeModel_H
#include <QAbstractItemModel>
#include <QModelIndex>
#include <QVariant>
class PointTreeItem;
class PointTreeModel : public QAbstractItemModel
{
Q_OBJECT
public:
PointTreeModel(const QStringList &headers, const QString &data, QObject *parent = 0);
~PointTreeModel();
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole);
bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());
bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());
private:
void setupModelData(const QStringList &lines, PointTreeItem *parent);
PointTreeItem *getItem(const QModelIndex &index) const;
PointTreeItem *rootItem;
};
#endif
|
void func(int a[], float b[])
{
assert(a[0] == -1, "a[0] must be -1");
assert(a[1] == -2, "a[1] must be -2");
assert(a[2] == -3, "a[2] must be -3");
assert(b[0] == 0.000000, "b[0] must be 0.000000");
assert(b[1] == 0.000000, "b[1] must be 0.000000");
}
void main()
{
func({ -1, -2, -3 }, { 0, 0 });
}
|
#ifndef LOCATION_H_
#define LOCATION_H_
#include <ostream>
/*
struct for representing locations in the grid.
*/
struct Location
{
int row, col;
Location()
{
row = col = 0;
}
Location(int r, int c)
{
row = r;
col = c;
}
bool operator==(const Location & o) const {
return row == o.row && col == o.col;
}
bool operator!=(const Location & o) const {return !(*this == o);}
};
inline std::ostream & operator<<(std::ostream & out, const Location & loc) {
return out << loc.row << ", " << loc.col;
}
#endif //LOCATION_H_
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2011 by CardPuller, 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>
#import "TiProxy.h"
#import "TiBlob.h"
// TODO: Support array-style access of bytes
/**
The class represents a buffer of bytes.
*/
@interface TiBuffer : TiProxy {
NSMutableData* data;
NSNumber* byteOrder;
}
/**
Provides access to raw data.
*/
@property(nonatomic, retain) NSMutableData* data;
// Public API
-(NSNumber*)append:(id)args;
-(NSNumber*)insert:(id)args;
-(NSNumber*)copy:(id)args;
-(TiBuffer*)clone:(id)args;
-(void)fill:(id)args;
-(void)clear:(id)_void;
-(void)release:(id)_void;
-(TiBlob*)toBlob:(id)_void;
-(NSString*)toString:(id)_void;
/**
Provides access to the buffer length.
*/
@property(nonatomic,assign) NSNumber* length;
/**
Provides access to the data byte order.
The byte order values are: 1 - little-endian, 2 - big-endian.
*/
@property(nonatomic,retain) NSNumber* byteOrder;
// SPECIAL NOTES:
// Ti.Buffer objects have an 'overloaded' Ti.Buffer[x] operation for x==int (making them behave like arrays).
// See the code for how this works.
@end
|
/*Copyright 2015 Huawei Technologies Co., Ltd. All rights reserved.
eSDK is 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
// Including SDKDDKVer.h defines the highest available Windows platform.
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
#include <SDKDDKVer.h>
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/s3/S3_EXPORTS.h>
#include <aws/s3/model/StorageClassAnalysisDataExport.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace S3
{
namespace Model
{
class AWS_S3_API StorageClassAnalysis
{
public:
StorageClassAnalysis();
StorageClassAnalysis(const Aws::Utils::Xml::XmlNode& xmlNode);
StorageClassAnalysis& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
/**
* <p>A container used to describe how data related to the storage class analysis
* should be exported.</p>
*/
inline const StorageClassAnalysisDataExport& GetDataExport() const{ return m_dataExport; }
/**
* <p>A container used to describe how data related to the storage class analysis
* should be exported.</p>
*/
inline void SetDataExport(const StorageClassAnalysisDataExport& value) { m_dataExportHasBeenSet = true; m_dataExport = value; }
/**
* <p>A container used to describe how data related to the storage class analysis
* should be exported.</p>
*/
inline void SetDataExport(StorageClassAnalysisDataExport&& value) { m_dataExportHasBeenSet = true; m_dataExport = std::move(value); }
/**
* <p>A container used to describe how data related to the storage class analysis
* should be exported.</p>
*/
inline StorageClassAnalysis& WithDataExport(const StorageClassAnalysisDataExport& value) { SetDataExport(value); return *this;}
/**
* <p>A container used to describe how data related to the storage class analysis
* should be exported.</p>
*/
inline StorageClassAnalysis& WithDataExport(StorageClassAnalysisDataExport&& value) { SetDataExport(std::move(value)); return *this;}
private:
StorageClassAnalysisDataExport m_dataExport;
bool m_dataExportHasBeenSet;
};
} // namespace Model
} // namespace S3
} // namespace Aws
|
#include <stdio.h>
#include <psec/encode.h>
#include <psec/hash.h>
#include <psec/kdf.h>
int main(void) {
unsigned char pass[] = "test";
unsigned char salt[] = "1234";
unsigned char digest[HASH_DIGEST_SIZE_TIGER2], encoded_digest[(HASH_DIGEST_SIZE_TIGER2 * 2) + 1];
int rounds = 10;
size_t out_len = 0;
kdf_pbkdf2_tiger2(digest, pass, sizeof(pass) - 1, salt, sizeof(salt) - 1, rounds, HASH_DIGEST_SIZE_TIGER2);
encode_buffer_base16(encoded_digest, &out_len, digest, HASH_DIGEST_SIZE_TIGER2);
puts((char *) encoded_digest);
return 0;
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/shield/Shield_EXPORTS.h>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace Shield
{
namespace Model
{
/**
* <p>Specifies that Shield Advanced should configure its WAF rules with the WAF
* <code>Block</code> action. </p> <p>This is only used in the context of the
* <code>ResponseAction</code> setting. </p> <p>JSON specification: <code>"Block":
* {}</code> </p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/BlockAction">AWS
* API Reference</a></p>
*/
class AWS_SHIELD_API BlockAction
{
public:
BlockAction();
BlockAction(Aws::Utils::Json::JsonView jsonValue);
BlockAction& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
};
} // namespace Model
} // namespace Shield
} // namespace Aws
|
#pragma once
class DialogDirector;
class MouseEvent;
class Widget
{
public:
Widget(DialogDirector *){};
virtual void Changed();
virtual void HandleMouse(MouseEvent &event);
private:
DialogDirector *_dorector;
};
|
/*!The Treasure Box Library
*
* 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.
*
* Copyright (C) 2009 - 2019, TBOOX Open Source Group.
*
* @author ruki
* @file obj.c
* @ingroup container
*/
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "prefix.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* implementation
*/
static tb_char_t const* tb_element_obj_cstr(tb_element_ref_t element, tb_cpointer_t data, tb_char_t* cstr, tb_size_t maxn)
{
// check
tb_assert_and_check_return_val(cstr, "");
// format string
tb_long_t n = tb_snprintf(cstr, maxn, "<object: %p>", data);
if (n >= 0 && n < (tb_long_t)maxn) cstr[n] = '\0';
// ok?
return (tb_char_t const*)cstr;
}
static tb_void_t tb_element_obj_free(tb_element_ref_t element, tb_pointer_t buff)
{
// check
tb_assert_and_check_return(element && buff);
// exit
tb_object_ref_t object = *((tb_object_ref_t*)buff);
if (object)
{
tb_object_exit(object);
*((tb_object_ref_t*)buff) = tb_null;
}
}
static tb_void_t tb_element_obj_dupl(tb_element_ref_t element, tb_pointer_t buff, tb_cpointer_t data)
{
// check
tb_assert_and_check_return(element && buff);
// refn++
if (data) tb_object_retain((tb_object_ref_t)data);
// copy it
*((tb_cpointer_t*)buff) = data;
}
static tb_void_t tb_element_obj_repl(tb_element_ref_t element, tb_pointer_t buff, tb_cpointer_t data)
{
// check
tb_assert_and_check_return(element && buff);
// save the previous object
tb_object_ref_t object = *((tb_object_ref_t*)buff);
// refn++
if (data) tb_object_retain((tb_object_ref_t)data);
// copy it
*((tb_cpointer_t*)buff) = data;
// refn--
if (object) tb_object_exit(object);
}
/* //////////////////////////////////////////////////////////////////////////////////////
* interfaces
*/
tb_element_t tb_element_obj()
{
// the ptr element
tb_element_t element_ptr = tb_element_ptr(tb_null, tb_null);
// the str element
tb_element_t element_str = tb_element_str(tb_true);
// init element
tb_element_t element = {0};
element.type = TB_ELEMENT_TYPE_OBJ;
element.flag = 0;
element.hash = element_ptr.hash;
element.comp = element_ptr.comp;
element.data = element_ptr.data;
element.cstr = tb_element_obj_cstr;
element.free = tb_element_obj_free;
element.dupl = tb_element_obj_dupl;
element.repl = tb_element_obj_repl;
element.copy = element_ptr.copy;
element.nfree = element_str.nfree;
element.ndupl = element_str.ndupl;
element.nrepl = element_str.nrepl;
element.ncopy = element_ptr.ncopy;
element.size = sizeof(tb_object_ref_t);
// ok?
return element;
}
|
/*
* File: ASTDropDoc.h
* Copyright (C) 2009 The Institute for System Programming of the Russian Academy of Sciences (ISP RAS)
*/
#ifndef _AST_DROP_DOC_H_
#define _AST_DROP_DOC_H_
#include "ASTNode.h"
class ASTVisitor;
class ASTDropDoc : public ASTNode
{
public:
ASTNode *doc, *coll;
public:
ASTDropDoc(const ASTNodeCommonData &loc, ASTNode *doc_, ASTNode *coll_ = NULL) : ASTNode(loc), doc(doc_), coll(coll_) {}
~ASTDropDoc();
void accept(ASTVisitor &v);
ASTNode *dup();
void modifyChild(const ASTNode *oldc, ASTNode *newc);
static ASTNode *createNode(scheme_list &sl);
};
#endif
|
#pragma once
#include "../ui_widget.h"
#include "halley/core/graphics/text/text_renderer.h"
#include <climits>
#include "halley/text/i18n.h"
#include "halley/concurrency/future.h"
namespace Halley {
class UILabel : public UIWidget {
public:
explicit UILabel(String id, UIStyle style, LocalisedString text);
explicit UILabel(String id, UIStyle style, TextRenderer renderer, LocalisedString text);
~UILabel();
void setText(const LocalisedString& text);
void setText(LocalisedString&& text);
void setFutureText(Future<String> text);
void setColourOverride(const Vector<ColourOverride>& overrides);
void setMaxWidth(float maxWidth);
void setMaxHeight(float maxHeight);
float getMaxWidth() const;
float getMaxHeight() const;
void setWordWrapped(bool wrapped);
bool isWordWrapped() const;
bool isClipped() const;
void setMarquee(bool enabled);
void setFlowLayout(bool flow);
void setAlignment(float alignment);
void setTextRenderer(TextRenderer renderer);
TextRenderer& getTextRenderer();
const TextRenderer& getTextRenderer() const;
void setColour(Colour4f colour);
Colour4f getColour() const;
void setSelectable(TextRenderer normalRenderer, TextRenderer selectedRenderer);
void setDisablable(TextRenderer normalRenderer, TextRenderer disabledRenderer);
void setHoverable(TextRenderer normalRenderer, TextRenderer hoveredRenderer);
void draw(UIPainter& painter) const override;
void update(Time t, bool moved) override;
protected:
void onParentChanged() override;
private:
TextRenderer renderer;
LocalisedString text;
const std::shared_ptr<bool> aliveFlag;
Vector2f textExtents;
float maxWidth = std::numeric_limits<float>::infinity();
float maxHeight = std::numeric_limits<float>::infinity();
bool wordWrapped = true;
bool needsClip = false;
bool marquee = false;
bool flowLayout = false;
Time marqueeIdle;
int marqueeDirection = -1;
float marqueePos = 0;
float unclippedWidth;
float lastCellWidth;
void updateMinSize();
void updateText();
void updateMarquee(Time t);
float getCellWidth();
};
}
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2013 Zynga Inc.
* Copyright 2011 Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef COMMAND_IDS_H
#define COMMAND_IDS_H 1
#define CMD_STOP_PERSISTENCE 0x80
#define CMD_START_PERSISTENCE 0x81
#define CMD_SET_FLUSH_PARAM 0x82
/* The following commands are used by bucket engine:
#define CREATE_BUCKET 0x85
#define DELETE_BUCKET 0x86
#define LIST_BUCKETS 0x87
#define EXPAND_BUCKET 0x88
#define SELECT_BUCKET 0x89
*/
#define CMD_START_REPLICATION 0x90
#define CMD_STOP_REPLICATION 0x91
#define CMD_SET_TAP_PARAM 0x92
#define CMD_EVICT_KEY 0x93
#define CMD_GET_LOCKED 0x94
#define CMD_UNLOCK_KEY 0x95
#define CMD_SYNC 0x96
/**
* Return the last closed checkpoint Id for a given VBucket.
*/
#define CMD_LAST_CLOSED_CHECKPOINT 0x97
/**
* Start restoring a <b>single</b> incremental backup file specified in the
* key field of the packet.
* The server will return the following error codes:
* <ul>
* <li>PROTOCOL_BINARY_RESPONSE_SUCCESS if the restore process is started</li>
* <li>PROTOCOL_BINARY_RESPONSE_KEY_ENOENT if the backup file couldn't be found</li>
* <li>PROTOCOL_BINARY_RESPONSE_AUTH_ERROR if the user isn't admin (not implemented)</li>
* <li>PROTOCOL_BINARY_RESPONSE_NOT_SUPPORTED if the server isn't in restore mode</li>
* <li>PROTOCOL_BINARY_RESPONSE_EINTERNAL with a description what went wrong</li>
* </ul>
*
*/
#define CMD_RESTORE_FILE 0x98
/**
* Try to abort the current restore as soon as possible. The server
* <em>may</em> want to continue to process an unknown number of elements
* before aborting (or even complete the full restore). The server will
* <b>always</b> return with PROTOCOL_BINARY_RESPONSE_SUCCESS even if the
* server isn't running in restore mode without any restore jobs running.
*/
#define CMD_RESTORE_ABORT 0x99
/**
* Notify the server that we're done restoring data, so it may transition
* from restore mode to fully operating mode.
* The server always returns PROTOCOL_BINARY_RESPONSE_SUCCESS
*/
#define CMD_RESTORE_COMPLETE 0x9a
/**
* Start online update, all mutations won't be persisted to disk
* The server will return the following error codes:
* <ul>
* <li>PROTOCOL_BINARY_RESPONSE_SUCCESS if the online update process is started</li>
* <li>PROTOCOL_BINARY_RESPONSE_NOT_SUPPORTED if the server is in online update mode already</li>
* </ul>
*
*/
#define CMD_ONLINE_UPDATE_START 0x9b
/**
* Complete online update, all queued mutations will be persisted again
* The server will return the following error codes:
* <ul>
* <li>PROTOCOL_BINARY_RESPONSE_SUCCESS if the online update process is done</li>
* <li>PROTOCOL_BINARY_RESPONSE_NOT_SUPPORTED if the server is NOT in online update mode</li>
* </ul>
*
*/
#define CMD_ONLINE_UPDATE_COMPLETE 0x9c
/**
* Revert online update, all queued mutations will be discarded
* The server will return the following error codes:
* <ul>
* <li>PROTOCOL_BINARY_RESPONSE_SUCCESS if the online update process is reverted</li>
* <li>PROTOCOL_BINARY_RESPONSE_NOT_SUPPORTED if the server is NOT in online update mode</li>
* </ul>
*
*/
#define CMD_ONLINE_UPDATE_REVERT 0x9d
/**
* Close the TAP connection for the registered TAP client and remove the
* checkpoint cursors from its registered vbuckets.
*/
#define CMD_DEREGISTER_TAP_CLIENT 0x9e
/**
* Reset the replication chain from the node that receives this command. For example, given
* the replication chain, A->B->C, if A receives this command, it will reset all the replica
* vbuckets on B and C, which are replicated from A.
*/
#define CMD_RESET_REPLICATION_CHAIN 0x9f
#define CMD_DI_OPTIONS 0xa0
/*
* IDs for the events of the SYNC command.
*/
#define SYNC_PERSISTED_EVENT 1
#define SYNC_MODIFIED_EVENT 2
#define SYNC_DELETED_EVENT 3
#define SYNC_REPLICATED_EVENT 4
#define SYNC_INVALID_KEY 5
#define SYNC_INVALID_CAS 6
typedef protocol_binary_request_gat protocol_binary_request_getl;
#endif /* COMMAND_IDS_H */
|
#pragma once
#include "envoy/api/v2/discovery.pb.h"
#include "envoy/config/grpc_mux.h"
#include "envoy/config/subscription.h"
#include "common/common/assert.h"
#include "common/common/logger.h"
#include "common/grpc/common.h"
#include "common/protobuf/protobuf.h"
#include "common/protobuf/utility.h"
namespace Envoy {
namespace Config {
/**
* Adapter from typed Subscription to untyped GrpcMux. Also handles per-xDS API stats/logging.
*/
template <class ResourceType>
class GrpcMuxSubscriptionImpl : public Subscription<ResourceType>,
GrpcMuxCallbacks,
Logger::Loggable<Logger::Id::config> {
public:
GrpcMuxSubscriptionImpl(GrpcMux& grpc_mux, SubscriptionStats stats)
: grpc_mux_(grpc_mux), stats_(stats),
type_url_(Grpc::Common::typeUrl(ResourceType().GetDescriptor()->full_name())) {}
// Config::Subscription
void start(const std::vector<std::string>& resources,
SubscriptionCallbacks<ResourceType>& callbacks) override {
callbacks_ = &callbacks;
watch_ = grpc_mux_.subscribe(type_url_, resources, *this);
// The attempt stat here is maintained for the purposes of having consistency between ADS and
// gRPC/filesystem/REST Subscriptions. Since ADS is push based and muxed, the notion of an
// "attempt" for a given xDS API combined by ADS is not really that meaningful.
stats_.update_attempt_.inc();
}
void updateResources(const std::vector<std::string>& resources) override {
watch_ = grpc_mux_.subscribe(type_url_, resources, *this);
stats_.update_attempt_.inc();
}
// Config::GrpcMuxCallbacks
void onConfigUpdate(const Protobuf::RepeatedPtrField<ProtobufWkt::Any>& resources,
const std::string& version_info) override {
Protobuf::RepeatedPtrField<ResourceType> typed_resources;
std::transform(resources.cbegin(), resources.cend(),
Protobuf::RepeatedPtrFieldBackInserter(&typed_resources),
MessageUtil::anyConvert<ResourceType>);
// TODO(mattklein123): In the future if we start tracking per-resource versions, we need to
// supply those versions to onConfigUpdate() along with the xDS response ("system")
// version_info. This way, both types of versions can be tracked and exposed for debugging by
// the configuration update targets.
callbacks_->onConfigUpdate(typed_resources, version_info);
stats_.update_success_.inc();
stats_.update_attempt_.inc();
stats_.version_.set(HashUtil::xxHash64(version_info));
ENVOY_LOG(debug, "gRPC config for {} accepted with {} resources: {}", type_url_,
resources.size(), RepeatedPtrUtil::debugString(typed_resources));
}
void onConfigUpdateFailed(const EnvoyException* e) override {
// TODO(htuch): Less fragile signal that this is failure vs. reject.
if (e == nullptr) {
stats_.update_failure_.inc();
ENVOY_LOG(warn, "gRPC update for {} failed", type_url_);
} else {
stats_.update_rejected_.inc();
ENVOY_LOG(warn, "gRPC config for {} rejected: {}", type_url_, e->what());
}
stats_.update_attempt_.inc();
callbacks_->onConfigUpdateFailed(e);
}
std::string resourceName(const ProtobufWkt::Any& resource) override {
return callbacks_->resourceName(resource);
}
private:
GrpcMux& grpc_mux_;
SubscriptionStats stats_;
const std::string type_url_;
SubscriptionCallbacks<ResourceType>* callbacks_{};
GrpcMuxWatchPtr watch_{};
};
} // namespace Config
} // namespace Envoy
|
/********************************************************************************
** Form generated from reading UI file 'configdlg.ui'
**
** Created: Wed Oct 21 15:22:21 2015
** by: Qt User Interface Compiler version 4.8.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_CONFIGDLG_H
#define UI_CONFIGDLG_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QDialog>
#include <QtGui/QHeaderView>
#include <QtGui/QSlider>
QT_BEGIN_NAMESPACE
class Ui_ConfigDlg
{
public:
QSlider *horizontalSlider;
void setupUi(QDialog *ConfigDlg)
{
if (ConfigDlg->objectName().isEmpty())
ConfigDlg->setObjectName(QString::fromUtf8("ConfigDlg"));
ConfigDlg->resize(400, 300);
horizontalSlider = new QSlider(ConfigDlg);
horizontalSlider->setObjectName(QString::fromUtf8("horizontalSlider"));
horizontalSlider->setGeometry(QRect(140, 160, 160, 19));
horizontalSlider->setOrientation(Qt::Horizontal);
retranslateUi(ConfigDlg);
QMetaObject::connectSlotsByName(ConfigDlg);
} // setupUi
void retranslateUi(QDialog *ConfigDlg)
{
ConfigDlg->setWindowTitle(QApplication::translate("ConfigDlg", "ConfigDlg", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class ConfigDlg: public Ui_ConfigDlg {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_CONFIGDLG_H
|
/* Copyright (c) 2010, 2011, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef CFM_H
#define CFM_H 1
#include <stdint.h>
#include "hmap.h"
#include "openvswitch/types.h"
#include "packets.h"
struct flow;
struct dp_packet;
struct netdev;
struct flow_wildcards;
#define CFM_RANDOM_VLAN UINT16_MAX
#define CFM_FAULT_REASONS \
CFM_FAULT_REASON(RECV, recv) \
CFM_FAULT_REASON(RDI, rdi) \
CFM_FAULT_REASON(MAID, maid) \
CFM_FAULT_REASON(LOOPBACK, loopback) \
CFM_FAULT_REASON(OVERFLOW, overflow) \
CFM_FAULT_REASON(OVERRIDE, override)
enum cfm_fault_bit_index {
#define CFM_FAULT_REASON(NAME, STR) CFM_FAULT_INDEX_##NAME,
CFM_FAULT_REASONS
#undef CFM_FAULT_REASON
CFM_FAULT_N_REASONS
};
enum cfm_fault_reason {
#define CFM_FAULT_REASON(NAME, STR) \
CFM_FAULT_##NAME = 1 << CFM_FAULT_INDEX_##NAME,
CFM_FAULT_REASONS
#undef CFM_FAULT_REASON
};
struct cfm_settings {
uint64_t mpid; /* The MPID of this CFM. */
int interval; /* The requested transmission interval. */
bool extended; /* Run in extended mode. */
bool demand; /* Run in demand mode. */
bool opup; /* Operational State. */
uint16_t ccm_vlan; /* CCM Vlan tag. Zero if none.
CFM_RANDOM_VLAN if random. */
uint8_t ccm_pcp; /* CCM Priority. Zero if none. */
bool check_tnl_key; /* Verify inbound packet key? */
};
/* CFM status query. */
struct cfm_status {
/* 0 if not faulted, otherwise a combination of one or more reasons. */
enum cfm_fault_reason faults;
/* 0 if the remote CFM endpoint is operationally down,
* 1 if the remote CFM endpoint is operationally up,
* -1 if we don't know because the remote CFM endpoint is not in extended
* mode. */
int remote_opstate;
uint64_t flap_count;
/* Ordinarily a "health status" in the range 0...100 inclusive, with 0
* being worst and 100 being best, or -1 if the health status is not
* well-defined. */
int health;
/* MPIDs of remote maintenance points whose CCMs have been received. */
uint64_t *rmps;
size_t n_rmps;
};
void cfm_init(void);
struct cfm *cfm_create(const struct netdev *);
struct cfm *cfm_ref(const struct cfm *);
void cfm_unref(struct cfm *);
void cfm_run(struct cfm *);
bool cfm_should_send_ccm(struct cfm *);
void cfm_compose_ccm(struct cfm *, struct dp_packet *,
const uint8_t eth_src[ETH_ADDR_LEN]);
long long int cfm_wait(struct cfm *);
bool cfm_configure(struct cfm *, const struct cfm_settings *);
void cfm_set_netdev(struct cfm *, const struct netdev *);
bool cfm_should_process_flow(const struct cfm *cfm, const struct flow *,
struct flow_wildcards *);
void cfm_process_heartbeat(struct cfm *, const struct dp_packet *packet);
bool cfm_check_status_change(struct cfm *);
int cfm_get_fault(const struct cfm *);
uint64_t cfm_get_flap_count(const struct cfm *);
int cfm_get_health(const struct cfm *);
int cfm_get_opup(const struct cfm *);
void cfm_get_remote_mpids(const struct cfm *, uint64_t **rmps, size_t *n_rmps);
void cfm_get_status(const struct cfm *, struct cfm_status *);
const char *cfm_fault_reason_to_str(int fault);
long long int cfm_wake_time(struct cfm*);
#endif /* cfm.h */
|
/*
* Copyright (c) 2018 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
*
* @brief CoAP implementation for Zephyr.
*/
#ifndef ZEPHYR_INCLUDE_NET_COAP_LINK_FORMAT_SOCK_H_
#define ZEPHYR_INCLUDE_NET_COAP_LINK_FORMAT_SOCK_H_
/**
* @addtogroup coap_sock COAP Library over Sockets
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* This resource should be added before all other resources that should be
* included in the responses of the .well-known/core resource.
*/
#define COAP_WELL_KNOWN_CORE_PATH \
((const char * const[]) { ".well-known", "core", NULL })
int coap_well_known_core_get(struct coap_resource *resource,
struct coap_packet *request,
struct coap_packet *response,
u8_t *data, u16_t len);
/**
* In case you want to add attributes to the resources included in the
* 'well-known/core' "virtual" resource, the 'user_data' field should point
* to a valid coap_core_metadata structure.
*/
struct coap_core_metadata {
const char * const *attributes;
void *user_data;
};
#ifdef __cplusplus
}
#endif
/**
* @}
*/
#endif /* ZEPHYR_INCLUDE_NET_COAP_LINK_FORMAT_SOCK_H_ */
|
/*
* Copyright (c) 2005-2006 Institute for System Programming
* Russian Academy of Sciences
* 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 TA_SOCKET_NETDB_AGENT_H
#define TA_SOCKET_NETDB_AGENT_H
#include "common/agent.h"
#include <netdb.h>
/********************************************************************/
/** Agent Initialization **/
/********************************************************************/
void register_socket_netdb_commands(void);
void writeServent(TAThread thread, struct servent * se);
void writeProtoent(TAThread thread, struct protoent * pe);
void writeHostent(TAThread thread, struct hostent * he);
void writeAddrinfo(TAThread thread, struct addrinfo * ai);
/**/
#endif
|
/*
UIImage+AverageColor.h
*/
@interface UIImage (AverageColor)
- (UIColor *)facesPro_averageColor;
@end
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Volumes/Personal/Documents/raspi-config/client-framework/build/j2oSources/com/google/common/io/ByteProcessor.java
//
#include "J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_ComGoogleCommonIoByteProcessor")
#ifdef RESTRICT_ComGoogleCommonIoByteProcessor
#define INCLUDE_ALL_ComGoogleCommonIoByteProcessor 0
#else
#define INCLUDE_ALL_ComGoogleCommonIoByteProcessor 1
#endif
#undef RESTRICT_ComGoogleCommonIoByteProcessor
#if __has_feature(nullability)
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wnullability-completeness"
#endif
#if !defined (ComGoogleCommonIoByteProcessor_) && (INCLUDE_ALL_ComGoogleCommonIoByteProcessor || defined(INCLUDE_ComGoogleCommonIoByteProcessor))
#define ComGoogleCommonIoByteProcessor_
@class IOSByteArray;
@protocol ComGoogleCommonIoByteProcessor < JavaObject >
- (jboolean)processBytesWithByteArray:(IOSByteArray *)buf
withInt:(jint)off
withInt:(jint)len;
- (id)getResult;
@end
J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonIoByteProcessor)
J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonIoByteProcessor)
#endif
#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#pragma pop_macro("INCLUDE_ALL_ComGoogleCommonIoByteProcessor")
|
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMEXPLICITIMPLICITDATAELEMENT_H
#define GDCMEXPLICITIMPLICITDATAELEMENT_H
#include "gdcmDataElement.h"
namespace gdcm
{
// Data Element (ExplicitImplicit)
/**
* \brief Class to read/write a DataElement as ExplicitImplicit Data Element
* \note This only happen for some Philips images
* Should I derive from ExplicitDataElement instead ?
* This is the class that is the closest the GDCM1.x parser. At each element we try first
* to read it as explicit, if this fails, then we try again as an implicit element.
*/
class GDCM_EXPORT ExplicitImplicitDataElement : public DataElement
{
public:
VL GetLength() const;
template <typename TSwap>
std::istream &Read(std::istream &is);
template <typename TSwap>
std::istream &ReadPreValue(std::istream &is);
template <typename TSwap>
std::istream &ReadValue(std::istream &is, bool readvalues = true);
template <typename TSwap>
std::istream &ReadWithLength(std::istream &is, VL & length)
{
(void)length;
return Read<TSwap>(is);
}
// PURPOSELY do not provide an implementation for writing !
//template <typename TSwap>
//const std::ostream &Write(std::ostream &os) const;
};
} // end namespace gdcm
#include "gdcmExplicitImplicitDataElement.txx"
#endif //GDCMEXPLICITIMPLICITDATAELEMENT_H
|
/*
============================================================================
Name : settings.c
Author : B. Eschrich
Version : 1.00
Copyright : Copyright (c) 2016-2017 by B. Eschrich (EoF)
Description : Global settings and command line options
============================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include <getopt.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "settings.h"
// global settings
settings_t g_settings =
{
.run_mode = RUN_MODE_DAEMON,
.pid_file = PID_FILE_NAME,
.log_file = LOG_FILE_NAME,
.socket_file= UDS_FILE_NAME,
.foreground = 0,
};
/**
*
*/
static void print_usage(const char* prog)
{
printf("Usage: %s [-dvlps]\n", prog);
puts(" -d --daemon Run as daemon process (default behavior)");
puts(" -v --view Run as data view UI (requires running daemon)");
puts(" -c --check Check daemon is running");
puts(" -f --foreground Run daemon code in foreground (for debug purposes)");
puts(" -r --reload Reload daemon settings");
puts(" -l --log Logger output file name (only as daemon, default: " LOG_FILE_NAME ")");
puts(" -p --pidfile PID output file name (only as daemon, default: " PID_FILE_NAME ")");
puts(" -s --socket Unix socket file name (default: " UDS_FILE_NAME ")");
exit(EXIT_FAILURE);
}
/**
*
*/
void parse_opts(int argc, char* argv[])
{
while(1)
{
static const struct option opts[] =
{
{ "daemon", no_argument, 0, 'd'},
{ "view", no_argument, 0, 'v'},
{ "check", no_argument, 0, 'c'},
{ "reload", no_argument, 0, 'r'},
{ "foreground", no_argument, 0, 'f'},
{ "socket", required_argument, 0, 's'},
{ "pidfile", required_argument, 0, 'p'},
{ "log", required_argument, 0, 'l'},
{ 0, 0, 0, 0 }, // end of list
};
/* getopt_long stores the option index here. */
int option_index = 0;
int c;
c = getopt_long(argc, argv, "dfvcrl:p:s:", opts, &option_index);
/* Detect the end of the options. */
if(c == -1)
{
break;
}
switch(c)
{
case 'd':
g_settings.run_mode = RUN_MODE_DAEMON;
break;
case 'f':
g_settings.run_mode = RUN_MODE_DAEMON;
g_settings.foreground = 1;
break;
case 'v':
if(g_settings.foreground == 0)
{
g_settings.run_mode = RUN_MODE_VIEW;
}
break;
case 'r':
puts("Reload settings...");
break;
case 'c':
puts("Check running...");
break;
case 's':
g_settings.socket_file = optarg;
break;
case 'p':
g_settings.pid_file = optarg;
break;
case 'l':
g_settings.log_file = optarg;
break;
case '?':
print_usage(argv[0]);
break;
default:
print_usage(argv[0]);
break;
}
}
}
|
// **********************************************************************
//
// Generated by the ORBacus IDL-to-C++ Translator
//
// Copyright (c) 2005
// IONA Technologies, Inc.
// Waltham, MA, USA
//
// All Rights Reserved
//
// **********************************************************************
// Version: 4.3.2
#ifndef ___Hello_h__
#define ___Hello_h__
#ifndef OB_INTEGER_VERSION
# error No ORBacus version defined! Is <OB/CORBA.h> included?
#endif
#ifndef OB_NO_VERSION_CHECK
# if (OB_INTEGER_VERSION != 4030200L)
# error ORBacus version mismatch!
# endif
#endif
class Hello;
typedef Hello* Hello_ptr;
typedef Hello* HelloRef;
void OBDuplicate(Hello_ptr);
void OBRelease(Hello_ptr);
void OBMarshal(Hello_ptr, OB::OutputStreamImpl*);
void OBUnmarshal(Hello_ptr&, OB::InputStreamImpl*);
typedef OB::ObjVar< Hello > Hello_var;
typedef OB::ObjOut< Hello > Hello_out;
class OBStubImpl_Hello;
typedef OBStubImpl_Hello* OBStubImpl_Hello_ptr;
void OBDuplicate(OBStubImpl_Hello_ptr);
void OBRelease(OBStubImpl_Hello_ptr);
typedef OB::ObjVar< OBStubImpl_Hello > OBStubImpl_Hello_var;
//
// IDL:Hello:1.0
//
class Hello : virtual public ::CORBA::Object
{
Hello(const Hello&);
void operator=(const Hello&);
protected:
static const char* ids_[];
public:
Hello() { }
virtual ~Hello() { }
typedef Hello_ptr _ptr_type;
typedef Hello_var _var_type;
static inline Hello_ptr
_duplicate(Hello_ptr p)
{
if(p)
p -> _add_ref();
return p;
}
static inline Hello_ptr
_nil()
{
return 0;
}
static Hello_ptr _narrow(::CORBA::Object_ptr);
static Hello_ptr _unchecked_narrow(::CORBA::Object_ptr);
static Hello_ptr _narrow(::CORBA::AbstractBase_ptr);
static Hello_ptr _unchecked_narrow(::CORBA::AbstractBase_ptr);
static const char** _OB_staticIds();
//
// IDL:Hello/say_hello:1.0
//
virtual void say_hello() = 0;
//
// IDL:Hello/shutdown:1.0
//
virtual void shutdown() = 0;
};
//
// IDL:Hello:1.0
//
class OBProxy_Hello : virtual public ::Hello,
virtual public OBCORBA::Object
{
OBProxy_Hello(const OBProxy_Hello&);
void operator=(const OBProxy_Hello&);
protected:
virtual OB::MarshalStubImpl_ptr _OB_createMarshalStubImpl();
public:
OBProxy_Hello() { }
virtual ~OBProxy_Hello() { }
virtual const char** _OB_ids() const;
//
// IDL:Hello/say_hello:1.0
//
void say_hello();
//
// IDL:Hello/shutdown:1.0
//
void shutdown();
};
//
// IDL:Hello:1.0
//
class OBStubImpl_Hello : virtual public OB::StubImplBase
{
OBStubImpl_Hello(const OBStubImpl_Hello&);
void operator=(const OBStubImpl_Hello&);
protected:
OBStubImpl_Hello() { }
public:
static inline OBStubImpl_Hello_ptr
_duplicate(OBStubImpl_Hello_ptr p)
{
if(p)
p -> _OB_incRef();
return p;
}
static inline OBStubImpl_Hello_ptr
_nil()
{
return 0;
}
//
// IDL:Hello/say_hello:1.0
//
virtual void say_hello() = 0;
//
// IDL:Hello/shutdown:1.0
//
virtual void shutdown() = 0;
};
//
// IDL:Hello:1.0
//
class OBMarshalStubImpl_Hello :
virtual public OBStubImpl_Hello,
virtual public OB::MarshalStubImpl
{
OBMarshalStubImpl_Hello(const OBMarshalStubImpl_Hello&);
void operator=(const OBMarshalStubImpl_Hello&);
protected:
OBMarshalStubImpl_Hello() { }
friend class OBProxy_Hello;
public:
//
// IDL:Hello/say_hello:1.0
//
virtual void say_hello();
//
// IDL:Hello/shutdown:1.0
//
virtual void shutdown();
};
//
// IDL:Hello:1.0
//
namespace CORBA
{
inline void
release(::Hello_ptr p)
{
if(p)
p -> _remove_ref();
}
inline Boolean
is_nil(::Hello_ptr p)
{
return p == 0;
}
inline void
release(OBStubImpl_Hello_ptr p)
{
if(p)
p -> _OB_decRef();
}
inline Boolean
is_nil(OBStubImpl_Hello_ptr p)
{
return p == 0;
}
} // End of namespace CORBA
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.