text stringlengths 4 6.14k |
|---|
#include <iostream>
#include <vector>
using namespace std;
//½á¹¹Ì嶨Òå
struct TestStruct
{
long longdata[16];
double doubledata;
char chardata[128];
union
{
long lval;
double dval;
char sval[64];
};
};
//º¯ÊýÉùÃ÷
extern int VecterAsArrayTest(void);
extern int VectorMemoryTest(void);
extern int VectorReserveTest(void); |
/*
* Copyright 2014-2022 Real Logic 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef AERON_CONGESTION_CONTROL_H
#define AERON_CONGESTION_CONTROL_H
#include "aeron_socket.h"
#include "aeron_driver_common.h"
#include "aeronmd.h"
#define AERON_STATICWINDOWCONGESTIONCONTROL_CC_PARAM_VALUE ("static")
#define AERON_CUBICCONGESTIONCONTROL_CC_PARAM_VALUE ("cubic")
#define AERON_CUBICCONGESTIONCONTROL_RTT_INDICATOR_COUNTER_NAME ("rcv-cc-cubic-rtt")
#define AERON_CUBICCONGESTIONCONTROL_WINDOW_INDICATOR_COUNTER_NAME ("rcv-cc-cubic-wnd")
typedef struct aeron_congestion_control_strategy_stct aeron_congestion_control_strategy_t;
typedef struct aeron_driver_context_stct aeron_driver_context_t;
typedef struct aeron_counters_manager_stct aeron_counters_manager_t;
typedef bool (*aeron_congestion_control_strategy_should_measure_rtt_func_t)(void *state, int64_t now_ns);
typedef void (*aeron_congestion_control_strategy_on_rttm_sent_func_t)(void *state, int64_t now_ns);
typedef void (*aeron_congestion_control_strategy_on_rttm_func_t)(
void *state, int64_t now_ns, int64_t rtt_ns, struct sockaddr_storage *source_address);
typedef int32_t (*aeron_congestion_control_strategy_on_track_rebuild_func_t)(
void *state,
bool *should_force_sm,
int64_t now_ns,
int64_t new_consumption_position,
int64_t last_sm_position,
int64_t hwm_position,
int64_t starting_rebuild_position,
int64_t ending_rebuild_position,
bool loss_occurred);
typedef int32_t (*aeron_congestion_control_strategy_initial_window_length_func_t)(void *state);
typedef int32_t (*aeron_congestion_control_strategy_max_window_length_func_t)(void *state);
typedef int (*aeron_congestion_control_strategy_fini_func_t)(aeron_congestion_control_strategy_t *strategy);
struct aeron_congestion_control_strategy_stct
{
aeron_congestion_control_strategy_should_measure_rtt_func_t should_measure_rtt;
aeron_congestion_control_strategy_on_rttm_sent_func_t on_rttm_sent;
aeron_congestion_control_strategy_on_rttm_func_t on_rttm;
aeron_congestion_control_strategy_on_track_rebuild_func_t on_track_rebuild;
aeron_congestion_control_strategy_initial_window_length_func_t initial_window_length;
aeron_congestion_control_strategy_max_window_length_func_t max_window_length;
aeron_congestion_control_strategy_fini_func_t fini;
void *state;
};
typedef struct aeron_congestion_control_strategy_stct aeron_congestion_control_strategy_t;
aeron_congestion_control_strategy_supplier_func_t aeron_congestion_control_strategy_supplier_load(
const char *strategy_name);
int aeron_congestion_control_default_strategy_supplier(
aeron_congestion_control_strategy_t **strategy,
aeron_udp_channel_t *channel,
int32_t stream_id,
int32_t session_id,
int64_t registration_id,
int32_t term_length,
int32_t sender_mtu_length,
struct sockaddr_storage *control_address,
struct sockaddr_storage *src_address,
aeron_driver_context_t *context,
aeron_counters_manager_t *counters_manager);
int aeron_static_window_congestion_control_strategy_supplier(
aeron_congestion_control_strategy_t **strategy,
aeron_udp_channel_t *channel,
int32_t stream_id,
int32_t session_id,
int64_t registration_id,
int32_t term_length,
int32_t sender_mtu_length,
struct sockaddr_storage *control_address,
struct sockaddr_storage *src_address,
aeron_driver_context_t *context,
aeron_counters_manager_t *counters_manager);
int aeron_cubic_congestion_control_strategy_supplier(
aeron_congestion_control_strategy_t **strategy,
aeron_udp_channel_t *channel,
int32_t stream_id,
int32_t session_id,
int64_t registration_id,
int32_t term_length,
int32_t sender_mtu_length,
struct sockaddr_storage *control_address,
struct sockaddr_storage *src_address,
aeron_driver_context_t *context,
aeron_counters_manager_t *counters_manager);
#endif //AERON_CONGESTION_CONTROL_H
|
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stdlib/blas/ext/base/dsnansumors.h"
#include <stdint.h>
#include <stdio.h>
int main() {
// Create a strided array:
float x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0/0.0, 0.0/0.0 };
// Specify the number of elements:
int64_t N = 5;
// Specify the stride length:
int64_t stride = 2;
// Compute the sum:
double v = stdlib_strided_dsnansumors( N, x, stride );
// Print the result:
printf( "sum: %lf\n", v );
}
|
// Copyright 2017 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 XRTL_PORT_COMMON_BASE_THREADING_PTHREADS_WAIT_HANDLE_H_
#define XRTL_PORT_COMMON_BASE_THREADING_PTHREADS_WAIT_HANDLE_H_
#include <pthread.h>
#include <chrono>
#include <utility>
#include "xrtl/base/threading/wait_handle.h"
namespace xrtl {
// Implementation so that we can access these methods and values from a
// WaitHandle pointer.
class PthreadsWaitHandleImpl {
public:
virtual ~PthreadsWaitHandleImpl() = default;
// Mutex+cond that makes up our wait var.
pthread_mutex_t* wait_mutex() { return &wait_mutex_; }
pthread_cond_t* wait_cond() { return &wait_cond_; }
// Shared condition that is used for the multi-wait functionality.
static pthread_mutex_t* shared_multi_mutex();
static pthread_cond_t* shared_multi_cond();
// Signals the handle, as Set/Release/etc.
// May not be supported by all types.
// Returns true if the signal succeeded.
virtual bool Signal() { return true; }
// Returns true if the wait handle is signaled.
// This must be called from within a wait_mutex lock.
virtual bool CheckCondition() const = 0;
// Sets the condition when the wait has succeeded.
// This must be called from within a wait_mutex lock.
virtual void SetWaitSuccessful() = 0;
protected:
pthread_mutex_t wait_mutex_;
pthread_cond_t wait_cond_;
};
// CRTP WaitHandle shim.
template <typename T>
class PthreadsWaitHandle : public T, protected PthreadsWaitHandleImpl {
public:
template <typename... Args>
explicit PthreadsWaitHandle(Args&&... args) : T(std::forward<Args>(args)...) {
pthread_mutex_init(&wait_mutex_, nullptr);
pthread_cond_init(&wait_cond_, nullptr);
}
~PthreadsWaitHandle() {
pthread_mutex_destroy(&wait_mutex_);
pthread_cond_destroy(&wait_cond_);
}
uintptr_t native_handle() override {
return reinterpret_cast<uintptr_t>(
static_cast<PthreadsWaitHandleImpl*>(this));
}
};
} // namespace xrtl
#endif // XRTL_PORT_COMMON_BASE_THREADING_PTHREADS_WAIT_HANDLE_H_
|
#pragma once
#include "../state.h"
//#include "../../../entitycondition.h"
template <typename _Object>
class CStateCaptureJumpBloodsucker : public CState<_Object> {
protected:
typedef CState<_Object> inherited;
typedef CState<_Object>* state_ptr;
public:
CStateCaptureJumpBloodsucker(_Object* obj);
virtual ~CStateCaptureJumpBloodsucker();
virtual void execute();
virtual void setup_substates();
virtual void remove_links(CObject* object) { inherited::remove_links(object); }
};
#include "bloodsucker_state_capture_jump_inline.h" |
// Generated by Haxe 3.4.0
#ifndef INCLUDED_haxe_io_Path
#define INCLUDED_haxe_io_Path
#ifndef HXCPP_H
#include <hxcpp.h>
#endif
HX_DECLARE_CLASS2(haxe,io,Path)
namespace haxe{
namespace io{
class HXCPP_CLASS_ATTRIBUTES Path_obj : public hx::Object
{
public:
typedef hx::Object super;
typedef Path_obj OBJ_;
Path_obj();
public:
enum { _hx_ClassId = 0x044b6ab5 };
void __construct();
inline void *operator new(size_t inSize, bool inContainer=false,const char *inName="haxe.io.Path")
{ return hx::Object::operator new(inSize,inContainer,inName); }
inline void *operator new(size_t inSize, int extra)
{ return hx::Object::operator new(inSize+extra,false,"haxe.io.Path"); }
hx::ObjectPtr< Path_obj > __new() {
hx::ObjectPtr< Path_obj > __this = new Path_obj();
__this->__construct();
return __this;
}
static hx::ObjectPtr< Path_obj > __alloc(hx::Ctx *_hx_ctx) {
Path_obj *__this = (Path_obj*)(hx::Ctx::alloc(_hx_ctx, sizeof(Path_obj), false, "haxe.io.Path"));
*(void **)__this = Path_obj::_hx_vtable;
return __this;
}
static void * _hx_vtable;
static Dynamic __CreateEmpty();
static Dynamic __Create(hx::DynamicArray inArgs);
//~Path_obj();
HX_DO_RTTI_ALL;
static bool __GetStatic(const ::String &inString, Dynamic &outValue, hx::PropertyAccess inCallProp);
static void __register();
bool _hx_isInstanceOf(int inClassId);
::String __ToString() const { return HX_HCSTRING("Path","\xc5","\x11","\x2b","\x35"); }
static ::String addTrailingSlash(::String path);
static ::Dynamic addTrailingSlash_dyn();
static ::String removeTrailingSlashes(::String path);
static ::Dynamic removeTrailingSlashes_dyn();
};
} // end namespace haxe
} // end namespace io
#endif /* INCLUDED_haxe_io_Path */
|
//
// Created by Uros Milivojevic on 10/8/14.
// Copyright (c) 2014 infrared.io. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IRBaseBuilder.h"
@class IRButtonDescriptor;
@class IRButton;
@class IRView;
@class IRBaseDescriptor;
@class IRScreenDescriptor;
@class IRViewDescriptor;
@class IRViewController;
@interface IRButtonBuilder : IRBaseBuilder
+ (IRView *) buildComponentFromDescriptor:(IRBaseDescriptor *)descriptor
viewController:(IRViewController *)viewController
extra:(id)extra;
+ (void) setUpComponent:(IRView *)irButton
componentDescriptor:(IRBaseDescriptor *)descriptor
viewController:(IRViewController *)viewController
extra:(id)extra;
@end |
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef __itkAdaptImageFilter_h
#define __itkAdaptImageFilter_h
#include "itkUnaryFunctorImageFilter.h"
namespace itk
{
namespace Functor
{
/** \class AccessorFunctor
* \brief Convert an accessor to a functor so that it can be used in a
* UnaryFunctorImageFilter.
*
* AccessorFunctor converts a data accessor to a functor object. This
* allows an accessor to be used as functor in a UnaryFunctorImageFilter,
* BinaryFunctorImageFilter, TernaryFunctorImageFilter, or
* NaryFunctionImageFilter.
* \ingroup ITKImageIntensity
*/
template< class TInput, class TAccessor >
class AccessorFunctor
{
public:
/** Standard class typedefs. */
typedef AccessorFunctor Self;
typedef TAccessor AccessorType;
/** Constructor and destructor. */
AccessorFunctor():m_Accessor() {}
~AccessorFunctor() {}
/** operator(). This is the "call" method of the functor. */
typedef typename TAccessor::ExternalType OutputType;
inline OutputType operator()(const TInput & A) const
{
return m_Accessor.Get(A);
}
/** Get the accessor. The accessor is returned by reference. */
AccessorType & GetAccessor()
{
return m_Accessor;
}
/** Assignment operator */
AccessorFunctor & operator=(const AccessorFunctor & functor)
{
m_Accessor = functor.m_Accessor;
return *this;
}
/** Set the accessor object. This replaces the current accessor with
* a copy of the specified accessor. This allows the user to
* specify an accessor that has ivars set differently that the default
* accessor.
*/
void SetAccessor(AccessorType & accessor)
{
m_Accessor = accessor;
}
/** operator!=. Needed to determine if two accessors are the same. */
bool operator!=(const Self & functor) const
{
return ( m_Accessor != functor.m_Accessor );
}
bool operator==(const Self & other) const
{
return !( *this != other );
}
private:
AccessorType m_Accessor;
};
}
/** \class AdaptImageFilter
* \brief Convert an image to another pixel type using the specified data accessor.
*
* AdaptImageFilter converts an image to another pixel type using a
* data accessor. AdaptImageFilter can perform simple cast operations
* (i.e. short to float) or can extract a subcomponent of a pixel
* (i.e. extract the green component of an RGB pixel.
* AdaptImageFilter could also be used for performing simple
* arithmetic operations at a pixel (i.e. taking the vcl_sqrt() or vcl_sin()
* of a pixel); however, these types of operations could also be
* accomplished using the itk::UnaryImageFilter.
*
* The third template parameter for this filter is a DataAccessor
* which performs the adaption or conversion of a pixel. The
* DataAccessor must provide a method called Get() which takes an
* input pixel and returns an output pixel. The input pixel can be
* passed by reference but the output pixel is frequently returned by
* value. However, a data accessor that returns a subcomponent of a
* pixel will usually return that subcomponent by reference. For
* instance, a data accessor that returns the green component of a RGB
* pixel will simply return a reference to the proper element of the
* RGB vector. See itk::DataAccessor for performing simple cast
* operations.
*
* \ingroup IntensityImageFilters MultiThreaded
* \ingroup ITKImageIntensity
*/
template< class TInputImage, class TOutputImage, class TAccessor >
class AdaptImageFilter:
public UnaryFunctorImageFilter< TInputImage, TOutputImage,
Functor::AccessorFunctor< typename TInputImage::PixelType, TAccessor > >
{
public:
/** Standard class typedefs. */
typedef AdaptImageFilter Self;
typedef UnaryFunctorImageFilter< TInputImage,
TOutputImage,
Functor::AccessorFunctor<
typename TInputImage::PixelType,
TAccessor > > Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
typedef typename Superclass::FunctorType FunctorType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Typedef for the accessor type */
typedef TAccessor AccessorType;
/** Run-time type information (and related methods). */
itkTypeMacro(AdaptImageFilter, UnaryFunctorImageFilter);
/** Get the accessor. This is a convenience method so the user */
AccessorType & GetAccessor() { return this->GetFunctor().GetAccessor(); }
/** Set the accessor. This is a convenience method so the user does */
void SetAccessor(AccessorType & accessor)
{
FunctorType functor;
functor = this->GetFunctor();
if ( accessor != functor.GetAccessor() )
{
functor.SetAccessor(accessor);
this->SetFunctor(functor);
this->Modified();
}
}
protected:
AdaptImageFilter() {}
virtual ~AdaptImageFilter() {}
private:
AdaptImageFilter(const Self &); //purposely not implemented
void operator=(const Self &); //purposely not implemented
};
} // end namespace itk
#endif
|
//
// AppDelegate.h
// xunfeiyuyinshibie
//
// Created by K.Yawn Xoan on 4/1/15.
// Copyright (c) 2015 KevinHsiun. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
//
// EyeBreakRulePictureController.h
// KakaFind
//
// Created by 陈振勇 on 16/7/28.
// Copyright © 2016年 陈振勇. All rights reserved.
// 违章图片选取页面
#import "EyeBaseViewController.h"
@interface EyeBreakRulePictureController : EyeBaseViewController
/** 视频路径 */
@property (nonatomic, copy) NSString *videoPath;
/** 取得图片跳回违章页面block */
@property (nonatomic, copy) void (^breakRulesImageBlock)(UIImage *image);
@end
|
/*
Copyright (C) 2015 Tandem Group Software
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 "Header.h"
typedef struct SecondFileStruct
{
int number;
Test1 otherHeaderFileStruct;
} SecFileStrct;
int main() { return 0; } |
//
// NSManagedObjectContextOperation.h
//
// Created by Andrei Zaharia on 7/31/14.
// Copyright (c) 2014 Andrei Zaharia. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef void (^CoreDataOperationBlock)(NSManagedObjectContext * moc);
typedef void (^OnOperationCompleted)(void);
@interface NSManagedObjectContextOperation : NSOperation
@property (nonatomic, copy) CoreDataOperationBlock operationBlock;
@property (nonatomic, copy) OnOperationCompleted onOperationCompleted;
-(id)initWithPersistentStoreCoordinator:(NSPersistentStoreCoordinator *)persistentStoreCoordinator;
@end
|
/**
1006. 换个格式输出整数 (15)
时间限制
400 ms
内存限制
65536 kB
代码长度限制
8000 B
判题程序
Standard
作者
CHEN, Yue
让我们用字母B来表示“百”、字母S表示“十”,用“12...n”来表示个位数字n(<10),换个格式来输出任一个不超过3位的正整数。例如234应该被输出为BBSSS1234,因为它有2个“百”、3个“十”、以及个位的4。
输入格式:每个测试输入包含1个测试用例,给出正整数n(<1000)。
输出格式:每个测试用例的输出占一行,用规定的格式输出n。
输入样例1:
234
输出样例1:
BBSSS1234
输入样例2:
23
输出样例2:
SS123
**/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main (void)
{
int input;
int bai=0;
int shi=0;
int ge=0;
scanf("%d",&input);
ge = input % 10;
input /= 10;
shi = input % 10;
input /= 10;
bai = input % 10;
for(int i = 0;i<bai;i++)
{
printf("B");
}
for(int i = 0;i<shi;i++)
{
printf("S");
}
for(int i = 1; i <= ge;i++)
{
printf("%d",i);
}
return 0;
}
|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <ctype.h>
#include <flinklib.h>
#define DEFAULT_DEV "/dev/flink0"
#define SIZE 4
int main(int argc, char* argv[]) {
flink_dev* dev;
flink_subdev* subdev;
char* dev_name = DEFAULT_DEV;
uint8_t subdevice_id = 0;
char c;
uint32_t offset;
uint32_t value;
uint8_t write = 0;
int error = 0;
/* Compute command line arguments */
while((c = getopt(argc, argv, "d:s:o:v:rw")) != -1) {
switch(c) {
case 'd': // device
dev_name = optarg;
break;
case 's':
subdevice_id = atoi(optarg);
break;
case 'o':
offset = atoi(optarg);
break;
case 'r':
write = 0;
break;
case 'w':
write = 1;
break;
case 'v':
if(!write) {
fprintf(stderr, "You can not set a value if you want to read from a device!");
}
else {
value = atoi(optarg);
}
break;
case '?':
if(optopt == 'd' || optopt == 's' || optopt == 'o' || optopt == 'v') fprintf(stderr, "Option -%c requires an argument.\n", optopt);
else if(isprint(optopt)) fprintf (stderr, "Unknown option `-%c'.\n", optopt);
else fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
return -1;
default:
abort();
}
}
printf("Opening device %s...\n", dev_name);
dev = flink_open(dev_name);
if(dev == NULL) {
printf("Failed to open device!\n");
return -1;
}
subdev = flink_get_subdevice_by_id(dev, subdevice_id);
if(write) {
printf("Writing 0x%x (%u) to offset 0x%x at subdevice %u on device %s...\n", value, value, offset, subdevice_id, dev_name);
error = flink_write(subdev, offset, SIZE, &value);
if(dev == NULL) {
printf("Failure while writing to device: %u!\n", error);
return -1;
}
}
else {
printf("Reading from offset 0x%x at subdevice %u on device %s...\n", offset, subdevice_id, dev_name);
error = flink_read(subdev, offset, SIZE, &value);
if(dev == NULL) {
printf("Failure while reading from device: %u!\n", error);
return -1;
}
else {
printf("--> Read: 0x%x (%u)\n", value, value);
}
}
printf("Closing device %s...\n", dev_name);
flink_close(dev);
return EXIT_SUCCESS;
}
|
/*
**************************************************************************
* Class: Graham Scan Convex Hull *
* By Arash Partow - 2001 *
* URL: http://www.partow.net *
* *
* Copyright Notice: *
* Free use of this library is permitted under the guidelines and *
* in accordance with the most current version of the Common Public *
* License. *
* http://www.opensource.org/licenses/cpl.php *
* *
**************************************************************************
*/
#ifndef INCLUDE_GRAHAMSCANCONVEXHULL_H
#define INCLUDE_GRAHAMSCANCONVEXHULL_H
#include <iostream>
#include <deque>
#include <vector>
#include <algorithm>
#include <math.h>
#include "ConvexHull.h"
struct gs_point2d
{
public:
gs_point2d(double _x = 0.0, double _y = 0.0, double _angle = 0.0) : x(_x), y(_y), angle(_angle){}
double x;
double y;
double angle;
};
const double _180DivPI = 57.295779513082320876798154814105000;
const int counter_clock_wise = +1;
const int clock_wise = -1;
class GSPoint2DCompare
{
public:
GSPoint2DCompare(gs_point2d* _anchor):anchor(_anchor){};
bool operator()(const gs_point2d& p1, const gs_point2d& p2)
{
if (p1.angle < p2.angle) return true;
else if (p1.angle > p2.angle) return false;
else if (is_equal(p1,p2)) return false;
else return (lay_distance(anchor->x, anchor->y, p1.x, p1.y) < lay_distance(anchor->x, anchor->y, p2.x, p2.y));
}
private:
inline bool is_equal(const gs_point2d &p1, const gs_point2d &p2)
{
return is_equal(p1.x,p2.x) && is_equal(p1.y,p2.y);
}
inline bool is_equal(const double v1, const double v2, const double epsilon = 1.0e-12)
{
double diff = v1 - v2;
return (diff <= epsilon) && (-epsilon <= diff);
}
inline double lay_distance(const double& x1, const double& y1, const double& x2, const double& y2)
{
double dx = (x1 - x2);
double dy = (y1 - y2);
return (dx * dx + dy * dy);
}
gs_point2d* anchor;
};
class GrahamScanConvexHull : public ConvexHull
{
public:
GrahamScanConvexHull() : point(), anchor() {};
~GrahamScanConvexHull(){};
virtual bool operator()(const std::vector < point2d >& pnt, std::vector< point2d >& final_hull);
private:
void graham_scan(std::vector< point2d >& final_hull);
inline double cartesian_angle(double x, double y);
inline int orientation(const gs_point2d& p1,
const gs_point2d& p2,
const gs_point2d& p3);
inline int orientation(const double x1, const double y1,
const double x2, const double y2,
const double px, const double py);
inline bool is_equal(const double v1, const double v2, const double epsilon = 1.0e-12);
std::vector<gs_point2d> point;
gs_point2d anchor;
};
#endif
|
../../../XMPPFramework/Extensions/XEP-0184/XMPPMessageDeliveryReceipts.h |
//
// CBLCoreBridge.h
// CouchbaseLite
//
// Copyright (c) 2016 Couchbase, 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.
//
#pragma once
#import <Foundation/Foundation.h>
#import "fleece/Fleece+CoreFoundation.h"
#import "c4.h"
#import "c4Document+Fleece.h"
NS_ASSUME_NONNULL_BEGIN
NSString* __nullable slice2string(C4Slice s);
C4Slice data2slice(NSData* __nullable);
// The sliceResult2... functions take care of freeing the C4SliceResult, or adopting its data.
NSData* __nullable sliceResult2data(C4SliceResult);
NSString* __nullable sliceResult2string(C4SliceResult);
NSString* __nullable sliceResult2FilesystemPath(C4SliceResult);
class C4Transaction {
public:
C4Transaction(C4Database *db)
:_db(db)
{ }
~C4Transaction() {
if (_active)
c4db_endTransaction(_db, false, nullptr);
}
bool begin() {
if (!c4db_beginTransaction(_db, &_error))
return false;
_active = true;
return true;
}
bool end(bool commit) {
NSCAssert(_active, @"Forgot to begin");
_active = false;
return c4db_endTransaction(_db, commit, &_error);
}
bool commit() {return end(true);}
bool abort() {return end(false);}
const C4Error &error() {return _error;}
private:
C4Database *_db;
C4Error _error;
bool _active;
};
NS_ASSUME_NONNULL_END
|
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************************
* SEGGER MICROCONTROLLER SYSTEME GmbH *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996-2014 SEGGER Microcontroller Systeme GmbH *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
----------------------------------------------------------------------
File : SEGGER_RTT_Conf.h
Date : 17 Dec 2014
Purpose : Implementation of SEGGER real-time terminal which allows
real-time terminal communication on targets which support
debugger memory accesses while the CPU is running.
---------------------------END-OF-HEADER------------------------------
*/
/*********************************************************************
*
* Defines, configurable
*
**********************************************************************
*/
#define SEGGER_RTT_MAX_NUM_UP_BUFFERS (2) // Max. number of up-buffers (T->H) available on this target (Default: 2)
#define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (2) // Max. number of down-buffers (H->T) available on this target (Default: 2)
#define BUFFER_SIZE_UP (1024) // Size of the buffer for terminal output of target, up to host (Default: 1k)
#define BUFFER_SIZE_DOWN (16) // Size of the buffer for terminal input to target from host (Usually keyboard input) (Default: 16)
#define SEGGER_RTT_PRINTF_BUFFER_SIZE (64) // Size of buffer for RTT printf to bulk-send chars via RTT (Default: 64)
//
// Target is not allowed to perform other RTT operations while string still has not been stored completely.
// Otherwise we would probably end up with a mixed string in the buffer.
// If using RTT from within interrupts, multiple tasks or multi processors, define the SEGGER_RTT_LOCK() and SEGGER_RTT_UNLOCK() function here.
//
#define SEGGER_RTT_LOCK()
#define SEGGER_RTT_UNLOCK()
//
// Define SEGGER_RTT_IN_RAM as 1
// when using RTT in RAM targets (init and data section both in RAM).
// This prevents the host to falsly identify the RTT Callback Structure
// in the init segment as the used Callback Structure.
//
// When defined as 1,
// the first call to an RTT function will modify the ID of the RTT Callback Structure.
// To speed up identifying on the host,
// especially when RTT functions are not called at the beginning of execution,
// SEGGER_RTT_Init() should be called at the start of the application.
//
#define SEGGER_RTT_IN_RAM (1)
/*************************** End of file ****************************/
#ifdef __cplusplus
}
#endif
|
/*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <string.h>
#include <stdio.h>
#include <fmd/fmd.h>
#include <fmd/generate.h>
#include <fmd/parse.h>
#include <fmd/util.h>
#define IMAGE_REGION_BASE 0x1000
#define ARRAYSIZE(x) (sizeof(x) / sizeof(*x))
static const struct tlv_header region_tlv_header = {
.tag = FMD_REGION_TAG,
.length = sizeof(struct fmd_region),
.version = FMD_REGION_VERSION,
};
static const struct fmd_region global_regions[] = {
{
.tlv = region_tlv_header,
.region_name = "region1",
.region_offset = IMAGE_REGION_BASE,
.region_size = 0x1000
},
{
.tlv = region_tlv_header,
.region_name = "region2",
.region_offset = IMAGE_REGION_BASE + 0x1000,
.region_size = 0x1000
},
{
.tlv = region_tlv_header,
.region_name = "region3",
.region_offset = IMAGE_REGION_BASE + 0x2000,
.region_size = 0x1000
},
};
int main() {
int rc;
// Write a descriptor to a file
struct image_fmd desc;
rc = create_descriptor(global_regions, ARRAYSIZE(global_regions), FMD_HASH_SHA256,
&desc);
if (rc != FMD_SUCCESS) {
printf("ERROR: Failed to create image descriptor, error code=%d\n", rc);
return rc;
}
printf("Successfully generated an image descriptor!\n");
// Read the descriptor back
struct image_fmd out_desc;
rc = parse_descriptor(&desc, &out_desc);
if (rc != FMD_SUCCESS) {
printf("ERROR: Failed to parse image descriptor, error code=%d\n", rc);
return rc;
}
printf("Successfully parsed the generated image descriptor!\n");
return 0;
}
|
#ifndef BLOCKDATATRANSFERINSTRUCTION_H
#define BLOCKDATATRANSFERINSTRUCTION_H
#include "arminstruction.h"
class BlockDataTransferInstruction : public ArmInstruction
{
public:
BlockDataTransferInstruction(Condition condition);
};
#endif // BLOCKDATATRANSFERINSTRUCTION_H
|
/*
*------------------------------------------------------------------
* Copyright (c) 2019 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*------------------------------------------------------------------
*/
#include <vlib/vlib.h>
#include <rdma/rdma.h>
uword
unformat_rdma_create_if_args (unformat_input_t * input, va_list * vargs)
{
rdma_create_if_args_t *args = va_arg (*vargs, rdma_create_if_args_t *);
unformat_input_t _line_input, *line_input = &_line_input;
uword ret = 1;
if (!unformat_user (input, unformat_line_input, line_input))
return 0;
clib_memset (args, 0, sizeof (*args));
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (line_input, "host-if %s", &args->ifname))
;
else if (unformat (line_input, "name %s", &args->name))
;
else if (unformat (line_input, "rx-queue-size %u", &args->rxq_size))
;
else if (unformat (line_input, "tx-queue-size %u", &args->txq_size))
;
else if (unformat (line_input, "num-rx-queues %u", &args->rxq_num))
;
else if (unformat (line_input, "mode auto"))
args->mode = RDMA_MODE_AUTO;
else if (unformat (line_input, "mode ibv"))
args->mode = RDMA_MODE_IBV;
else if (unformat (line_input, "mode dv"))
args->mode = RDMA_MODE_DV;
else
{
/* return failure on unknown input */
ret = 0;
break;
}
}
unformat_free (line_input);
return ret;
}
/*
* fd.io coding-style-patch-verification: ON
*
* Local Variables:
* eval: (c-set-style "gnu")
* End:
*/
|
//
// ZoozAddPaymentMethodResponse.h
// Zooz
//
// Created by Ronen Morecki on 9/17/14.
// Copyright (c) 2014 Zooz. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ZoozEcommResponseObject.h"
#import "ZoozRisk.h"
@interface ZoozAddPaymentMethodResponse : ZoozEcommResponseObject
@property(retain, nonatomic) NSString * paymentMethodToken;
@property(retain, nonatomic) NSString * lastFourDigits;
@property(retain, nonatomic) NSString * subtype;
@property(retain, nonatomic) ZoozRisk * risk;
@end
|
/*
* This file is part of the Sequoia MSO Solver.
*
* Copyright 2012 Alexander Langer, Theoretical Computer Science,
* RWTH Aachen University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Alexander Langer
*/
#pragma once
#include "common.h"
#include "hashing.h"
#include "unordered_defs.h"
namespace sequoia {
template <typename T> class Pool {
public:
~Pool<T>() {
typename PoolSet::const_iterator cit = _pool.begin();
typename PoolSet::const_iterator citend = _pool.end();
for (; cit != citend; cit++)
delete *cit;
}
const T* pooling(const T* inptr) {
assert(inptr != NULL);
std::pair<typename PoolSet::iterator, bool> res = _pool.insert(inptr);
const T* resptr = *res.first;
if (res.second) { // new
#ifdef POOLING_DEBUG
DPRINTLN("[Pool<" << typeid(T).name() << "> new " << inptr << "]");
#endif
} else { // existing
#ifdef POOLING_DEBUG
DPRINTLN("[Pool<" << typeid(T).name() << "> hit " << inptr << "]");
#endif
assert(inptr != resptr);
delete inptr;
}
return resptr;
}
size_t size() const { return _pool.size(); }
private:
typedef SEQUOIA_CONCUR_UNORDERED_SET<
const T*,
ptr_deep_hasher<T>,
ptr_deep_equals<const T*>
> PoolSet;
PoolSet _pool;
};
} // namespace
|
#include "common.h"
class dip_logtail_util{
public:
dip_logtail_util();
~dip_logtail_util();
void get_local_ip();
void get_local_an();
std::string get_ip();
std::string get_an();
void use_util();
private:
static std::string trim_String(const std::string& str);
std::string an;
std::string eth0_ip;
};
|
// ComHelper.h
// Created by Caner Korkmaz on 2/7/2017.
// Copyright 2017 Caner Korkmaz
//
#ifndef SOCKETPLAY_COMHELPER_H
#define SOCKETPLAY_COMHELPER_H
#include <windows.h>
#include <memory>
#include <audioclient.h>
#include <audiopolicy.h>
#include <mmdeviceapi.h>
#include <comdef.h>
#include <wrl/client.h>
#include "Logger.h"
namespace socketplay::windows{
using Microsoft::WRL::ComPtr;
inline void throw_if_failed_impl(HRESULT hr, const char* filename, int line, const char* func) {
if (FAILED(hr)) {
detail::log("ERROR", filename, line, func) << "Com Error!\n";
throw _com_error(hr);
}
}
#define throw_if_failed(hr) throw_if_failed_impl( (hr), __FILE__, __LINE__, __func__ )
class CoContext {
public:
CoContext() {
if (context_count_==0) {
throw_if_failed(CoInitialize(nullptr));
}
++context_count_;
}
~CoContext() noexcept(true) {
if (context_count_!=0 && --context_count_==0) {
CoUninitialize();
}
}
CoContext(const CoContext &context) {
++context_count_;
};
CoContext &operator=(const CoContext &context) {
++context_count_;
return *this;
};
CoContext(CoContext &&context) noexcept(true) {
};
CoContext &operator=(CoContext &&context) noexcept(true) {
return *this;
};
private:
static size_t context_count_;
};
template<typename T>
struct CoTaskMemDeleter {
void operator()(T *element) {
CoTaskMemFree(element);
}
};
template<typename T>
using co_taskmem_ptr = std::unique_ptr<T, CoTaskMemDeleter<T>>;
template<typename T>
co_taskmem_ptr<T> co_make_unique(T *t) {
return co_taskmem_ptr<T>(t);
}
ComPtr<IMMDeviceEnumerator> get_device_enumerator(DWORD cls_context = CLSCTX_ALL, LPUNKNOWN unknown_outer = nullptr);
ComPtr<IMMDevice> get_default_audio_endpoint(const ComPtr<IMMDeviceEnumerator> &enumerator, EDataFlow flow, ERole role);
ComPtr<IAudioClient> activate_audio_client_from_endpoint(const ComPtr<IMMDevice> &endpoint,
DWORD cls_context = CLSCTX_ALL);
}
#endif //SOCKETPLAY_COMHELPER_H
|
#ifndef BITHOME_ACTION_H
#define BITHOME_ACTION_H
#include <stdarg.h>
#include <BitHomeParameter.h>
class BitHomeAction {
public:
typedef void (*action_function)(BitHomeParameter*);
BitHomeAction(char* apiName, char* description, uint8_t returnType,
action_function action,
int numParams, BitHomeParameter* parameters);
BitHomeAction(char* apiName, char* description, uint8_t returnType,
action_function action,
int numParams, ...);
BitHomeParameter getParameter(uint8_t parameterIndex) { return _parameters[parameterIndex];}
BitHomeParameter* getParameters() { return _parameters; }
uint8_t getReturnType() { return _returnType; }
uint8_t getNumParameters() { return _numParameters; }
uint8_t getOptions() { return _options; }
char* getApiName() { return _apiName; }
char* getDesc() { return _description; }
action_function getFunction() { return _action; }
BitHomeParameter* _parameters;
action_function _action;
char* _apiName;
char* _description;
uint8_t _returnType;
uint8_t _numParameters;
uint8_t _options;
};
#endif
|
//
// BacktrackClient.h
// Backtrack-Test
//
// Created by Ahmet Özışık on 19.04.2015.
// Copyright (c) 2015 Sailbright. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BacktrackSDK.h"
#import "BacktrackUser.h"
#import "BacktrackBundle.h"
#import "BTGlobals.h"
#import "BTMutableURLRequest.h"
#import "BTQueryStringPair.h"
#import "BTDatabase.h"
@class BacktrackUser;
@class BacktrackBundle;
@interface BacktrackClient : NSObject
@property (nonatomic, strong) BacktrackUser *currentUser;
@property (nonatomic, strong) NSURLSession *session;
@property (nonatomic, copy) NSString *clientAccessToken;
+ (instancetype)sharedClient;
// Authentication
- (void)authenticateUser:(NSString *)email
password:(NSString *)password
completion:(BTBooleanResultBlock)completionBlock;
- (void)createUserWithEmail:(NSString *)username
password:(NSString *)password
first_name:(NSString*)first_name
last_name:(NSString*)last_name
phone:(NSString*)phone
completion:(BTBooleanResultBlock)completionBlock;
- (BOOL) isAuthenticated;
- (void) logoutWithCompletion:(BTBooleanResultBlock)completionBlock;
- (void) forceLogout; // logout without API request
// User
- (void) updateUserWithCompletion:(BTObjectResultBlock)completionBlock;
- (void) changeOldPassword:(NSString *)oldPassword
toNewPassword:(NSString *)newPassword
completion:(BTBooleanResultBlock)completionBlock;
- (void) resetPassword:(NSString*)email completion:(BTBooleanResultBlock)completionBlock;
// Core methods
- (void)getPath:(NSString *)path
parameters:(NSDictionary *)parameters
success:(void (^)(id responseObject))success
failure:(void (^)(NSError *error))failure;
- (void)postPath:(NSString *)path
parameters:(NSDictionary *)parameters
success:(void (^)(id responseObject))success
failure:(void (^)(NSError *error))failure;
- (void)putPath:(NSString *)path
parameters:(NSDictionary *)parameters
success:(void (^)(id responseObject))success
failure:(void (^)(NSError *error))failure;
- (void)deletePath:(NSString *)path
parameters:(NSDictionary *)parameters
success:(void (^)(id responseObject))success
failure:(void (^)(NSError *error))failure;
// Helpers
-(NSURL*)authenticatedURL:(NSString*)urlString;
@end
|
#import <UIKit/UIKit.h>
@interface UIView (UIViewAdditions)
- (UIView*) addTaggedSubview:(UIView*)theView;
@end
|
/*
* Copyright (c) 2016 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
*
* @brief Zephyr testing framework assertion macros
*/
#ifndef __ZTEST_ASSERT_H__
#define __ZTEST_ASSERT_H__
#include <ztest.h>
#ifdef assert
#undef assert
#endif
void ztest_test_fail(void);
#if CONFIG_ZTEST_ASSERT_VERBOSE == 0
static inline void _assert_(int cond, const char *file, int line)
{
if (!(cond)) {
PRINT("\n Assertion failed at %s:%d\n",
file, line);
ztest_test_fail();
}
}
#define _assert(cond, msg, default_msg, file, line, func) \
_assert_(cond, file, line)
#else /* CONFIG_ZTEST_ASSERT_VERBOSE != 0 */
static inline void _assert(int cond, const char *msg, const char *default_msg,
const char *file, int line, const char *func)
{
if (!(cond)) {
PRINT("\n Assertion failed at %s:%d: %s: %s %s\n",
file, line, func, msg, default_msg);
ztest_test_fail();
}
#if CONFIG_ZTEST_ASSERT_VERBOSE == 2
else {
PRINT("\n Assertion succeeded at %s:%d (%s)\n",
file, line, func);
}
#endif
}
#endif /* CONFIG_ZTEST_ASSERT_VERBOSE */
/**
* @defgroup ztest_assert Ztest assertion macros
* @ingroup ztest
*
* This module provides assertions when using Ztest.
*
* @{
*/
/**
* @brief Fail the test, if @a cond is false
*
* You probably don't need to call this macro directly. You should
* instead use assert_{condition} macros below.
*
* @param cond Condition to check
* @param msg Optional, can be NULL. Message to print if @a cond is false.
* @param default_msg Message to print if @a cond is false
*/
#define assert(cond, msg, default_msg) \
_assert(cond, msg ? msg : "", msg ? ("(" default_msg ")") : (default_msg), \
__FILE__, __LINE__, __func__)
/**
* @brief Assert that this function call won't be reached
* @param msg Optional message to print if the assertion fails
*/
#define assert_unreachable(msg) assert(0, msg, "Reached unreachable code")
/**
* @brief Assert that @a cond is true
* @param cond Condition to check
* @param msg Optional message to print if the assertion fails
*/
#define assert_true(cond, msg) assert(cond, msg, #cond " is false")
/**
* @brief Assert that @a cond is false
* @param cond Condition to check
* @param msg Optional message to print if the assertion fails
*/
#define assert_false(cond, msg) assert(!(cond), msg, #cond " is true")
/**
* @brief Assert that @a ptr is NULL
* @param ptr Pointer to compare
* @param msg Optional message to print if the assertion fails
*/
#define assert_is_null(ptr, msg) assert((ptr) == NULL, msg, #ptr " is not NULL")
/**
* @brief Assert that @a ptr is not NULL
* @param ptr Pointer to compare
* @param msg Optional message to print if the assertion fails
*/
#define assert_not_null(ptr, msg) assert((ptr) != NULL, msg, #ptr " is NULL")
/**
* @brief Assert that @a a equals @a b
*
* @a a and @a b won't be converted and will be compared directly.
*
* @param a Value to compare
* @param b Value to compare
* @param msg Optional message to print if the assertion fails
*/
#define assert_equal(a, b, msg) assert((a) == (b), msg, #a " not equal to " #b)
/**
* @brief Assert that @a a does not equal @a b
*
* @a a and @a b won't be converted and will be compared directly.
*
* @param a Value to compare
* @param b Value to compare
* @param msg Optional message to print if the assertion fails
*/
#define assert_not_equal(a, b, msg) assert((a) != (b), msg, #a " equal to " #b)
/**
* @brief Assert that @a a equals @a b
*
* @a a and @a b will be converted to `void *` before comparing.
*
* @param a Value to compare
* @param b Value to compare
* @param msg Optional message to print if the assertion fails
*/
#define assert_equal_ptr(a, b, msg) \
assert((void *)(a) == (void *)(b), msg, #a " not equal to " #b)
/**
* @}
*/
#endif /* __ZTEST_ASSERT_H__ */
|
unsigned char feature_arsc[] = {
0x02, 0x00, 0x0c, 0x00, 0x40, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x1c, 0x00, 0x40, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x05, 0x00, 0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x33, 0x00,
0x00, 0x00, 0x05, 0x00, 0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00,
0x34, 0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0x01, 0xf4, 0x02, 0x00, 0x00,
0x7f, 0x00, 0x00, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x2e, 0x00,
0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x69, 0x00,
0x64, 0x00, 0x2e, 0x00, 0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00,
0x2e, 0x00, 0x62, 0x00, 0x61, 0x00, 0x73, 0x00, 0x69, 0x00, 0x63, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x1c, 0x00, 0x7c, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
0x2e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x3c, 0x00, 0x65, 0x00, 0x6d, 0x00,
0x70, 0x00, 0x74, 0x00, 0x79, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x04, 0x00,
0x61, 0x00, 0x74, 0x00, 0x74, 0x00, 0x72, 0x00, 0x00, 0x00, 0x06, 0x00,
0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00,
0x00, 0x00, 0x07, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x65, 0x00,
0x67, 0x00, 0x65, 0x00, 0x72, 0x00, 0x00, 0x00, 0x01, 0x00, 0x1c, 0x00,
0x58, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
0x05, 0x00, 0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x33, 0x00,
0x00, 0x00, 0x05, 0x00, 0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00,
0x34, 0x00, 0x00, 0x00, 0x07, 0x00, 0x6e, 0x00, 0x75, 0x00, 0x6d, 0x00,
0x62, 0x00, 0x65, 0x00, 0x72, 0x00, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x02, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x10, 0x00, 0x18, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x44, 0x00, 0x6c, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00,
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x03,
0x01, 0x00, 0x00, 0x00, 0x02, 0x02, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x02, 0x44, 0x00, 0x58, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x10,
0xc8, 0x00, 0x00, 0x00
};
unsigned int feature_arsc_len = 832;
|
/*
* 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.
*/
/**
* @file aws_iot_config.h
* @brief AWS IoT specific configuration file
*/
#ifndef SRC_SHADOW_IOT_SHADOW_CONFIG_H_
#define SRC_SHADOW_IOT_SHADOW_CONFIG_H_
// Get from console
// =================================================
#define AWS_IOT_MQTT_HOST "a3rwl3kghmkdtx.iot.us-west-2.amazonaws.com" ///< Customer specific MQTT HOST. The same will be used for Thing Shadow
#define AWS_IOT_MQTT_PORT 8883 ///< default port for MQTT/S
#define AWS_IOT_MQTT_CLIENT_ID "85g53"//"c-sdk-client-id" ///< MQTT client ID should be unique for every device
#define AWS_IOT_MY_THING_NAME "CC3200" ///< Thing Name of the Shadow this device is associated with
/*
* The following cert file variables are not used in this release. All
* cert files must exist in the "/cert" directory and be named "ca.der",
* "cert.der" and "key.der", as shown in the certflasher application. The
* ability to change this will be added in a future release.
*/
#define AWS_IOT_ROOT_CA_FILENAME "/cert/ca.der" ///< Root CA file name
#define AWS_IOT_CERTIFICATE_FILENAME "/cert/cert.der" ///< device signed certificate file name
#define AWS_IOT_PRIVATE_KEY_FILENAME "/cert/key.der" ///< Device private key filename
// =================================================
// MQTT PubSub
#define AWS_IOT_MQTT_TX_BUF_LEN 1024 ///< Any time a message is sent out through the MQTT layer. The message is copied into this buffer anytime a publish is done. This will also be used in the case of Thing Shadow
#define AWS_IOT_MQTT_RX_BUF_LEN 512 ///< Any message that comes into the device should be less than this buffer size. If a received message is bigger than this buffer size the message will be dropped.
#define AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS 5 ///< Maximum number of topic filters the MQTT client can handle at any given time. This should be increased appropriately when using Thing Shadow
// Thing Shadow specific configs
#define SHADOW_MAX_SIZE_OF_RX_BUFFER AWS_IOT_MQTT_RX_BUF_LEN+1 ///< Maximum size of the SHADOW buffer to store the received Shadow message
#define MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES 80 ///< Maximum size of the Unique Client Id. For More info on the Client Id refer \ref response "Acknowledgments"
#define MAX_SIZE_CLIENT_ID_WITH_SEQUENCE MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES + 10 ///< This is size of the extra sequence number that will be appended to the Unique client Id
#define MAX_SIZE_CLIENT_TOKEN_CLIENT_SEQUENCE MAX_SIZE_CLIENT_ID_WITH_SEQUENCE + 20 ///< This is size of the the total clientToken key and value pair in the JSON
#define MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME 10 ///< At Any given time we will wait for this many responses. This will correlate to the rate at which the shadow actions are requested
#define MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME 10 ///< We could perform shadow action on any thing Name and this is maximum Thing Names we can act on at any given time
#define MAX_JSON_TOKEN_EXPECTED 120 ///< These are the max tokens that is expected to be in the Shadow JSON document. Include the metadata that gets published
#define MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME 60 ///< All shadow actions have to be published or subscribed to a topic which is of the format $aws/things/{thingName}/shadow/update/accepted. This refers to the size of the topic without the Thing Name
#define MAX_SIZE_OF_THING_NAME 20 ///< The Thing Name should not be bigger than this value. Modify this if the Thing Name needs to be bigger
#define MAX_SHADOW_TOPIC_LENGTH_BYTES MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME + MAX_SIZE_OF_THING_NAME ///< This size includes the length of topic with Thing Name
// Auto Reconnect specific config
#define AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL 1000 ///< Minimum time before the First reconnect attempt is made as part of the exponential back-off algorithm
#define AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL 128000 ///< Maximum time interval after which exponential back-off will stop attempting to reconnect.
#endif /* SRC_SHADOW_IOT_SHADOW_CONFIG_H_ */
|
/*
* Copyright 2017 Google
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
typedef NS_ENUM(int8_t, FIRMessagingProtoTag) {
kFIRMessagingProtoTagInvalid = -1,
kFIRMessagingProtoTagHeartbeatPing = 0,
kFIRMessagingProtoTagHeartbeatAck = 1,
kFIRMessagingProtoTagLoginRequest = 2,
kFIRMessagingProtoTagLoginResponse = 3,
kFIRMessagingProtoTagClose = 4,
kFIRMessagingProtoTagIqStanza = 7,
kFIRMessagingProtoTagDataMessageStanza = 8,
};
@class GPBMessage;
#pragma mark - Protocol Buffers
FOUNDATION_EXPORT FIRMessagingProtoTag FIRMessagingGetTagForProto(GPBMessage *protoClass);
FOUNDATION_EXPORT Class FIRMessagingGetClassForTag(FIRMessagingProtoTag tag);
#pragma mark - MCS
FOUNDATION_EXPORT NSString *FIRMessagingGetRmq2Id(GPBMessage *proto);
FOUNDATION_EXPORT void FIRMessagingSetRmq2Id(GPBMessage *proto, NSString *pID);
FOUNDATION_EXPORT int FIRMessagingGetLastStreamId(GPBMessage *proto);
FOUNDATION_EXPORT void FIRMessagingSetLastStreamId(GPBMessage *proto, int sid);
#pragma mark - Time
FOUNDATION_EXPORT int64_t FIRMessagingCurrentTimestampInSeconds();
FOUNDATION_EXPORT int64_t FIRMessagingCurrentTimestampInMilliseconds();
#pragma mark - App Info
FOUNDATION_EXPORT NSString *FIRMessagingCurrentAppVersion();
FOUNDATION_EXPORT NSString *FIRMessagingAppIdentifier();
FOUNDATION_EXPORT uint64_t FIRMessagingGetFreeDiskSpaceInMB();
|
/*
* 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/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/transcribestreaming/model/AudioEvent.h>
#include <utility>
#include <aws/core/utils/event/EventStream.h>
namespace Aws
{
namespace TranscribeStreamingService
{
namespace Model
{
/**
* <p>Represents the audio stream from your application to Amazon
* Transcribe.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/AudioStream">AWS
* API Reference</a></p>
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API AudioStream : public Aws::Utils::Event::EventEncoderStream
{
public:
AudioStream& WriteAudioEvent(const AudioEvent& value)
{
Aws::Utils::Event::Message msg;
msg.InsertEventHeader(":message-type", Aws::String("event"));
msg.InsertEventHeader(":event-type", Aws::String("AudioEvent"));
msg.InsertEventHeader(":content-type", Aws::String("application/octet-stream"));
msg.WriteEventPayload(value.GetAudioChunk());
WriteEvent(msg);
return *this;
}
};
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws
|
#include <stdio.h>
#include <stdint.h>
#include <arpa/inet.h>
static const int ECN_NOT_ECT = 0;
static const int ECN_ECT_1 = 1;
static const int ECN_ECT_0 = 2;
static const int ECN_CE = 3;
int matches_udp(uint16_t port, int perc11, int perc10, int perc01) {
return matches_value(ntohs(port), perc11, perc10, perc01);
}
int matches_ip(uint32_t ip, int perc11, int perc10, int perc01) {
return matches_value(ntohl(ip), perc11, perc10, perc01);
}
int matches_value(uint32_t match_val, int perc11, int perc10, int perc01) {
if (perc11 == 100) {
return ECN_CE;
} else if (perc11 == 0 && perc10 == 0 && perc01 == 0) {
return ECN_NOT_ECT;
}
if (perc11 && (match_val % (int)100/(perc11)) == 0)
return ECN_CE;
else if (perc10 && (match_val % (int)(100-perc11)/perc10) == 0)
return ECN_ECT_1;
else if (perc01 && (match_val % (int)(100-perc11-perc10)/perc01) == 0)
return ECN_ECT_0;
else
return ECN_NOT_ECT;
}
void test_ports() {
int i;
uint32_t port;
int ecn_ce_count = 0;
int ecn_ect_1_count = 0;
int ecn_ect_0_count = 0;
int ecn_not_ect_count = 0;
int res;
for (i=0; i<=100; i++) {
ecn_ce_count = 0;
ecn_ect_1_count = 0;
ecn_ect_0_count = 0;
ecn_not_ect_count = 0;
for (port = 1; port < 65535; port++) {
res = matches_udp(port, i, i, i);
if (res == ECN_CE) {
ecn_ce_count++;
}
else if (res == ECN_ECT_1) {
ecn_ect_1_count++;
}
else if (res == ECN_ECT_0) {
ecn_ect_0_count++;
}
else if (res == ECN_NOT_ECT) {
ecn_not_ect_count++;
}
}
printf("[%d] ce_count = %d ect_1_count: %d ect_0_count: %d ecn_not_ect_count %d <%d><%d><%d><%d>\n",
i, ecn_ce_count, ecn_ect_1_count, ecn_ect_0_count, ecn_not_ect_count,
(int)(0.5+(100.0*ecn_ce_count)/65535),
(int)(0.5+(100.0*ecn_ect_1_count)/65535),
(int)(0.5+(100.0*ecn_ect_0_count)/65535),
(int)(0.5+(100.0*ecn_not_ect_count)/65535));
}
}
void test_ips() {
int i;
uint32_t ip;
int ecn_ce_count = 0;
int ecn_ect_1_count = 0;
int ecn_ect_0_count = 0;
int ecn_not_ect_count = 0;
int res;
for (i=0; i<=100; i++) {
ecn_ce_count = 0;
ecn_ect_1_count = 0;
ecn_ect_0_count = 0;
ecn_not_ect_count = 0;
for (ip = 1; ip < 2147483647; ip++) {
res = matches_ip(ip, i, i, i);
if (res == ECN_CE) {
ecn_ce_count++;
}
else if (res == ECN_ECT_1) {
ecn_ect_1_count++;
}
else if (res == ECN_ECT_0) {
ecn_ect_0_count++;
}
else if (res == ECN_NOT_ECT) {
ecn_not_ect_count++;
}
}
printf("[%d] ce_count = %d ect_1_count: %d ect_0_count: %d ecn_not_ect_count %d <%d><%d><%d><%d>\n",
i, ecn_ce_count, ecn_ect_1_count, ecn_ect_0_count, ecn_not_ect_count,
(int)(0.5+(100.0*ecn_ce_count)/65535),
(int)(0.5+(100.0*ecn_ect_1_count)/65535),
(int)(0.5+(100.0*ecn_ect_0_count)/65535),
(int)(0.5+(100.0*ecn_not_ect_count)/65535));
}
}
int main() {
test_ports();
test_ips();
}
|
#import <UIKit/UIKit.h>
#import "SettingsViewController.h"
//extern NSString * const UsernameKey;
//extern NSString * const PasswordKey;
//extern NSString * const HostnameKey;
@class ADZLoginViewController;
@protocol ADZLoginViewControllerDelegate <NSObject>
@optional
- (void)accountHasFinishSetting:(ADZLoginViewController *)loginVC;
@end
@interface ADZLoginViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *account;
@property (weak, nonatomic) IBOutlet UITextField *password;
@property (weak, nonatomic) IBOutlet UITextField *host;
@property (weak, nonatomic) id<ADZLoginViewControllerDelegate> delegate;
- (IBAction)doneEditing:(id)sender;
- (IBAction)backUpTouch:(id)sender;
- (IBAction)login:(id)sender;
@end
|
typedef NS_ENUM(NSInteger, SovrinErrorCode)
{
Success = 0,
// Common errors
// Caller passed invalid value as param 1 (null, invalid json and etc..)
CommonInvalidParam1 = 100,
// Caller passed invalid value as param 2 (null, invalid json and etc..)
CommonInvalidParam2,
// Caller passed invalid value as param 3 (null, invalid json and etc..)
CommonInvalidParam3,
// Caller passed invalid value as param 4 (null, invalid json and etc..)
CommonInvalidParam4,
// Caller passed invalid value as param 5 (null, invalid json and etc..)
CommonInvalidParam5,
// Caller passed invalid value as param 6 (null, invalid json and etc..)
CommonInvalidParam6,
// Caller passed invalid value as param 7 (null, invalid json and etc..)
CommonInvalidParam7,
// Caller passed invalid value as param 8 (null, invalid json and etc..)
CommonInvalidParam8,
// Caller passed invalid value as param 9 (null, invalid json and etc..)
CommonInvalidParam9,
// Invalid library state was detected in runtime. It signals library bug
CommonInvalidState,
// Wallet errors
// Caller passed invalid wallet handle
WalletInvalidHandle = 200,
// Unknown type of wallet was passed on create_wallet
WalletUnknownTypeError,
// Attempt to register already existing wallet type
WalletTypeAlreadyRegisteredError,
// Attempt to create wallet with name used for another exists wallet
WalletAlreadyExistsError,
// Requested entity id isn't present in wallet
WalletNotFoundError,
// Wallet files referenced in open_wallet have invalid data format
WalletInvalidDataFormat,
// IO error during access wallet backend
WalletIOError,
// Trying to use wallet with pool that has different name
WalletIncompatiblePoolError,
// Trying to open wallet with invalid configuration
WalletInvalidConfiguration,
// Error in wallet backend
WalletBackendError,
// Ledger errors
// Trying to open pool ledger that wasn't created before
PoolLedgerNotCreatedError = 300,
// Invalid pool ledger configuration was passed to open_pool_ledger or create_pool_ledger
PoolLedgerInvalidConfiguration,
// Pool ledger files referenced in open_pool_ledger have invalid data format
PoolLedgerInvalidDataFormat,
// Caller passed invalid pool ledger handle
PoolLedgerInvalidPoolHandle,
// IO error during access pool ledger files
PoolLedgerIOError,
// No concensus during ledger operation
LedgerNoConsensusError,
// Attempt to send unknown or incomplete transaction message
LedgerInvalidTransaction,
// Attempt to send transaction without the necessary privileges
LedgerSecurityError,
// IO error during sending of ledger transactions or catchup process
LedgerIOError,
// Crypto errors
// Invalid structure of any crypto promitives (keys, signatures, seeds and etc...)
CryptoInvalidStructure = 400,
// Unknown crypto type was requested for signing/verifiyng or encoding/decoding
CryptoUnknownTypeError,
// Revocation registry is full and creation of new registry is necessary
CryptoRevocationRegistryFullError,
CryptoInvalidUserRevocIndex,
// Error in crypto backend
CryptoBackendError,
AnoncredsNotIssuedError,
// Attempt to generate master secret with dupplicated name
AnoncredsMasterSecretDuplicateNameError,
ProofRejected
};
|
#import <Foundation/Foundation.h>
@class GCDAsyncSocket;
@class HTTPMessage;
@class HTTPServer;
@class WebSocket;
@protocol HTTPResponse;
#define HTTPConnectionDidDieNotification @"HTTPConnectionDidDie"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark -
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@interface HTTPConfig : NSObject
{
HTTPServer __unsafe_unretained *server;
NSString __strong *documentRoot;
dispatch_queue_t queue;
NSDictionary *context;
}
- (id)initWithServer:(HTTPServer *)server documentRoot:(NSString *)documentRoot;
- (id)initWithServer:(HTTPServer *)server documentRoot:(NSString *)documentRoot queue:(dispatch_queue_t)q;
@property (nonatomic, unsafe_unretained, readonly) HTTPServer *server;
@property (nonatomic, strong, readonly) NSString *documentRoot;
@property (nonatomic, readonly) dispatch_queue_t queue;
@property (nonatomic, strong) NSDictionary *context;
@end
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark -
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@interface HTTPConnection : NSObject
{
dispatch_queue_t connectionQueue;
GCDAsyncSocket *asyncSocket;
HTTPConfig *config;
BOOL started;
HTTPMessage *request;
unsigned int numHeaderLines;
BOOL sentResponseHeaders;
NSString *nonce;
long lastNC;
NSObject<HTTPResponse> *httpResponse;
NSMutableArray *ranges;
NSMutableArray *ranges_headers;
NSString *ranges_boundry;
int rangeIndex;
UInt64 requestContentLength;
UInt64 requestContentLengthReceived;
UInt64 requestChunkSize;
UInt64 requestChunkSizeReceived;
NSMutableArray *responseDataSizes;
}
- (id)initWithAsyncSocket:(GCDAsyncSocket *)newSocket configuration:(HTTPConfig *)aConfig;
- (void)start;
- (void)stop;
- (void)startConnection;
- (BOOL)supportsMethod:(NSString *)method atPath:(NSString *)path;
- (BOOL)expectsRequestBodyFromMethod:(NSString *)method atPath:(NSString *)path;
- (BOOL)isSecureServer;
- (NSArray *)sslIdentityAndCertificates;
- (BOOL)isPasswordProtected:(NSString *)path;
- (BOOL)useDigestAccessAuthentication;
- (NSString *)realm;
- (NSString *)passwordForUser:(NSString *)username;
- (NSDictionary *)parseParams:(NSString *)query;
- (NSDictionary *)parseGetParams;
- (NSString *)requestURI;
- (NSArray *)directoryIndexFileNames;
- (NSString *)filePathForURI:(NSString *)path;
- (NSString *)filePathForURI:(NSString *)path allowDirectory:(BOOL)allowDirectory;
- (NSObject<HTTPResponse> *)httpResponseForMethod:(NSString *)method URI:(NSString *)path;
- (WebSocket *)webSocketForURI:(NSString *)path;
- (void)prepareForBodyWithSize:(UInt64)contentLength;
- (void)processBodyData:(NSData *)postDataChunk;
- (void)finishBody;
- (void)handleVersionNotSupported:(NSString *)version;
- (void)handleAuthenticationFailed;
- (void)handleResourceNotFound;
- (void)handleInvalidRequest:(NSData *)data;
- (void)handleUnknownMethod:(NSString *)method;
- (NSData *)preprocessResponse:(HTTPMessage *)response;
- (NSData *)preprocessErrorResponse:(HTTPMessage *)response;
- (void)finishResponse;
- (BOOL)shouldDie;
- (void)die;
@end
@interface HTTPConnection (AsynchronousHTTPResponse)
- (void)responseHasAvailableData:(NSObject<HTTPResponse> *)sender;
- (void)responseDidAbort:(NSObject<HTTPResponse> *)sender;
@end
|
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef URLFETCH_STREAM_WRAPPER_H_
#define URLFETCH_STREAM_WRAPPER_H_
extern "C" {
#ifdef __google_internal__
#include "php/Zend/zend_modules.h"
#else
#include "Zend/zend_modules.h"
#endif
}
namespace appengine {
extern zend_module_entry urlfetch_stream_wrapper_module_entry;
} // namespace appengine
#endif // URLFETCH_STREAM_WRAPPER_H_
|
//
// FXBlurView.h
//
// Version 1.5.3
//
// Created by Nick Lockwood on 25/08/2013.
// Copyright (c) 2013 Charcoal Design
//
// Distributed under the permissive zlib License
// Get the latest version from here:
//
// https://github.com/nicklockwood/FXBlurView
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.
//
#import <UIKit/UIKit.h>
#import <Accelerate/Accelerate.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wobjc-missing-property-synthesis"
#import <Availability.h>
#undef weak_delegate
#if __has_feature(objc_arc) && __has_feature(objc_arc_weak)
#define weak_ref weak
#else
#define weak_ref unsafe_unretained
#endif
@interface UIImage (FXBlurView)
- (UIImage *)blurredImageWithRadius:(CGFloat)radius iterations:(NSUInteger)iterations tintColor:(UIColor *)tintColor;
@end
@interface FXBlurView : UIView
+ (void)setBlurEnabled:(BOOL)blurEnabled;
+ (void)setUpdatesEnabled;
+ (void)setUpdatesDisabled;
@property (nonatomic, getter = isBlurEnabled) BOOL blurEnabled;
@property (nonatomic, getter = isDynamic) BOOL dynamic;
@property (nonatomic, assign) NSUInteger iterations;
@property (nonatomic, assign) NSTimeInterval updateInterval;
@property (nonatomic, assign) CGFloat blurRadius;
@property (nonatomic, strong) UIColor *tintColor;
@property (nonatomic, weak_ref) UIView *underlyingView;
- (void)updateAsynchronously:(BOOL)async completion:(void (^)())completion;
@end
#pragma GCC diagnostic pop |
/*
* 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/ssm/SSM_EXPORTS.h>
#include <aws/ssm/model/AutomationExecutionFilterKey.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace SSM
{
namespace Model
{
/**
* <p>A filter used to match specific automation executions. This is used to limit
* the scope of Automation execution information returned.</p><p><h3>See Also:</h3>
* <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AutomationExecutionFilter">AWS
* API Reference</a></p>
*/
class AWS_SSM_API AutomationExecutionFilter
{
public:
AutomationExecutionFilter();
AutomationExecutionFilter(Aws::Utils::Json::JsonView jsonValue);
AutomationExecutionFilter& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>One or more keys to limit the results. Valid filter keys include the
* following: DocumentNamePrefix, ExecutionStatus, ExecutionId, ParentExecutionId,
* CurrentAction, StartTimeBefore, StartTimeAfter.</p>
*/
inline const AutomationExecutionFilterKey& GetKey() const{ return m_key; }
/**
* <p>One or more keys to limit the results. Valid filter keys include the
* following: DocumentNamePrefix, ExecutionStatus, ExecutionId, ParentExecutionId,
* CurrentAction, StartTimeBefore, StartTimeAfter.</p>
*/
inline void SetKey(const AutomationExecutionFilterKey& value) { m_keyHasBeenSet = true; m_key = value; }
/**
* <p>One or more keys to limit the results. Valid filter keys include the
* following: DocumentNamePrefix, ExecutionStatus, ExecutionId, ParentExecutionId,
* CurrentAction, StartTimeBefore, StartTimeAfter.</p>
*/
inline void SetKey(AutomationExecutionFilterKey&& value) { m_keyHasBeenSet = true; m_key = std::move(value); }
/**
* <p>One or more keys to limit the results. Valid filter keys include the
* following: DocumentNamePrefix, ExecutionStatus, ExecutionId, ParentExecutionId,
* CurrentAction, StartTimeBefore, StartTimeAfter.</p>
*/
inline AutomationExecutionFilter& WithKey(const AutomationExecutionFilterKey& value) { SetKey(value); return *this;}
/**
* <p>One or more keys to limit the results. Valid filter keys include the
* following: DocumentNamePrefix, ExecutionStatus, ExecutionId, ParentExecutionId,
* CurrentAction, StartTimeBefore, StartTimeAfter.</p>
*/
inline AutomationExecutionFilter& WithKey(AutomationExecutionFilterKey&& value) { SetKey(std::move(value)); return *this;}
/**
* <p>The values used to limit the execution information associated with the
* filter's key.</p>
*/
inline const Aws::Vector<Aws::String>& GetValues() const{ return m_values; }
/**
* <p>The values used to limit the execution information associated with the
* filter's key.</p>
*/
inline void SetValues(const Aws::Vector<Aws::String>& value) { m_valuesHasBeenSet = true; m_values = value; }
/**
* <p>The values used to limit the execution information associated with the
* filter's key.</p>
*/
inline void SetValues(Aws::Vector<Aws::String>&& value) { m_valuesHasBeenSet = true; m_values = std::move(value); }
/**
* <p>The values used to limit the execution information associated with the
* filter's key.</p>
*/
inline AutomationExecutionFilter& WithValues(const Aws::Vector<Aws::String>& value) { SetValues(value); return *this;}
/**
* <p>The values used to limit the execution information associated with the
* filter's key.</p>
*/
inline AutomationExecutionFilter& WithValues(Aws::Vector<Aws::String>&& value) { SetValues(std::move(value)); return *this;}
/**
* <p>The values used to limit the execution information associated with the
* filter's key.</p>
*/
inline AutomationExecutionFilter& AddValues(const Aws::String& value) { m_valuesHasBeenSet = true; m_values.push_back(value); return *this; }
/**
* <p>The values used to limit the execution information associated with the
* filter's key.</p>
*/
inline AutomationExecutionFilter& AddValues(Aws::String&& value) { m_valuesHasBeenSet = true; m_values.push_back(std::move(value)); return *this; }
/**
* <p>The values used to limit the execution information associated with the
* filter's key.</p>
*/
inline AutomationExecutionFilter& AddValues(const char* value) { m_valuesHasBeenSet = true; m_values.push_back(value); return *this; }
private:
AutomationExecutionFilterKey m_key;
bool m_keyHasBeenSet;
Aws::Vector<Aws::String> m_values;
bool m_valuesHasBeenSet;
};
} // namespace Model
} // namespace SSM
} // namespace Aws
|
/*
* Copyright (c) 2008-2013 Apple Inc. All rights reserved.
*
* @APPLE_APACHE_LICENSE_HEADER_START@
*
* 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.
*
* @APPLE_APACHE_LICENSE_HEADER_END@
*/
#include "internal.h"
#undef dispatch_once
#undef dispatch_once_f
#ifdef __BLOCKS__
void
dispatch_once(dispatch_once_t *val, dispatch_block_t block)
{
dispatch_once_f(val, block, _dispatch_Block_invoke(block));
}
#endif
#if DISPATCH_ONCE_INLINE_FASTPATH
#define DISPATCH_ONCE_SLOW_INLINE inline DISPATCH_ALWAYS_INLINE
#else
#define DISPATCH_ONCE_SLOW_INLINE DISPATCH_NOINLINE
#endif // DISPATCH_ONCE_INLINE_FASTPATH
DISPATCH_NOINLINE
static void
_dispatch_once_callout(dispatch_once_gate_t l, void *ctxt,
dispatch_function_t func)
{
_dispatch_client_callout(ctxt, func);
_dispatch_once_gate_broadcast(l);
}
DISPATCH_NOINLINE
void
dispatch_once_f(dispatch_once_t *val, void *ctxt, dispatch_function_t func)
{
dispatch_once_gate_t l = (dispatch_once_gate_t)val;
#if !DISPATCH_ONCE_INLINE_FASTPATH || DISPATCH_ONCE_USE_QUIESCENT_COUNTER
uintptr_t v = os_atomic_load(&l->dgo_once, acquire);
if (likely(v == DLOCK_ONCE_DONE)) {
return;
}
#if DISPATCH_ONCE_USE_QUIESCENT_COUNTER
if (likely(DISPATCH_ONCE_IS_GEN(v))) {
return _dispatch_once_mark_done_if_quiesced(l, v);
}
#endif
#endif
if (_dispatch_once_gate_tryenter(l)) {
return _dispatch_once_callout(l, ctxt, func);
}
return _dispatch_once_wait(l);
}
|
//
// TRWeatherViewController.h
// TRWeather
//
// Created by apple on 15/8/10.
// Copyright (c) 2015年 apple. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TRWeatherViewController : UIViewController
@end
|
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 50baf5cf9d96692d9d6809216298812c8416eb88 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Swoole_Process___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, redirect_stdin_and_stdout, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pipe_type, IS_LONG, 0, "SOCK_DGRAM")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable_coroutine, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Swoole_Process___destruct, 0, 0, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_useQueue, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "2")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, capacity, IS_LONG, 0, "-1")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Swoole_Process_statQueue, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_freeQueue, 0, 0, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Swoole_Process_pop, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, size, IS_LONG, 0, "65536")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_push, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_kill, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, pid, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, signal_no, IS_LONG, 0, "SIGTERM")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_signal, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, signal_no, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_alarm, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, usec, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Swoole_Process_wait, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, blocking, _IS_BOOL, 0, "true")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_daemon, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nochdir, _IS_BOOL, 0, "true")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, noclose, _IS_BOOL, 0, "true")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pipes, IS_ARRAY, 0, "[]")
ZEND_END_ARG_INFO()
#if defined(HAVE_CPU_AFFINITY)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_setAffinity, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, cpu_settings, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
#endif
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_set, 0, 1, IS_VOID, 0)
ZEND_ARG_TYPE_INFO(0, settings, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_setTimeout, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, seconds, IS_DOUBLE, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_setBlocking, 0, 1, IS_VOID, 0)
ZEND_ARG_TYPE_INFO(0, blocking, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_setPriority, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, which, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, priority, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_getPriority, 0, 1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, which, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Swoole_Process_start, 0, 0, MAY_BE_BOOL|MAY_BE_LONG)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Swoole_Process_write, 0, 1, MAY_BE_FALSE|MAY_BE_LONG)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Swoole_Process_read, 0, 0, MAY_BE_FALSE|MAY_BE_STRING)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, size, IS_LONG, 0, "8192")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_close, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, which, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_exit, 0, 0, IS_VOID, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, exit_code, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_exec, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, exec_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, args, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Swoole_Process_exportSocket, 0, 0, Swoole\\Coroutine\\Socket, MAY_BE_FALSE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Swoole_Process_name, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, process_name, IS_STRING, 0)
ZEND_END_ARG_INFO()
|
//
// FYCollectionViewCell.h
// MyApp
//
// Created by FuYu on 15/11/19.
// Copyright © 2015年 FuYu. All rights reserved.
//
#import <UIKit/UIKit.h>
@class FYProject;
@interface FYCollectionViewCell : UICollectionViewCell
@property (nonatomic, strong) FYProject *project;
@end
|
/*
*
* honggfuzz - tracing processes with ptrace()
* -----------------------------------------
*
* Author: Robert Swiecki <swiecki@google.com>
*
* Copyright 2010-2017 by 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 _HF_LINUX_TRACE_H_
#define _HF_LINUX_TRACE_H_
#include <inttypes.h>
#include "honggfuzz.h"
#define _HF_DYNFILE_SUB_MASK 0xFFFUL // Zero-set two MSB
/* Constant prefix used for single frame crashes stackhash masking */
#define _HF_SINGLE_FRAME_MASK 0xBADBAD0000000000
extern bool arch_traceWaitForPidStop(pid_t pid);
extern bool arch_traceEnable(honggfuzz_t* hfuzz);
extern void arch_traceAnalyze(honggfuzz_t* hfuzz, int status, pid_t pid, fuzzer_t* fuzzer);
extern void arch_traceExitAnalyze(honggfuzz_t* hfuzz, pid_t pid, fuzzer_t* fuzzer);
extern bool arch_traceAttach(honggfuzz_t* hfuzz, pid_t pid);
extern void arch_traceDetach(pid_t pid);
extern void arch_traceGetCustomPerf(honggfuzz_t* hfuzz, pid_t pid, uint64_t* cnt);
extern void arch_traceSetCustomPerf(honggfuzz_t* hfuzz, pid_t pid, uint64_t cnt);
extern void arch_traceSignalsInit(honggfuzz_t* hfuzz);
#endif
|
/*
* Copyright 2010 William R. Swanson
*
* 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.
*/
/* Writes bytes to a file, and returns 0 for failure. */
#define file_write(file, p, end) (fwrite(p, 1, end - p, file) == end - p)
#define file_putc(file, c) (fputc(c, file) != EOF)
/**
* Removes the leading and trailing underscores from an identifier.
*/
String strip_symbol(String s)
{
while (s.p < s.end && *s.p == '_')
++s.p;
while (s.p < s.end && s.end[-1] == '_')
--s.end;
return s;
}
/**
* Locates individual words within an identifier. The identifier must have its
* leading and trailing underscores stripped off before being passed to this
* function. As always, the only valid symbols within an identifier are
* [_a-zA-Z0-9]
* @param s the input string to break into words
* @param p a pointer into string s, which marks the first character to begin
* scanning at.
* @return the next located word, or a null string upon reaching the end of the
* input
*/
String scan_symbol(String s, char const *p)
{
char const *start;
/* Trim underscores between words: */
while (p < s.end && *p == '_')
++p;
if (p == s.end)
return string_null();
start = p;
/* Numbers? */
if ('0' <= *p && *p <= '9') {
do {
++p;
} while (p < s.end && '0' <= *p && *p <= '9');
return string(start, p);
}
/* Lower-case letters? */
if ('a' <= *p && *p <= 'z') {
do {
++p;
} while (p < s.end && 'a' <= *p && *p <= 'z');
return string(start, p);
}
/* Upper-case letters? */
if ('A' <= *p && *p <= 'Z') {
do {
++p;
} while (p < s.end && 'A' <= *p && *p <= 'Z');
/* Did the last upper-case letter start a lower-case word? */
if (p < s.end && 'a' <= *p && *p <= 'z') {
--p;
if (p == start) {
do {
++p;
} while (p < s.end && 'a' <= *p && *p <= 'z');
}
}
return string(start, p);
}
/* Anything else is a bug */
assert(0);
return string_null();
}
/**
* Writes leading underscores to a file, if any.
* @param s the entire string, including leading and trailing underscores.
* @param inner the inner portion of the string after underscores have been
* stripped.
* @return 0 for failure
*/
int write_leading(FILE *out, String s, String inner)
{
if (s.p != inner.p)
return file_write(out, s.p, inner.p);
return 1;
}
int write_trailing(FILE *out, String s, String inner)
{
if (inner.end != s.end)
return file_write(out, inner.end, s.end);
return 1;
}
/**
* Writes a word to a file in lower case.
*/
int write_lower(FILE *out, String s)
{
char const *p;
for (p = s.p; p != s.end; ++p) {
char c = 'A' <= *p && *p <= 'Z' ? *p - 'A' + 'a' : *p;
CHECK(file_putc(out, c));
}
return 1;
}
/**
* Writes a word to a file in UPPER case.
*/
int write_upper(FILE *out, String s)
{
char const *p;
for (p = s.p; p != s.end; ++p) {
char c = 'a' <= *p && *p <= 'z' ? *p - 'a' + 'A' : *p;
CHECK(file_putc(out, c));
}
return 1;
}
/**
* Writes a word to a file in Capitalized case.
*/
int write_cap(FILE *out, String s)
{
char const *p;
for (p = s.p; p != s.end; ++p) {
char c = (p == s.p) ?
('a' <= *p && *p <= 'z' ? *p - 'a' + 'A' : *p) :
('A' <= *p && *p <= 'Z' ? *p - 'A' + 'a' : *p) ;
CHECK(file_putc(out, c));
}
return 1;
}
/**
* Writes a string to the output file, converting it to lower_case
*/
int generate_lower(FILE *out, String s)
{
String inner = strip_symbol(s);
String word = scan_symbol(inner, inner.p);
write_leading(out, s, inner);
while (string_size(word)) {
write_lower(out, word);
word = scan_symbol(inner, word.end);
if (string_size(word))
CHECK(file_putc(out, '_'));
}
write_trailing(out, s, inner);
return 1;
}
/**
* Writes a string to the output file, converting it to UPPER_CASE
*/
int generate_upper(FILE *out, String s)
{
String inner = strip_symbol(s);
String word = scan_symbol(inner, inner.p);
write_leading(out, s, inner);
while (string_size(word)) {
write_upper(out, word);
word = scan_symbol(inner, word.end);
if (string_size(word))
CHECK(file_putc(out, '_'));
}
write_trailing(out, s, inner);
return 1;
}
/**
* Writes a string to the output file, converting it to CamelCase
*/
int generate_camel(FILE *out, String s)
{
String inner = strip_symbol(s);
String word = scan_symbol(inner, inner.p);
write_leading(out, s, inner);
while (string_size(word)) {
write_cap(out, word);
word = scan_symbol(inner, word.end);
}
write_trailing(out, s, inner);
return 1;
}
/**
* Writes a string to the output file, converting it to mixedCase
*/
int generate_mixed(FILE *out, String s)
{
String inner = strip_symbol(s);
String word = scan_symbol(inner, inner.p);
write_leading(out, s, inner);
if (string_size(word)) {
write_lower(out, word);
word = scan_symbol(inner, word.end);
}
while (string_size(word)) {
write_cap(out, word);
word = scan_symbol(inner, word.end);
}
write_trailing(out, s, inner);
return 1;
}
|
/*******************************************************************************
* 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_HEADERS_TPARTY_H
#define LIBND4J_HEADERS_TPARTY_H
#include <ops/declarable/headers/common.h>
namespace nd4j {
namespace ops {
#if NOT_EXCLUDED(OP_firas_sparse)
DECLARE_CUSTOM_OP(firas_sparse, 1, 1, false, 0, -1);
#endif
}
}
#endif |
//
// UserInfoDTO.h
// MDKinderGarten
//
// Created by zhouyongchao on 16/1/27.
// Copyright © 2016年 zhouyongchao. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UserInfoDTO : NSObject<NSCoding>
@property (copy, nonatomic) NSString *userId;
@property (copy, nonatomic) NSString *userName;
@property (copy, nonatomic) NSString *classId;
@property (copy, nonatomic) NSString *userPassword;
@property (copy, nonatomic) NSString *userHeadUrl;
@property (copy, nonatomic) NSString *userToken;
- (instancetype)initWithUserId:(NSString *)userId
userName:(NSString *)userName
classId:(NSString *)classId
userPassword:(NSString *)userPassword
userHeadUrl:(NSString *)userHeadUrl
token:(NSString *)token;
@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/email/SES_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/email/model/VerificationStatus.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace SES
{
namespace Model
{
/**
* <p>Represents the verification attributes of a single identity.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/IdentityVerificationAttributes">AWS
* API Reference</a></p>
*/
class AWS_SES_API IdentityVerificationAttributes
{
public:
IdentityVerificationAttributes();
IdentityVerificationAttributes(const Aws::Utils::Xml::XmlNode& xmlNode);
IdentityVerificationAttributes& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
void OutputToStream(Aws::OStream& oStream, const char* location) const;
/**
* <p>The verification status of the identity: "Pending", "Success", "Failed", or
* "TemporaryFailure".</p>
*/
inline const VerificationStatus& GetVerificationStatus() const{ return m_verificationStatus; }
/**
* <p>The verification status of the identity: "Pending", "Success", "Failed", or
* "TemporaryFailure".</p>
*/
inline bool VerificationStatusHasBeenSet() const { return m_verificationStatusHasBeenSet; }
/**
* <p>The verification status of the identity: "Pending", "Success", "Failed", or
* "TemporaryFailure".</p>
*/
inline void SetVerificationStatus(const VerificationStatus& value) { m_verificationStatusHasBeenSet = true; m_verificationStatus = value; }
/**
* <p>The verification status of the identity: "Pending", "Success", "Failed", or
* "TemporaryFailure".</p>
*/
inline void SetVerificationStatus(VerificationStatus&& value) { m_verificationStatusHasBeenSet = true; m_verificationStatus = std::move(value); }
/**
* <p>The verification status of the identity: "Pending", "Success", "Failed", or
* "TemporaryFailure".</p>
*/
inline IdentityVerificationAttributes& WithVerificationStatus(const VerificationStatus& value) { SetVerificationStatus(value); return *this;}
/**
* <p>The verification status of the identity: "Pending", "Success", "Failed", or
* "TemporaryFailure".</p>
*/
inline IdentityVerificationAttributes& WithVerificationStatus(VerificationStatus&& value) { SetVerificationStatus(std::move(value)); return *this;}
/**
* <p>The verification token for a domain identity. Null for email address
* identities.</p>
*/
inline const Aws::String& GetVerificationToken() const{ return m_verificationToken; }
/**
* <p>The verification token for a domain identity. Null for email address
* identities.</p>
*/
inline bool VerificationTokenHasBeenSet() const { return m_verificationTokenHasBeenSet; }
/**
* <p>The verification token for a domain identity. Null for email address
* identities.</p>
*/
inline void SetVerificationToken(const Aws::String& value) { m_verificationTokenHasBeenSet = true; m_verificationToken = value; }
/**
* <p>The verification token for a domain identity. Null for email address
* identities.</p>
*/
inline void SetVerificationToken(Aws::String&& value) { m_verificationTokenHasBeenSet = true; m_verificationToken = std::move(value); }
/**
* <p>The verification token for a domain identity. Null for email address
* identities.</p>
*/
inline void SetVerificationToken(const char* value) { m_verificationTokenHasBeenSet = true; m_verificationToken.assign(value); }
/**
* <p>The verification token for a domain identity. Null for email address
* identities.</p>
*/
inline IdentityVerificationAttributes& WithVerificationToken(const Aws::String& value) { SetVerificationToken(value); return *this;}
/**
* <p>The verification token for a domain identity. Null for email address
* identities.</p>
*/
inline IdentityVerificationAttributes& WithVerificationToken(Aws::String&& value) { SetVerificationToken(std::move(value)); return *this;}
/**
* <p>The verification token for a domain identity. Null for email address
* identities.</p>
*/
inline IdentityVerificationAttributes& WithVerificationToken(const char* value) { SetVerificationToken(value); return *this;}
private:
VerificationStatus m_verificationStatus;
bool m_verificationStatusHasBeenSet;
Aws::String m_verificationToken;
bool m_verificationTokenHasBeenSet;
};
} // namespace Model
} // namespace SES
} // namespace Aws
|
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stdlib/strided/base/unary/i_d.h"
#include "stdlib/strided/base/unary/macros.h"
#include <stdint.h>
/**
* Applies a unary callback accepting and returning signed 32-bit integers to an signed 32-bit integer strided input array, casts the callback's signed 32-bit integer return value to a double-precision floating-point number, and assigns results to elements in a double-precision floating-point strided output array.
*
* @param arrays array whose first element is a pointer to a strided input array and whose last element is a pointer to a strided output array
* @param shape array whose only element is the number of elements over which to iterate
* @param strides array containing strides (in bytes) for each strided array
* @param fcn callback
*
* @example
* #include "stdlib/strided/base/unary/i_d.h"
* #include <stdint.h>
*
* // Create underlying byte arrays:
* uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define a pointer to an array containing pointers to strided arrays:
* uint8_t *arrays[] = { x, out };
*
* // Define the strides:
* int64_t strides[] = { 4, 8 }; // 4 bytes per int32, 8 bytes per double
*
* // Define the number of elements over which to iterate:
* int64_t shape[] = { 3 };
*
* // Define a callback:
* int32_t scale( const int32_t x ) {
* return x + 10;
* }
*
* // Apply the callback:
* stdlib_strided_i_d( arrays, shape, strides, (void *)scale );
*/
void stdlib_strided_i_d( uint8_t *arrays[], int64_t *shape, int64_t *strides, void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_STRIDED_UNARY_LOOP_CLBK( int32_t, double )
}
|
#ifndef CEXCELWRAPPER_H
#define CEXCELWRAPPER_H
#include <QString>
#include <ActiveQt/QAxObject>
#include <QDebug>
class CExcelWrapper
{
QScopedPointer<QAxObject> excelApplication;
QAxObject* workbooks;
QAxObject* workbook;
QAxObject* worksheets;
QAxObject* worksheet;
public:
CExcelWrapper();
~CExcelWrapper();
void OpenFile( QString fileName );
void SaveFile( void );
void SaveAsFile( QString fileName);
void SetStringValue(const char *range, const QString value);
};
#endif // CEXCELWRAPPER_H
|
//
// FNTopicDetailCellAnsView.h
// FourNews
//
// Created by xmg on 16/4/12.
// Copyright © 2016年 天涯海北. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "FNTopicAnswerItem.h"
@interface FNTopicDetailCellAnsView : UIView
@property (nonatomic, assign) CGFloat totalHeight;
@property (nonatomic, strong) FNTopicAnswerItem *ansItem;
@end
|
/*
* Copyright 2016 The Cartographer 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 CARTOGRAPHER_MAPPING_2D_SCAN_MATCHING_CERES_SCAN_MATCHER_H_
#define CARTOGRAPHER_MAPPING_2D_SCAN_MATCHING_CERES_SCAN_MATCHER_H_
#include <memory>
#include <vector>
#include "Eigen/Core"
#include "cartographer/common/lua_parameter_dictionary.h"
#include "cartographer/kalman_filter/pose_tracker.h"
#include "cartographer/mapping_2d/probability_grid.h"
#include "cartographer/mapping_2d/scan_matching/proto/ceres_scan_matcher_options.pb.h"
#include "cartographer/sensor/point_cloud.h"
#include "ceres/ceres.h"
namespace cartographer {
namespace mapping_2d {
namespace scan_matching {
proto::CeresScanMatcherOptions CreateCeresScanMatcherOptions(
common::LuaParameterDictionary* parameter_dictionary);
// Align scans with an existing map using Ceres.
class CeresScanMatcher {
public:
explicit CeresScanMatcher(const proto::CeresScanMatcherOptions& options);
virtual ~CeresScanMatcher();
CeresScanMatcher(const CeresScanMatcher&) = delete;
CeresScanMatcher& operator=(const CeresScanMatcher&) = delete;
// Aligns 'point_cloud' within the 'probability_grid' given an
// 'initial_pose_estimate' and returns 'pose_estimate', 'covariance', and
// the solver 'summary'.
void Match(const transform::Rigid2d& previous_pose,
const transform::Rigid2d& initial_pose_estimate,
const sensor::PointCloud& point_cloud,
const ProbabilityGrid& probability_grid,
transform::Rigid2d* pose_estimate,
kalman_filter::Pose2DCovariance* covariance,
ceres::Solver::Summary* summary) const;
private:
const proto::CeresScanMatcherOptions options_;
ceres::Solver::Options ceres_solver_options_;
};
} // namespace scan_matching
} // namespace mapping_2d
} // namespace cartographer
#endif // CARTOGRAPHER_MAPPING_2D_SCAN_MATCHING_CERES_SCAN_MATCHER_H_
|
#include "WENO3.h"
#include "Extrapolation4.h"
#include "functions.h"
void Feiko5_WENO3_LxF(int i, int j, float *tao, float *slowMatrix, float slow0, int I,int J,float xmin,float xmax,float ymin,float ymax, float sx, float sy)
/***
Local Solver at point (i,j) for Factored Eikonal Equation
***/
{
float slow=slowMatrix[j*I+i];
//float slow0=slow0Matrix[j*I+i];
float Dx=(xmax-xmin)/(I-1),Dy=(ymax-ymin)/(J-1);
float h=Dx;
float ax;
float ay;
float T0C;
float taoC=tao[j*I+i];
float unew=0.0;
float ue=0,uw=0,un=0,us=0;
float hamilton=0;
float ew=0, ns=0;
float x0,y0;
float p0,q0;
float r2;
if(i==0){
unew=Extrapolation4(tao[j*I+i+5],tao[j*I+i+4],tao[j*I+i+3],tao[j*I+i+2],tao[j*I+i+1],1);
}
else if(i==I-1){
unew=Extrapolation4(tao[j*I+i-5],tao[j*I+i-4],tao[j*I+i-3],tao[j*I+i-2],tao[j*I+i-1],1);
}
else if(j==0){
unew=Extrapolation4(tao[(j+5)*I+i],tao[(j+4)*I+i],tao[(j+3)*I+i],tao[(j+2)*I+i],tao[(j+1)*I+i],1);
}
else if(j==J-1){
unew=Extrapolation4(tao[(j-5)*I+i],tao[(j-4)*I+i],tao[(j-3)*I+i],tao[(j-2)*I+i],tao[(j-1)*I+i],1);
}
else{
if(i==1){
uw=WENO3(Extrapolation4(tao[j*I+i+3],tao[j*I+i+2],tao[j*I+i+1],tao[j*I+i],tao[j*I+i-1],1),tao[j*I+i-1],tao[j*I+i],tao[j*I+i+1],h,-1);
ue=WENO3(tao[j*I+i+2],tao[j*I+i+1],tao[j*I+i],tao[j*I+i-1],h,1);
uw=taoC-h*uw;
ue=taoC+h*ue;
}
else if(i==I-2){
uw=WENO3(tao[j*I+i-2],tao[j*I+i-1],tao[j*I+i],tao[j*I+i+1],h,-1);
ue=WENO3(Extrapolation4(tao[j*I+i-3],tao[j*I+i-2],tao[j*I+i-1],tao[j*I+i],tao[j*I+i+1],1),tao[j*I+i+1],tao[j*I+i],tao[j*I+i-1],h,1);
uw=taoC-h*uw;
ue=taoC+h*ue;
}
else{
uw=WENO3(tao[j*I+i-2],tao[j*I+i-1],tao[j*I+i],tao[j*I+i+1],h,-1);
ue=WENO3(tao[j*I+i+2],tao[j*I+i+1],tao[j*I+i],tao[j*I+i-1],h,1);
uw=taoC-h*uw;
ue=taoC+h*ue;
}
if(j==1){
us=WENO3(Extrapolation4(tao[(j+3)*I+i],tao[(j+2)*I+i],tao[(j+1)*I+i],tao[j*I+i],tao[(j-1)*I+i],1),tao[(j-1)*I+i],tao[j*I+i],tao[(j+1)*I+i],h,-1);
un=WENO3(tao[(j+2)*I+i],tao[(j+1)*I+i],tao[j*I+i],tao[(j-1)*I+i],h,1);
us=taoC-h*us;
un=taoC+h*un;
}
else if(j==J-2){
us=WENO3(tao[(j-2)*I+i],tao[(j-1)*I+i],tao[j*I+i],tao[(j+1)*I+i],h,-1);
un=WENO3(Extrapolation4(tao[(j-3)*I+i],tao[(j-2)*I+i],tao[(j-1)*I+i],tao[j*I+i],tao[(j+1)*I+i],1),tao[(j+1)*I+i],tao[j*I+i],tao[(j-1)*I+i],h,1);
us=taoC-h*us;
un=taoC+h*un;
}
else{
us=WENO3(tao[(j-2)*I+i],tao[(j-1)*I+i],tao[j*I+i],tao[(j+1)*I+i],h,-1);
un=WENO3(tao[(j+2)*I+i],tao[(j+1)*I+i],tao[j*I+i],tao[(j-1)*I+i],h,1);
us=taoC-h*us;
un=taoC+h*un;
}
x0=i*h+xmin; y0=j*h+ymin;
r2=dist2(x0,y0,sx,sy);
T0C=slow0*r2;
if (r2>=0.1*h)
{
p0=slow0*(x0-sx)/r2;
q0=slow0*(y0-sy)/r2;
}
else
{
p0=0; q0=0;
}
ax=(2.5*(fabs(T0C)+h*(fabs(p0)+fabs(q0))));
ay=(2.5*(fabs(T0C)+h*(fabs(p0)+fabs(q0))));
ew=0.5*(ue-uw)/h ;
ns=0.5*(un-us)/h ;
/* hamilton=sqrt(T0C*T0C*((ue-uw)/2.0/h*(ue-uw)/2.0/h
+(un-us)/2.0/h*(un-us)/2.0/h)
+2.0*T0C*taoC*(p0*(ue-uw)/2.0/h+q0*(un-us)/2.0/h)
+taoC*taoC*(p0*p0+q0*q0)); */
hamilton=T0C*T0C*(ew*ew+ns*ns)+2.0*T0C*taoC*(p0*ew+q0*ns)+taoC*taoC*slow0*slow0;
hamilton=sqrt(hamilton);
unew=(h*slow-h*hamilton+ax*0.5*(ue+uw)+ay*0.5*(un+us))/(ax+ay);
}
tao[j*I+i]=unew;
return;
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/budgets/Budgets_EXPORTS.h>
#include <aws/budgets/model/Spend.h>
#include <aws/budgets/model/TimePeriod.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace Budgets
{
namespace Model
{
/**
* <p>The amount of cost or usage that you created the budget for, compared to your
* actual costs or usage.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/budgets-2016-10-20/BudgetedAndActualAmounts">AWS
* API Reference</a></p>
*/
class AWS_BUDGETS_API BudgetedAndActualAmounts
{
public:
BudgetedAndActualAmounts();
BudgetedAndActualAmounts(Aws::Utils::Json::JsonView jsonValue);
BudgetedAndActualAmounts& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The amount of cost or usage that you created the budget for.</p>
*/
inline const Spend& GetBudgetedAmount() const{ return m_budgetedAmount; }
/**
* <p>The amount of cost or usage that you created the budget for.</p>
*/
inline bool BudgetedAmountHasBeenSet() const { return m_budgetedAmountHasBeenSet; }
/**
* <p>The amount of cost or usage that you created the budget for.</p>
*/
inline void SetBudgetedAmount(const Spend& value) { m_budgetedAmountHasBeenSet = true; m_budgetedAmount = value; }
/**
* <p>The amount of cost or usage that you created the budget for.</p>
*/
inline void SetBudgetedAmount(Spend&& value) { m_budgetedAmountHasBeenSet = true; m_budgetedAmount = std::move(value); }
/**
* <p>The amount of cost or usage that you created the budget for.</p>
*/
inline BudgetedAndActualAmounts& WithBudgetedAmount(const Spend& value) { SetBudgetedAmount(value); return *this;}
/**
* <p>The amount of cost or usage that you created the budget for.</p>
*/
inline BudgetedAndActualAmounts& WithBudgetedAmount(Spend&& value) { SetBudgetedAmount(std::move(value)); return *this;}
/**
* <p>Your actual costs or usage for a budget period.</p>
*/
inline const Spend& GetActualAmount() const{ return m_actualAmount; }
/**
* <p>Your actual costs or usage for a budget period.</p>
*/
inline bool ActualAmountHasBeenSet() const { return m_actualAmountHasBeenSet; }
/**
* <p>Your actual costs or usage for a budget period.</p>
*/
inline void SetActualAmount(const Spend& value) { m_actualAmountHasBeenSet = true; m_actualAmount = value; }
/**
* <p>Your actual costs or usage for a budget period.</p>
*/
inline void SetActualAmount(Spend&& value) { m_actualAmountHasBeenSet = true; m_actualAmount = std::move(value); }
/**
* <p>Your actual costs or usage for a budget period.</p>
*/
inline BudgetedAndActualAmounts& WithActualAmount(const Spend& value) { SetActualAmount(value); return *this;}
/**
* <p>Your actual costs or usage for a budget period.</p>
*/
inline BudgetedAndActualAmounts& WithActualAmount(Spend&& value) { SetActualAmount(std::move(value)); return *this;}
/**
* <p>The time period that's covered by this budget comparison.</p>
*/
inline const TimePeriod& GetTimePeriod() const{ return m_timePeriod; }
/**
* <p>The time period that's covered by this budget comparison.</p>
*/
inline bool TimePeriodHasBeenSet() const { return m_timePeriodHasBeenSet; }
/**
* <p>The time period that's covered by this budget comparison.</p>
*/
inline void SetTimePeriod(const TimePeriod& value) { m_timePeriodHasBeenSet = true; m_timePeriod = value; }
/**
* <p>The time period that's covered by this budget comparison.</p>
*/
inline void SetTimePeriod(TimePeriod&& value) { m_timePeriodHasBeenSet = true; m_timePeriod = std::move(value); }
/**
* <p>The time period that's covered by this budget comparison.</p>
*/
inline BudgetedAndActualAmounts& WithTimePeriod(const TimePeriod& value) { SetTimePeriod(value); return *this;}
/**
* <p>The time period that's covered by this budget comparison.</p>
*/
inline BudgetedAndActualAmounts& WithTimePeriod(TimePeriod&& value) { SetTimePeriod(std::move(value)); return *this;}
private:
Spend m_budgetedAmount;
bool m_budgetedAmountHasBeenSet;
Spend m_actualAmount;
bool m_actualAmountHasBeenSet;
TimePeriod m_timePeriod;
bool m_timePeriodHasBeenSet;
};
} // namespace Model
} // namespace Budgets
} // namespace Aws
|
//
// MircoClassViewModel.h
// HospitalBible
//
// Created by me on 17/6/4.
// Copyright © 2017年 com.hao. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MircoClassViewModel : NSObject
+ (void)requestDiscoverListWithDisclsid:(NSString*)disclsid successHandler:(SuccessCallBack)successHandler
errorHandler:(ErrorCallBack)errorHandler;
@end
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/migration-hub-refactor-spaces/MigrationHubRefactorSpaces_EXPORTS.h>
#include <aws/migration-hub-refactor-spaces/MigrationHubRefactorSpacesRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <utility>
namespace Aws
{
namespace MigrationHubRefactorSpaces
{
namespace Model
{
/**
*/
class AWS_MIGRATIONHUBREFACTORSPACES_API TagResourceRequest : public MigrationHubRefactorSpacesRequest
{
public:
TagResourceRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "TagResource"; }
Aws::String SerializePayload() const override;
/**
* <p>The Amazon Resource Name (ARN) of the resource</p>
*/
inline const Aws::String& GetResourceArn() const{ return m_resourceArn; }
/**
* <p>The Amazon Resource Name (ARN) of the resource</p>
*/
inline bool ResourceArnHasBeenSet() const { return m_resourceArnHasBeenSet; }
/**
* <p>The Amazon Resource Name (ARN) of the resource</p>
*/
inline void SetResourceArn(const Aws::String& value) { m_resourceArnHasBeenSet = true; m_resourceArn = value; }
/**
* <p>The Amazon Resource Name (ARN) of the resource</p>
*/
inline void SetResourceArn(Aws::String&& value) { m_resourceArnHasBeenSet = true; m_resourceArn = std::move(value); }
/**
* <p>The Amazon Resource Name (ARN) of the resource</p>
*/
inline void SetResourceArn(const char* value) { m_resourceArnHasBeenSet = true; m_resourceArn.assign(value); }
/**
* <p>The Amazon Resource Name (ARN) of the resource</p>
*/
inline TagResourceRequest& WithResourceArn(const Aws::String& value) { SetResourceArn(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the resource</p>
*/
inline TagResourceRequest& WithResourceArn(Aws::String&& value) { SetResourceArn(std::move(value)); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the resource</p>
*/
inline TagResourceRequest& WithResourceArn(const char* value) { SetResourceArn(value); return *this;}
/**
* <p>The new or modified tags for the resource. </p>
*/
inline const Aws::Map<Aws::String, Aws::String>& GetTags() const{ return m_tags; }
/**
* <p>The new or modified tags for the resource. </p>
*/
inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
/**
* <p>The new or modified tags for the resource. </p>
*/
inline void SetTags(const Aws::Map<Aws::String, Aws::String>& value) { m_tagsHasBeenSet = true; m_tags = value; }
/**
* <p>The new or modified tags for the resource. </p>
*/
inline void SetTags(Aws::Map<Aws::String, Aws::String>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }
/**
* <p>The new or modified tags for the resource. </p>
*/
inline TagResourceRequest& WithTags(const Aws::Map<Aws::String, Aws::String>& value) { SetTags(value); return *this;}
/**
* <p>The new or modified tags for the resource. </p>
*/
inline TagResourceRequest& WithTags(Aws::Map<Aws::String, Aws::String>&& value) { SetTags(std::move(value)); return *this;}
/**
* <p>The new or modified tags for the resource. </p>
*/
inline TagResourceRequest& AddTags(const Aws::String& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; }
/**
* <p>The new or modified tags for the resource. </p>
*/
inline TagResourceRequest& AddTags(Aws::String&& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; }
/**
* <p>The new or modified tags for the resource. </p>
*/
inline TagResourceRequest& AddTags(const Aws::String& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; }
/**
* <p>The new or modified tags for the resource. </p>
*/
inline TagResourceRequest& AddTags(Aws::String&& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), std::move(value)); return *this; }
/**
* <p>The new or modified tags for the resource. </p>
*/
inline TagResourceRequest& AddTags(const char* key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; }
/**
* <p>The new or modified tags for the resource. </p>
*/
inline TagResourceRequest& AddTags(Aws::String&& key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; }
/**
* <p>The new or modified tags for the resource. </p>
*/
inline TagResourceRequest& AddTags(const char* key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; }
private:
Aws::String m_resourceArn;
bool m_resourceArnHasBeenSet;
Aws::Map<Aws::String, Aws::String> m_tags;
bool m_tagsHasBeenSet;
};
} // namespace Model
} // namespace MigrationHubRefactorSpaces
} // namespace Aws
|
//
// TDMeViewController.h
// 百思不得姐
//
// Created by 蓝田 on 2017/1/5.
// Copyright © 2017年 蓝田. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TDMeViewController : UIViewController
@end
|
//
// ScrollViewFramesViewController.h
// InfiniteScroll
//
// Created by Cody Garvin on 3/15/17.
// Copyright © 2017 Cody Garvin. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ScrollViewFramesViewController : UIViewController
@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/workspaces/WorkSpaces_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/workspaces/model/WorkspaceDirectory.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace WorkSpaces
{
namespace Model
{
class AWS_WORKSPACES_API DescribeWorkspaceDirectoriesResult
{
public:
DescribeWorkspaceDirectoriesResult();
DescribeWorkspaceDirectoriesResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
DescribeWorkspaceDirectoriesResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>Information about the directories.</p>
*/
inline const Aws::Vector<WorkspaceDirectory>& GetDirectories() const{ return m_directories; }
/**
* <p>Information about the directories.</p>
*/
inline void SetDirectories(const Aws::Vector<WorkspaceDirectory>& value) { m_directories = value; }
/**
* <p>Information about the directories.</p>
*/
inline void SetDirectories(Aws::Vector<WorkspaceDirectory>&& value) { m_directories = std::move(value); }
/**
* <p>Information about the directories.</p>
*/
inline DescribeWorkspaceDirectoriesResult& WithDirectories(const Aws::Vector<WorkspaceDirectory>& value) { SetDirectories(value); return *this;}
/**
* <p>Information about the directories.</p>
*/
inline DescribeWorkspaceDirectoriesResult& WithDirectories(Aws::Vector<WorkspaceDirectory>&& value) { SetDirectories(std::move(value)); return *this;}
/**
* <p>Information about the directories.</p>
*/
inline DescribeWorkspaceDirectoriesResult& AddDirectories(const WorkspaceDirectory& value) { m_directories.push_back(value); return *this; }
/**
* <p>Information about the directories.</p>
*/
inline DescribeWorkspaceDirectoriesResult& AddDirectories(WorkspaceDirectory&& value) { m_directories.push_back(std::move(value)); return *this; }
/**
* <p>The token to use to retrieve the next set of results, or null if there are no
* more results available. This token is valid for one day and must be used within
* that time frame.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The token to use to retrieve the next set of results, or null if there are no
* more results available. This token is valid for one day and must be used within
* that time frame.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }
/**
* <p>The token to use to retrieve the next set of results, or null if there are no
* more results available. This token is valid for one day and must be used within
* that time frame.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }
/**
* <p>The token to use to retrieve the next set of results, or null if there are no
* more results available. This token is valid for one day and must be used within
* that time frame.</p>
*/
inline void SetNextToken(const char* value) { m_nextToken.assign(value); }
/**
* <p>The token to use to retrieve the next set of results, or null if there are no
* more results available. This token is valid for one day and must be used within
* that time frame.</p>
*/
inline DescribeWorkspaceDirectoriesResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The token to use to retrieve the next set of results, or null if there are no
* more results available. This token is valid for one day and must be used within
* that time frame.</p>
*/
inline DescribeWorkspaceDirectoriesResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The token to use to retrieve the next set of results, or null if there are no
* more results available. This token is valid for one day and must be used within
* that time frame.</p>
*/
inline DescribeWorkspaceDirectoriesResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::Vector<WorkspaceDirectory> m_directories;
Aws::String m_nextToken;
};
} // namespace Model
} // namespace WorkSpaces
} // namespace Aws
|
#pragma once
#include "Work.h"
// ------------------------------------------------------
// UpgradeWork
// ------------------------------------------------------
class UpgradeWork : public SimWork {
public:
UpgradeWork() : SimWork() {}
virtual ~UpgradeWork() {}
bool start(Island* island, const TextLine& line);
void finish(Island* island, const Event& e);
const int getWorkType() const;
};
|
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class king_flow_control_driver_HISCardConductor */
#ifndef _Included_king_flow_control_driver_HISCardConductor
#define _Included_king_flow_control_driver_HISCardConductor
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: king_flow_control_driver_HISCardConductor
* Method: getCard
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_king_flow_control_driver_HISCardConductor_getCard
(JNIEnv *, jobject, jstring);
/*
* Class: king_flow_control_driver_HISCardConductor
* Method: ejectCard
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_king_flow_control_driver_HISCardConductor_ejectCard
(JNIEnv *, jobject, jstring);
/*
* Class: king_flow_control_driver_HISCardConductor
* Method: withdrawCard
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_king_flow_control_driver_HISCardConductor_withdrawCard
(JNIEnv *, jobject, jstring);
#ifdef __cplusplus
}
#endif
#endif
|
/*
* Copyright 2021 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef YGGDRASIL_DECISION_FORESTS_FILESYSTEM_H_
#define YGGDRASIL_DECISION_FORESTS_FILESYSTEM_H_
// clang-format off
#if defined YGG_FILESYSTEM_USES_TENSORFLOW
#include "yggdrasil_decision_forests/utils/filesystem_tensorflow.h"
#else
#include "yggdrasil_decision_forests/utils/filesystem_default.h"
#endif
// clang-format on
#include "yggdrasil_decision_forests/utils/status_macros.h"
namespace file {
// Open a file for reading.
yggdrasil_decision_forests::utils::StatusOr<
std::unique_ptr<FileInputByteStream>>
OpenInputFile(absl::string_view path);
// Open a file for writing.
yggdrasil_decision_forests::utils::StatusOr<
std::unique_ptr<FileOutputByteStream>>
OpenOutputFile(absl::string_view path);
// Reads the content of a file.
yggdrasil_decision_forests::utils::StatusOr<std::string> GetContent(
absl::string_view path);
// Sets the content of a file.
absl::Status SetContent(absl::string_view path, absl::string_view content);
// Takes ownership and closes a file at destruction.
template <typename FileStream>
class GenericFileCloser {
public:
GenericFileCloser() {}
explicit GenericFileCloser(std::unique_ptr<FileStream> stream)
: stream_(std::move(stream)) {}
~GenericFileCloser() { CHECK_OK(Close()); }
// Returns a borrowed pointer to the stream. Ownership is not transferred.
FileStream* stream() { return stream_.get(); }
absl::Status reset(std::unique_ptr<FileStream> stream) {
RETURN_IF_ERROR(Close());
stream_ = std::move(stream);
return absl::OkStatus();
}
absl::Status Close() {
if (stream_) {
RETURN_IF_ERROR(stream_->Close());
stream_.reset();
}
return absl::OkStatus();
}
private:
std::unique_ptr<FileStream> stream_;
};
using InputFileCloser = GenericFileCloser<FileInputByteStream>;
using OutputFileCloser = GenericFileCloser<FileOutputByteStream>;
} // namespace file
#endif // YGGDRASIL_DECISION_FORESTS_FILESYSTEM_H_
|
//
// Constants.h
// sema2
//
// Created by Ashemah Harrison on 16/04/2015.
// Copyright (c) 2015 Starehe Harrison. All rights reserved.
//
#ifndef sema2_Constants_h
#define sema2_Constants_h
#define AnswerSetTriggerModeScheduled 0
#define AnswerSetTriggerModeAdHoc 1
#endif
|
//
// LJHomeController.h
// 1009_03-权限控制
//
// Created by qianfeng on 15/10/9.
// Copyright (c) 2015年 qianfeng曹. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LJHomeController : UIViewController
@end
|
// Copyright 2013 the Neutrino authors (see AUTHORS).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
// This is a make-your-own template; define the appropriate macros and include
// this file and it will expand to the implementation of a buffer type that
// works with that type.
#ifndef BUFFER_TYPE
#error No buffer type defined
#endif
#ifndef MAKE_BUFFER_NAME
#error No buffer name maker defined
#endif
void MAKE_BUFFER_NAME(init)(MAKE_BUFFER_NAME(t) *buf) {
buf->length = 0;
buf->memory = allocator_default_malloc(128 * sizeof(BUFFER_TYPE));
}
void MAKE_BUFFER_NAME(dispose)(MAKE_BUFFER_NAME(t) *buf) {
allocator_default_free(buf->memory);
}
// Expands the buffer to make room for 'length' elements if necessary.
static void MAKE_BUFFER_NAME(ensure_capacity)(MAKE_BUFFER_NAME(t) *buf, size_t length) {
size_t length_bytes = length * sizeof(BUFFER_TYPE);
if (length_bytes < buf->memory.size)
return;
size_t new_capacity = (length * 2);
memory_block_t new_memory = allocator_default_malloc(new_capacity * sizeof(BUFFER_TYPE));
memcpy(new_memory.memory, buf->memory.memory, buf->length * sizeof(BUFFER_TYPE));
allocator_default_free(buf->memory);
buf->memory = new_memory;
}
void MAKE_BUFFER_NAME(append)(MAKE_BUFFER_NAME(t) *buf, BUFFER_TYPE value) {
MAKE_BUFFER_NAME(ensure_capacity)(buf, buf->length + 1);
((BUFFER_TYPE*) buf->memory.memory)[buf->length] = value;
buf->length++;
}
void MAKE_BUFFER_NAME(flush)(MAKE_BUFFER_NAME(t) *buf, blob_t *blob_out) {
blob_init(blob_out, (byte_t*) buf->memory.memory, buf->length * sizeof(BUFFER_TYPE));
}
void MAKE_BUFFER_NAME(append_cursor)(MAKE_BUFFER_NAME(t) *buf,
MAKE_BUFFER_NAME(cursor_t) *cursor_out) {
cursor_out->buf = buf;
cursor_out->offset = buf->length;
MAKE_BUFFER_NAME(append)(buf, 0);
}
void MAKE_BUFFER_NAME(cursor_set)(MAKE_BUFFER_NAME(cursor_t) *cursor,
BUFFER_TYPE value) {
BUFFER_TYPE *block = (BUFFER_TYPE*) cursor->buf->memory.memory;
block[cursor->offset] = value;
}
|
#ifndef _INC_CSCRIPT_H
#define _INC_CSCRIPT_H
#pragma once
#include "CMemBlock.h"
#include "CCacheableScriptFile.h"
struct CScriptLineContext
{
public:
CScriptLineContext()
{
Init();
}
long m_lOffset;
int m_iLineNum; // for debug purposes if there is an error
void Init()
{
m_lOffset = -1;
m_iLineNum = -1;
}
bool IsValid() const
{
return (m_lOffset >= 0);
}
};
class CScriptKey
{
// A single line form a script file
// This is usually in the form of KEY=ARG
// Unknown allocation of pointers
public:
CScriptKey() : m_pszKey(NULL), m_pszArg(NULL) { }
CScriptKey(TCHAR *pszKey, TCHAR *pszArg) : m_pszKey(pszKey), m_pszArg(pszArg) { }
virtual ~CScriptKey() { }
private:
CScriptKey(const CScriptKey ©);
CScriptKey &operator=(const CScriptKey &other);
protected:
TCHAR *m_pszKey; // the key (or just start of the line)
TCHAR *m_pszArg; // for parsing the last read line (KEY=ARG or KEY ARG)
public:
static const char *m_sClassName;
bool IsKey(LPCTSTR pszName) const
{
ASSERT(m_pszKey);
return !strcmpi(m_pszKey, pszName);
}
bool IsKeyHead(LPCTSTR pszName, size_t len) const
{
ASSERT(m_pszKey);
return !strnicmp(m_pszKey, pszName, len);
}
void InitKey();
LPCTSTR GetKey() const
{
ASSERT(m_pszKey);
return m_pszKey;
}
bool HasArgs() const
{
ASSERT(m_pszArg);
return m_pszArg[0] ? true : false;
}
TCHAR *GetArgRaw() const
{
ASSERT(m_pszArg);
return m_pszArg;
}
TCHAR *GetArgStr(bool *fQuoted);
TCHAR *GetArgStr()
{
return GetArgStr(NULL);
}
UINT64 GetArgFlag(UINT64 uStart, UINT64 uMask);
long long GetArgLLVal();
long GetArgVal();
long GetArgRange();
};
class CScriptKeyAlloc : public CScriptKey
{
// Dynamic allocated script key
public:
CScriptKeyAlloc() { }
virtual ~CScriptKeyAlloc() { }
private:
CScriptKeyAlloc(const CScriptKeyAlloc ©);
CScriptKeyAlloc &operator=(const CScriptKeyAlloc &other);
protected:
CMemLenBlock m_Mem; // the buffer to hold data read
TCHAR *GetKeyBufferRaw(size_t iLen);
bool ParseKey(LPCTSTR pszKey, LPCTSTR pszVal);
size_t ParseKeyEnd();
public:
static const char *m_sClassName;
TCHAR *GetKeyBuffer()
{
ASSERT(m_Mem.GetData());
return reinterpret_cast<TCHAR *>(m_Mem.GetData());
}
bool ParseKey(LPCTSTR pszKey);
void ParseKeyLate();
};
class CScript : public CCacheableScriptFile, public CScriptKeyAlloc
{
public:
CScript();
CScript(LPCTSTR pszKey);
CScript(LPCTSTR pszKey, LPCTSTR pszVal);
virtual ~CScript() { }
private:
bool m_fSectionHead; // file offset to current section header [HEADER]
long m_lSectionData; // file offset to current section data, under section header
public:
static const char *m_sClassName;
int m_iLineNum; // for debug purposes if there is an error
protected:
void InitBase();
virtual DWORD Seek(long lOffset = 0, UINT uOrigin = SEEK_SET);
public:
// Text only functions
virtual bool ReadTextLine(bool fRemoveBlanks);
bool FindTextHeader(LPCTSTR pszName);
public:
virtual bool Open(LPCTSTR pszFilename = NULL, UINT uFlags = OF_READ|OF_TEXT);
virtual void Close();
virtual void CloseForce()
{
CScript::Close();
}
bool SeekContext(CScriptLineContext LineContext)
{
m_iLineNum = LineContext.m_iLineNum;
return (Seek(LineContext.m_lOffset, SEEK_SET) == static_cast<DWORD>(LineContext.m_lOffset));
}
CScriptLineContext GetContext() const
{
CScriptLineContext LineContext;
LineContext.m_iLineNum = m_iLineNum;
LineContext.m_lOffset = GetPosition();
return LineContext;
}
// Find sections
bool FindNextSection();
LPCTSTR GetSection() const
{
ASSERT(m_pszKey);
return m_pszKey;
}
bool IsSectionType(LPCTSTR pszName) //const
{
// Only valid after FindNextSection()
return !strcmpi(GetKey(), pszName);
}
// Read the sections keys
bool ReadKey(bool fRemoveBlanks = true);
bool ReadKeyParse();
// Write stuff out to a script file
bool _cdecl WriteSection(LPCTSTR pszSection, ...) __printfargs(2, 3);
bool WriteKey(LPCTSTR pszKey, LPCTSTR pszVal);
void _cdecl WriteKeyFormat(LPCTSTR pszKey, LPCTSTR pszVal, ...) __printfargs(3, 4);
void WriteKeyVal(LPCTSTR pszKey, INT64 iVal)
{
#ifdef __MINGW32__
WriteKeyFormat(pszKey, "%I64d", iVal);
#else
WriteKeyFormat(pszKey, "%lld", iVal);
#endif
}
void WriteKeyHex(LPCTSTR pszKey, INT64 iVal)
{
#ifdef __MINGW32__
WriteKeyFormat(pszKey, "0%I64x", iVal);
#else
WriteKeyFormat(pszKey, "0%llx", iVal);
#endif
}
};
#endif // _INC_CSCRIPT_H
|
// Protocol Buffers for Swift
//
// Copyright 2014 Alexey Khohklov(AlexeyXo).
// 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 swift_MESSAGE_H
#define swift_MESSAGE_H
#include <string>
#include <map>
#include <set>
#include <google/protobuf/stubs/common.h>
#include "swift_field.h"
namespace google {
namespace protobuf {
namespace io {
class Printer; // printer.h
}
}
namespace protobuf {
namespace compiler {
namespace swift {
class MessageGenerator {
public:
explicit MessageGenerator(const Descriptor* descriptor);
~MessageGenerator();
void GenerateStaticVariablesInitialization(io::Printer* printer);
void GenerateStaticVariablesSource(io::Printer* printer);
void GenerateSource(io::Printer* printer);
void GenerateMessageIsEqualSource(io::Printer* printer);
void GenerateExtensionRegistrationSource(io::Printer* printer);
void DetermineDependencies(set<string>* dependencies);
void GenerateGlobalStaticVariablesSource(io::Printer* printer, string rootclass);
void GenerateParseFromMethodsSource(io::Printer* printer);
private:
void GenerateMessageSerializationMethodsSource(io::Printer* printer);
void GenerateSerializeOneFieldSource(io::Printer* printer,
const FieldDescriptor* field);
void GenerateSerializeOneExtensionRangeSource(
io::Printer* printer, const Descriptor::ExtensionRange* range);
void GenerateMessageDescriptionSource(io::Printer* printer);
void GenerateMessageJSONSource(io::Printer* printer);
void GenerateMessageBuilderJSONSource(io::Printer* printer);
void GenerateDescriptionOneFieldSource(io::Printer* printer,
const FieldDescriptor* field);
void GenerateDescriptionOneExtensionRangeSource(
io::Printer* printer, const Descriptor::ExtensionRange* range);
void GenerateIsEqualOneFieldSource(io::Printer* printer,
const FieldDescriptor* field);
void GenerateIsEqualOneExtensionRangeSource(
io::Printer* printer, const Descriptor::ExtensionRange* range);
void GenerateMessageHashSource(io::Printer* printer);
void GenerateHashOneFieldSource(io::Printer* printer,
const FieldDescriptor* field);
void GenerateHashOneExtensionRangeSource(
io::Printer* printer, const Descriptor::ExtensionRange* range);
void GenerateBuilderSource(io::Printer* printer);
void GenerateCommonBuilderMethodsSource(io::Printer* printer);
void GenerateBuilderParsingMethodsSource(io::Printer* printer);
void GenerateIsInitializedSource(io::Printer* printer);
const Descriptor* descriptor_;
FieldGeneratorMap field_generators_;
map<string, string> variables_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageGenerator);
};
} // namespace swift
} // namespace compiler
} // namespace protobuf
} // namespace google
#endif // swift_MESSAGE_H
|
#ifndef CLIPBOARDX11_H_DIE_TK_LINUX_DIEGO_2015_AUG_06
#define CLIPBOARDX11_H_DIE_TK_LINUX_DIEGO_2015_AUG_06
#include <X11/Xlib.h>
#include "../NativeString.h"
#include "ScopedX11.h"
#include "Property.h"
namespace tk {
class Clipboard {
Atom sel;
Atom XA_TARGETS;
scoped::Window window;
public:
explicit Clipboard(char const * clipProperty);
NativeString pasteString();
// TODO get image data too
private:
Property readPropertyFromSel(XEvent const & e);
XEvent checkEvent();
};
}
#endif
|
/*
* cguess - C/C++/Java(tm) auto-completion tool for VIM
* Copyright (C) 2005 Andrzej Zaborowski <balrog@zabor.org>
* All Rights Reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "context.h"
#include "stack.h"
#include "cguess.h"
/*
* The stack is global for the parser.
*
* Whoever needs it reentrant will have to modify this.
*
* TODO: use sstacks
*/
static struct stack_s stack;
const struct symbol_table_s *global;
void context_init() {
stack_init(&stack);
global = 0;
}
void context_open(const struct symbol_table_s *context) {
stack_push(&stack, context);
if (!global)
global = context;
}
void context_close() {
assert(!stack_empty(&stack));
stack_pop(&stack);
}
void context_done() {
while (!stack_empty(&stack))
stack_pop(&stack);
}
struct symbol_table_s *context_local() {
/*assert(!stack_empty(&stack));*/
if (stack_empty(&stack))
return 0;
return (struct symbol_table_s *) stack_top(&stack);
}
struct symbol_table_s *context_global() {
return (struct symbol_table_s *) global;
}
int prt(struct symbol_table_s *ctx, void *data) {
if (symbol_table_def(ctx))
printf("::%s", ((struct identifier_s *)
symbol_table_def(ctx))->name);
else
printf("::<0>");
return 1;
}
int context_print() {
stack_foreach(&stack, (stack_iterator_t) prt, 0);
printf("\n");
return 0;
}
struct search_data_s {
struct identifier_s *result;
const char *key;
};
int context_search(struct symbol_table_s *ctx, struct search_data_s *data) {
data->result = identifier_lookup(ctx, data->key);
return !data->result;
}
/*
* This method of looking up identifiers worked for C, but it
* is not sufficient for C++, so it is no longer used.
*/
struct identifier_s *context_c_lookup(const char *key) {
struct search_data_s data = { 0, key };
stack_foreach(&stack, (stack_iterator_t) context_search, &data);
return data.result;
}
struct identifier_s *context_lookup(const char *key) {
struct symbol_table_s *table;
struct identifier_s *result;
assert(!stack_empty(&stack));
table = (struct symbol_table_s *) stack_top(&stack);
while (table) {
result = identifier_lookup(table, key);
if (result)
return result;
/* assert(table->definition); */
if (table->definition)
table = ((struct identifier_s *) table->definition)->
parent;
else /* TODO: */
return context_c_lookup(key);
}
return 0;
}
int n, i, show(struct symbol_table_s *ctx, int in);
int count(void *ctx, void *data) {
n ++;
return 1;
}
int show0(void *ctx, void *data) {
for (i = 0; i < (int) data; i ++)
printf(" ");
printf("+%s\n", ((struct identifier_s *) ctx)->name);
if (((struct identifier_s *) ctx)->nested)
show(((struct identifier_s *) ctx)->nested, (int) data + 1);
return 1;
}
int show1(void *ctx, void *data) {
n --;
if (!n)
show((struct symbol_table_s *) ctx, 0);
return 1;
}
int show(struct symbol_table_s *ctx, int in) {
STRUCT_CALL(foreach, &ctx->table, show0, (void *) in);
return 1;
}
int context_show_tree() {
n = 0;
printf("global\n");
stack_foreach(&stack, count, 0);
stack_foreach(&stack, show1, 0);
return 0;
}
|
/*
* Topaz - ATA Transport
*
* This file implements OS abstracted API to implement TCG IF-SEND and IF-RECV
* calls, along with other basic ATA commands.
*
* Copyright (c) 2016, T Parys
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <string.h>
#include <topaz/debug.h>
#include <topaz/errno.h>
#include <topaz/transport_ata.h>
/**
* \brief ATA Identify
*
* Implementation of ATA Identify command to query
* drive self-identification data.
*
* \param[in] handle Device handle
* \param[out] data Pointer to 512 byte buffer
* \return 0 on success, error code indicating failure
*/
tp_errno_t tp_ata_get_identify(struct tp_ata_handle *handle, void *data)
{
/* ATA12 Command - Identify Device (0xec) */
tp_ata_cmd12_t cmd;
memset(&cmd, 0, sizeof(cmd));
cmd.command = 0xec;
/* Off it goes */
TP_DEBUG(1) printf("Probe ATA Identify\n");
return tp_ata_exec12(handle, &cmd, TP_ATA_OPER_READ, data, 1, 1);
}
/**
* \brief Probe ATA Device for TPM
*
* Check ATA Identify data for TPM presence
*
* \param[in] handle Device handle
* \return 0 on success, error code indicating failure
*/
tp_errno_t tp_ata_probe_tpm(struct tp_ata_handle *handle)
{
uint16_t id_data[256];
/* Query identify data */
tp_ata_get_identify(handle, id_data);
/* Verify ATA version >= 8 */
TP_DEBUG(1) printf("Verifying ATA support\n");
if ((id_data[80] & ~((1 < 8) - 1)) == 0)
{
return tp_errno = TP_ERR_NO_TPM;
}
/* Check for TPM presence */
TP_DEBUG(1) printf("Searching for TPM Fingerprint\n");
if ((id_data[48] & 0xC000) != 0x4000)
{
return tp_errno = TP_ERR_NO_TPM;
}
/* looks ok */
return tp_errno = TP_ERR_SUCCESS;
}
/**
* \brief ATA IF-SEND
*
* Implementation of TCG SWG IF-SEND method to send
* data to a particular Communication ID via a specified
* security protocol.
*
* \param[in] handle Device handle
* \param[in] proto Security protocol
* \param[in] comid Communication ID
* \param[in] data I/O data buffer
* \param[in] bcount Count of 512 byte blocks to transfer
* \return 0 on success, error code indicating failure
*/
tp_errno_t tp_ata_if_send(struct tp_ata_handle *handle, uint8_t proto,
uint16_t comid, void *data, uint8_t bcount)
{
/* Build ATA12 Command - Trusted Send (0x5e) */
tp_ata_cmd12_t cmd;
memset(&cmd, 0, sizeof(cmd));
cmd.feature = proto;
cmd.count = bcount;
cmd.lba_mid = comid & 0xff;
cmd.lba_high = comid >> 8;
cmd.command = 0x5e;
/* Off it goes */
return tp_ata_exec12(handle, &cmd, TP_ATA_OPER_WRITE, data, bcount, 5);
}
/**
* \brief ATA IF-RECV
*
* Implementation of TCG SWG IF-RECV method to receive
* data from a particular Communication ID via a specified
* security protocol.
*
* \param[in] handle Device handle
* \param[in] proto Security protocol
* \param[in] comid Communication ID
* \param[out] data I/O data buffer
* \param[in] bcount Count of 512 byte blocks to transfer
* \return 0 on success, error code indicating failure
*/
tp_errno_t tp_ata_if_recv(struct tp_ata_handle *handle, uint8_t proto,
uint16_t comid, void *data, uint8_t bcount)
{
/* Build ATA12 command - Trusted Receive (0x5c) */
tp_ata_cmd12_t cmd;
memset(&cmd, 0, sizeof(cmd));
cmd.feature = proto;
cmd.count = bcount;
cmd.lba_mid = comid & 0xff;
cmd.lba_high = comid >> 8;
cmd.command = 0x5c;
/* Off it goes */
return tp_ata_exec12(handle, &cmd, TP_ATA_OPER_READ, data, bcount, 5);
}
|
/*
* Copyright (c) 2014-2019 Netflix, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY NETFLIX, INC. AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL NETFLIX OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Functions related to storing/retrieving and manipulating DIAL data.
*/
#include "dial_data.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
char dial_data_dir[256] = DIAL_DATA_DIR;
void set_dial_data_dir(const char *data_dir) {
strncpy(dial_data_dir, data_dir, 255);
}
/**
* Returns the path where data is stored for the given app.
*
* The DIAL data directory must have been already set.
*
* @param app_name application name.
* @return the location of the application path within the DIAL data
* directory or NULL if memory could not be allocated.
* @see set_dial_data_dir(const char*)
*/
static char* getAppPath(char *app_name) {
size_t name_size = strlen(app_name) + sizeof(dial_data_dir) + 1;
char* filename = (char*) malloc(name_size);
if (filename == NULL) {
return NULL;
}
filename[0] = 0;
strncat(filename, dial_data_dir, name_size);
strncat(filename, app_name, name_size - sizeof(dial_data_dir));
return filename;
}
void store_dial_data(char *app_name, DIALData *data) {
char* filename = getAppPath(app_name);
if (filename == NULL) {
printf("Cannot open DIAL data output file, out-of-memory.");
exit(1);
}
FILE *f = fopen(filename, "w");
free(filename); filename = NULL;
if (f == NULL) {
printf("Cannot open DIAL data output file: %s\n", filename);
exit(1);
}
for (DIALData *first = data; first != NULL; first = first->next) {
// truncate because we have limits on length when retrieving.
fprintf(f, "%.*s %.*s\n", DIAL_KEY_OR_VALUE_MAX_LEN, first->key, DIAL_KEY_OR_VALUE_MAX_LEN, first->value);
}
fclose(f);
}
DIALData *retrieve_dial_data(char *app_name) {
char* filename = getAppPath(app_name);
if (filename == NULL) {
return NULL; // no dial data found, that's fine
}
FILE *f = fopen(filename, "r");
free(filename); filename = NULL;
if (f == NULL) {
return NULL; // no dial data found, that's fine
}
DIALData *result = NULL;
char key[DIAL_KEY_OR_VALUE_MAX_LEN + 1] = {0,};
char value[DIAL_KEY_OR_VALUE_MAX_LEN + 1] = {0,};
int err = 0;
while (fscanf(f, "%" DIAL_KEY_OR_VALUE_MAX_LEN_STR "s %" DIAL_KEY_OR_VALUE_MAX_LEN_STR "s\n", key, value) != EOF) {
DIALData *newNode = (DIALData *) malloc(sizeof(DIALData));
if (newNode == NULL) {
err = 1;
break;
}
newNode->key = (char *) calloc(strlen(key) + 1, sizeof(char));
if (newNode->key == NULL) {
err = 1;
free(newNode); newNode = NULL;
break;
}
strncpy(newNode->key, key, strlen(key));
newNode->value = (char *) calloc(strlen(value) + 1, sizeof(char));
if (newNode->value == NULL) {
err = 1;
free(newNode->key); newNode->key = NULL;
free(newNode); newNode = NULL;
break;
}
strncpy(newNode->value, value, strlen(value));
newNode->next = result;
result = newNode;
}
fclose(f);
if (err) {
free_dial_data(&result);
result = NULL;
}
return result;
}
void free_dial_data(DIALData **dialData)
{
DIALData *curNode=NULL;
while (*dialData != NULL) {
curNode = *dialData;
*dialData = curNode->next;
free(curNode->key); curNode->key = NULL;
free(curNode->value); curNode->value = NULL;
free(curNode); curNode = NULL;
}
}
|
/*************************************************************************
* Copyright (c) 2015, Synopsys, Inc. *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions are *
* met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
*************************************************************************/
// ChangeClassPermissionsAction.h: interface for the CChangeClassPermissionsAction class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_CHANGECLASSPERMISSIONSACTION_H_)
#define AFX_CHANGECLASSPERMISSIONSACTION_H_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ImpactAction.h"
#include "AttributesQueryResult.h"
class CChangeClassPermissionsAction : public CImpactAction
{
public:
DECLARE_DYNCREATE(CChangeClassPermissionsAction)
CChangeClassPermissionsAction();
CChangeClassPermissionsAction(CImpactCtrl* pCtrl);
virtual ~CChangeClassPermissionsAction();
CString GetUserInput(CEntity* pEntity, TRecord* pRecord, CString id);
bool ActionPerformed(CEntity* pEntity);
};
#endif // !defined(AFX_CHANGECLASSPERMISSIONSACTION_H_)
|
/*
* example_ms_hetsched.c
*
* Copyright (C) 2015, Achim Lösch <achim.loesch@upb.de>, Christoph Knorr <cknorr@mail.uni-paderborn.de>
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD license. See the LICENSE file for details.
*
* encoding: UTF-8
* tab size: 4
*
* author: Achim Lösch (achim.loesch@upb.de)
* created: 8/05/14
* version: 0.1.0 - initial implementation
* 0.1.4 - add signals for measuring system start and stop
* 0.1.13 - make GPU frequency settable
* 0.1.15 - make CPU frequency settable
* 0.2.4 - add version check functionality to library, wrappers, and tools
* 0.7.3 - add heatmaps to msmonitor and the enum ipmi_timeout_setting in libmeasure
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "../../../include/ms_hetschedwrapper.h"
typedef struct __task_context {
MTASK *mtask;
uint32_t duration_init;
uint32_t duration_compute;
uint32_t duration_free;
} TASK_CONTEXT;
int main(int argc, char **argv);
void pseudo_task(TASK_CONTEXT *ctxt);
int main(int argc, char **argv) {
// Init measuring system
MS_VERSION version = { .major = MS_MAJOR_VERSION, .minor = MS_MINOR_VERSION, .revision = MS_REVISION_VERSION };
mshetsched_init(&version, CPU_GOVERNOR_ONDEMAND, 2000000, 2500000, GPU_FREQUENCY_CUR, IPMI_SET_TIMEOUT, SKIP_NEVER, VARIANT_FULL, NULL, NULL);
// Task data container
TASK_CONTEXT ctxt;
ctxt.mtask = NULL;
ctxt.duration_init = 3;
ctxt.duration_compute = 20;
ctxt.duration_free = 4;
// Run task 5 seconds after hetsched start
sleep(5);
pseudo_task(&ctxt);
sleep(5);
// Destroy measuring system
mshetsched_destroy();
return EXIT_SUCCESS;
}
void pseudo_task(TASK_CONTEXT *ctxt) {
// Register pseudo task
mshetsched_register(&(ctxt->mtask));
// Execute pseudo init phase for calculation on device FPGA
mshetsched_init_fpga_init(ctxt->mtask);
printf("Task init...\n");
sleep(ctxt->duration_init);
mshetsched_fini_fpga_init(ctxt->mtask);
// Execute pseudo compute phase for calculation on device FPGA
mshetsched_init_fpga_compute(ctxt->mtask);
printf("Task compute part 1 of 2...\n");
sleep(ctxt->duration_compute/2);
mshetsched_fini_fpga_compute(ctxt->mtask);
sleep(1);
mshetsched_init_fpga_compute(ctxt->mtask);
printf("Task compute part 2 of 2...\n");
sleep(ctxt->duration_compute/2);
mshetsched_fini_fpga_compute(ctxt->mtask);
// Execute pseudo free phase for calculation on device FPGA
mshetsched_init_fpga_free(ctxt->mtask);
printf("Task free...\n");
sleep(ctxt->duration_free);
mshetsched_fini_fpga_free(ctxt->mtask);
// Get measurements for our task dispatched to FPGA
MREL_MEASUREMENT *fpga_init = mshetsched_get_fpga_init(ctxt->mtask);
MREL_MEASUREMENT *fpga_compute = mshetsched_get_fpga_compute(ctxt->mtask);
MREL_MEASUREMENT *fpga_free = mshetsched_get_fpga_free(ctxt->mtask);
printf("RESULTS:\n========\n");
printf("duration init [s]: %u\n", ctxt->duration_init);
printf("duration compute [s]: %u\n", ctxt->duration_compute);
printf("duration free [s]: %u\n", ctxt->duration_free);
// Print the CPU energy consumption of our pseudo FPGA task.
printf("\nCPU:\n====\n");
printf("CPU0 init [mWs]: %lf\n", fpga_init->acc_cpu0_energy_total_pkg + fpga_init->acc_cpu0_energy_total_dram);
printf("CPU0 compute [mWs]: %lf\n", fpga_compute->acc_cpu0_energy_total_pkg + fpga_compute->acc_cpu0_energy_total_dram);
printf("CPU0 free [mWs]: %lf\n", fpga_free->acc_cpu0_energy_total_pkg + fpga_free->acc_cpu0_energy_total_dram);
printf("CPU1 init [mWs]: %lf\n", fpga_init->acc_cpu1_energy_total_pkg + fpga_init->acc_cpu1_energy_total_dram);
printf("CPU1 compute [mWs]: %lf\n", fpga_compute->acc_cpu1_energy_total_pkg + fpga_compute->acc_cpu1_energy_total_dram);
printf("CPU1 free [mWs]: %lf\n", fpga_free->acc_cpu1_energy_total_pkg + fpga_free->acc_cpu1_energy_total_dram);
// Print the FPGA energy consumption of our pseudo FPGA task.
printf("\nFPGA:\n====\n");
printf("FPGA init [mWs]: %lf\n", fpga_init->acc_fpga_energy_total);
printf("FPGA compute [mWs]: %lf\n", fpga_compute->acc_fpga_energy_total);
printf("FPGA free [mWs]: %lf\n", fpga_free->acc_fpga_energy_total);
// Unregister pseudo task
mshetsched_unregister(&(ctxt->mtask));
}
|
/* { dg-do run } */
typedef struct {
long int p_x, p_y;
} Point;
int
f (Point basePt, Point pt1, Point pt2)
{
long long vector;
vector =
(long long) (pt1.p_x - basePt.p_x) * (long long) (pt2.p_y - basePt.p_y) -
(long long) (pt1.p_y - basePt.p_y) * (long long) (pt2.p_x - basePt.p_x);
if (vector > (long long) 0)
return 0;
else if (vector < (long long) 0)
return 1;
else
return 2;
}
main ()
{
Point b, p1, p2;
int answer;
b.p_x = -23250;
b.p_y = 23250;
p1.p_x = 23250;
p1.p_y = -23250;
p2.p_x = -23250;
p2.p_y = -23250;
answer = f (b, p1, p2);
if (answer != 1)
abort ();
exit (0);
}
|
/*
* YAFFS: Yet another Flash File System . A NAND-flash specific file system.
*
* Copyright (C) 2002-2018 Aleph One Ltd.
*
* Created by Timothy Manning <timothy@yaffs.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1 as
* published by the Free Software Foundation.
*
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
#ifndef __test_yaffs_sync_ENAMETOOLONG_h__
#define __test_yaffs_sync_ENAMETOOLONG_h__
#include "lib.h"
#include "yaffsfs.h"
int test_yaffs_sync_ENAMETOOLONG(void);
int test_yaffs_sync_ENAMETOOLONG_clean(void);
#endif
|
//=================================================================================================
/*!
// \file blaze/util/typetraits/Extent.h
// \brief Header file for the Extent type trait
//
// Copyright (C) 2012-2017 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
#ifndef _BLAZE_UTIL_TYPETRAITS_EXTENT_H_
#define _BLAZE_UTIL_TYPETRAITS_EXTENT_H_
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <blaze/util/IntegralConstant.h>
namespace blaze {
//=================================================================================================
//
// CLASS DEFINITION
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Compile time check for the size of array bounds.
// \ingroup type_traits
//
// Via this type trait it is possible to query at compile time for the size of a particular
// array extent. In case the given template argument is an array type with a rank greater
// than N, the \a value member constant is set to the number of elements of the N'th array
// dimension. In all other cases, and especially in case the N'th array dimension is
// incomplete, \a value is set to 0.
\code
blaze::Extent< int[4], 0U >::value // Evaluates to 4
blaze::Extent< int[2][3][4], 0U >::value // Evaluates to 2
blaze::Extent< int[2][3][4], 1U >::value // Evaluates to 3
blaze::Extent< int[2][3][4], 2U >::value // Evaluates to 4
blaze::Extent< int[][2], 0U >::value // Evaluates to 0
blaze::Extent< int[][2], 1U >::value // Evaluates to 2
blaze::Extent< int*, 0U >::value // Evaluates to 0
blaze::Extent< std::vector<int>, 0U >::value // Evaluates to 0 (std::vector is NOT an array type)
\endcode
*/
template< typename T, unsigned int N >
struct Extent
: public IntegralConstant<unsigned int,0U>
{};
//*************************************************************************************************
//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
//! Partial specialization of the Extent type trait for empty array extents.
template< typename T, unsigned int N >
struct Extent<T[],N>
: public IntegralConstant<unsigned int,Extent<T,N-1U>::value>
{};
/*! \endcond */
//*************************************************************************************************
//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
//! Partial specialization of the Extent type trait for non-empty array extents.
template< typename T, unsigned int N, unsigned int E >
struct Extent<T[E],N>
: public IntegralConstant<unsigned int,Extent<T,N-1U>::value>
{};
/*! \endcond */
//*************************************************************************************************
//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
//! Terminating partial specialization of the Extent type trait for empty array extents.
template< typename T >
struct Extent<T[],0UL>
: public IntegralConstant<unsigned int,0U>
{};
/*! \endcond */
//*************************************************************************************************
//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
//! Terminating partial specialization of the Extent type trait for non-empty array extents.
template< typename T, unsigned int E >
struct Extent<T[E],0U>
: public IntegralConstant<unsigned int,E>
{};
/*! \endcond */
//*************************************************************************************************
} // namespace blaze
#endif
|
// coding: utf-8
#include <avr/io.h>
#include <avr/pgmspace.h>
#include "can.h"
// -----------------------------------------------------------------------------
/** Set filters and masks.
*
* The filters are divided in two groups:
*
* Group 0: Filter 0 and 1 with corresponding mask 0.
* Group 1: Filter 2, 3, 4 and 5 with corresponding mask 1.
*
* If a group mask is set to 0, the group will receive all messages.
*
* If you want to receive ONLY 11 bit identifiers, set your filters
* and masks as follows:
*
* prog_uint8_t can_filter[] = {
* // Group 0
* MCP2515_FILTER(0), // Filter 0
* MCP2515_FILTER(0), // Filter 1
*
* // Group 1
* MCP2515_FILTER(0), // Filter 2
* MCP2515_FILTER(0), // Filter 3
* MCP2515_FILTER(0), // Filter 4
* MCP2515_FILTER(0), // Filter 5
*
* MCP2515_FILTER(0), // Mask 0 (for group 0)
* MCP2515_FILTER(0), // Mask 1 (for group 1)
* };
*
*
* If you want to receive ONLY 29 bit identifiers, set your filters
* and masks as follows:
*
* \code
* prog_uint8_t can_filter[] = {
* // Group 0
* MCP2515_FILTER_EXTENDED(0), // Filter 0
* MCP2515_FILTER_EXTENDED(0), // Filter 1
*
* // Group 1
* MCP2515_FILTER_EXTENDED(0), // Filter 2
* MCP2515_FILTER_EXTENDED(0), // Filter 3
* MCP2515_FILTER_EXTENDED(0), // Filter 4
* MCP2515_FILTER_EXTENDED(0), // Filter 5
*
* MCP2515_FILTER_EXTENDED(0), // Mask 0 (for group 0)
* MCP2515_FILTER_EXTENDED(0), // Mask 1 (for group 1)
* };
* \endcode
*
* If you want to receive both 11 and 29 bit identifiers, set your filters
* and masks as follows:
*/
prog_uint8_t can_filter[] =
{
// Group 0
MCP2515_FILTER(0), // Filter 0
MCP2515_FILTER(0), // Filter 1
// Group 1
MCP2515_FILTER_EXTENDED(0), // Filter 2
MCP2515_FILTER_EXTENDED(0), // Filter 3
MCP2515_FILTER_EXTENDED(0), // Filter 4
MCP2515_FILTER_EXTENDED(0), // Filter 5
MCP2515_FILTER(0), // Mask 0 (for group 0)
MCP2515_FILTER_EXTENDED(0), // Mask 1 (for group 1)
};
// You can receive 11 bit identifiers with either group 0 or 1.
// -----------------------------------------------------------------------------
// Main loop for receiving and sending messages.
int main(void)
{
// Initialize MCP2515
can_init(BITRATE_125_KBPS);
// Load filters and masks
can_static_filter(can_filter);
// Create a test messsage
can_t msg;
msg.id = 0x123456;
msg.flags.rtr = 0;
msg.flags.extended = 1;
msg.length = 4;
msg.data[0] = 0xde;
msg.data[1] = 0xad;
msg.data[2] = 0xbe;
msg.data[3] = 0xef;
// Send the message
can_send_message(&msg);
while (1)
{
// Check if a new messag was received
if (can_check_message())
{
can_t msg;
// Try to read the message
if (can_get_message(&msg))
{
// If we received a message resend it with a different id
msg.id += 10;
// Send the new message
can_send_message(&msg);
}
}
}
return 0;
}
|
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <complex.h>
#include "Matrix.h"
/**
*Real matrix methods.
*/
#define TYPE Real
#define MANGLE(x) rmat##x
#include "Matrix.tc"
#undef TYPE
#undef MANGLE
/**
*Complex matrix methods.
*/
#define TYPE Complex
#define MANGLE(x) cmat##x
#include "Matrix.tc"
#undef TYPE
#undef MANGLE
/**
*Index matrix methods.
*/
#define TYPE Index
#define MANGLE(x) imat##x
#include "Matrix.tc"
#undef TYPE
#undef MANGLE
|
/* Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdio.h>
#include <libio.h>
#include <bits/stdio-lock.h>
void
__flockfile (stream)
FILE *stream;
{
// _IO_lock_lock (*stream->_lock);
}
strong_alias (__flockfile, _IO_flockfile)
weak_alias (__flockfile, flockfile)
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "K2Node.h"
#include "K2Node_Knot.generated.h"
UCLASS(MinimalAPI)
class UK2Node_Knot : public UK2Node
{
GENERATED_UCLASS_BODY()
public:
// UEdGraphNode interface
virtual void AllocateDefaultPins() override;
virtual FText GetTooltipText() const override;
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
virtual bool ShouldOverridePinNames() const override;
virtual FText GetPinNameOverride(const UEdGraphPin& Pin) const override;
virtual void OnRenameNode(const FString& NewName) override;
virtual TSharedPtr<class INameValidatorInterface> MakeNameValidator() const override;
virtual bool AllowSplitPins() const override;
virtual bool IsCompilerRelevant() const override { return false; }
virtual UEdGraphPin* GetPassThroughPin(const UEdGraphPin* FromPin) const override;
// End of UEdGraphNode interface
// UK2Node interface
virtual bool IsNodeSafeToIgnore() const override;
virtual void ExpandNode(class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph) override;
virtual void NotifyPinConnectionListChanged(UEdGraphPin* Pin) override;
virtual void PostReconstructNode() override;
virtual int32 GetNodeRefreshPriority() const override { return EBaseNodeRefreshPriority::Low_UsesDependentWildcard; }
virtual void GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const override;
virtual bool IsNodePure() const { return true; }
// End of UK2Node interface
UEdGraphPin* GetInputPin() const
{
return Pins[0];
}
UEdGraphPin* GetOutputPin() const
{
return Pins[1];
}
};
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "RuntimeAssetCacheBucket.h"
/*
* Scope lock guarding RuntimeAssetCache bucket metadata critical section.
**/
class FRuntimeAssetCacheBucketScopeLock
{
public:
FRuntimeAssetCacheBucketScopeLock(FRuntimeAssetCacheBucket& InBucket)
: Bucket(InBucket)
{
Bucket.MetadataCriticalSection.Lock();
}
~FRuntimeAssetCacheBucketScopeLock()
{
Bucket.MetadataCriticalSection.Unlock();
}
private:
/** Bucket to protect. */
FRuntimeAssetCacheBucket& Bucket;
}; |
/*
* cguess - C/C++/Java(tm) auto-completion tool for VIM
* Copyright (C) 2005 Andrzej Zaborowski <balrogg@gmail.com>
* All Rights Reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
* A linked list that can be used for implementing the symbol
* table, but will not be too efficient.
*/
#include <stdlib.h>
#include <string.h>
#include "list.h"
#include "stack.h"
#include "cguess.h"
struct list_element_s {
const void *data;
const char *key;
struct list_element_s *next;
};
void list_init(struct list_s *list) {
list->head = 0;
}
void list_insert(struct list_s *list, const void *data, const char *key) {
struct list_element_s *element =
malloc(sizeof(struct list_element_s));
if (!element) {
/* Do something */
exit(-1);
}
element->data = data;
element->key = key;
element->next = list->head;
list->head = element;
}
const void *list_find(struct list_s *list, const char *key) {
struct list_element_s *element;
for (element = list->head; element; element = element->next)
if (!strcmp(element->key, key))
return element->data;
return 0;
}
void list_delete(struct list_s *list, const char *key) {
struct list_element_s *element, *t;
if (list->head && !strcmp(list->head->key, key)) {
t = list->head->next;
free(list->head);
list->head = t;
return;
} else
if (!list->head)
return;
for (element = list->head; element->next; element = element->next)
if (!strcmp(element->next->key, key)) {
t = element->next->next;
free(element->next);
element->next = t;
return;
}
}
/*
* Calls a given function for each element of the list.
*/
void list_foreach(struct list_s *list, list_iterator_t iter, void *data) {
struct list_element_s *element;
for (element = list->head; element &&
iter((void *) element->data, data);
element = element->next);
}
void list_done(struct list_s *list) {
struct list_element_s *element;
for (element = list->head; element; element = list->head) {
list->head = element->next;
free(element);
}
list->head = 0;
}
|
/* zmalloc - total amount of allocated memory aware version of malloc()
*
* Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Redis nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __ZMALLOC_H
#define __ZMALLOC_H
/* Double expansion needed for stringification of macro values. */
#define __xstr(s) __str(s)
#define __str(s) #s
#if defined(USE_TCMALLOC)
#define ZMALLOC_LIB ("tcmalloc-" __xstr(TC_VERSION_MAJOR) "." __xstr(TC_VERSION_MINOR))
#include <google/tcmalloc.h>
#if (TC_VERSION_MAJOR == 1 && TC_VERSION_MINOR >= 6) || (TC_VERSION_MAJOR > 1)
#define HAVE_MALLOC_SIZE 1
#define zmalloc_size(p) tc_malloc_size(p)
#else
#error "Newer version of tcmalloc required"
#endif
#elif defined(USE_JEMALLOC)
#define ZMALLOC_LIB ("jemalloc-" __xstr(JEMALLOC_VERSION_MAJOR) "." __xstr(JEMALLOC_VERSION_MINOR) "." __xstr(JEMALLOC_VERSION_BUGFIX))
#include <jemalloc/jemalloc.h>
#if (JEMALLOC_VERSION_MAJOR == 2 && JEMALLOC_VERSION_MINOR >= 1) || (JEMALLOC_VERSION_MAJOR > 2)
#define HAVE_MALLOC_SIZE 1
#define zmalloc_size(p) je_malloc_usable_size(p)
#else
#error "Newer version of jemalloc required"
#endif
#elif defined(__APPLE__)
#include <malloc/malloc.h>
#define HAVE_MALLOC_SIZE 1
#define zmalloc_size(p) malloc_size(p)
#elif defined(USE_DLMALLOC)
#include "win32_Interop/win32_dlmalloc.h"
#define ZMALLOC_LIB ("dlmalloc-" __xstr(2) "." __xstr(8) )
#define HAVE_MALLOC_SIZE 1
#define zmalloc_size(p) dlmalloc_usable_size(p)
#endif
#ifndef ZMALLOC_LIB
#define ZMALLOC_LIB "libc"
#endif
void *zmalloc(size_t size);
void *zcalloc(size_t size);
void *zrealloc(void *ptr, size_t size);
void zfree(void *ptr);
char *zstrdup(const char *s);
size_t zmalloc_used_memory(void);
void zmalloc_enable_thread_safeness(void);
void zmalloc_set_oom_handler(void (*oom_handler)(size_t));
float zmalloc_get_fragmentation_ratio(void);
size_t zmalloc_get_rss(void);
size_t zmalloc_get_private_dirty(void);
void zlibc_free(void *ptr);
#ifdef _WIN32
void zmalloc_free_used_memory_mutex(void);
#endif
#ifndef HAVE_MALLOC_SIZE
size_t zmalloc_size(void *ptr);
#endif
#endif /* __ZMALLOC_H */
|
/**
* Linked list node.
*/
struct list {
/** Next node. */
struct list *next;
/** Data. */
int data;
};
|
#include <uppconfig.h>
#if __GNUC__
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#define COMPILER_GCC 1
#if __WIN32
#define COMPILER_MINGW
#define PLATFORM_WIN32
#endif
#if __unix || __unix__ || __APPLE__
#define PLATFORM_POSIX 1
#if __linux
#define PLATFORM_LINUX 1
// zvzv add
// __linux is undef on APPLE MACOSX, MACOSX has BSD stuff
#elif __APPLE__
// zvzv note
// s/b MACOSX
#define PLATFORM_OSX11 1
#define PLATFORM_BSD 1
#else
// zvzv mod
// was: #if __FreeBSD__ || __OpenBSD__ || __NetBSD__ || __APPLE__
#if __FreeBSD__ || __OpenBSD__ || __NetBSD__
#define PLATFORM_BSD 1
#if __FreeBSD__
#define PLATFORM_FREEBSD 1
#endif
#if __OpenBSD__
#define PLATFORM_OPENBSD 1
#endif
#if __NetBSD__
#define PLATFORM_NETBSD 1
#endif
#elif __sun
#define PLATFORM_SOLARIS 1
#else
#error Unknown OS
#endif
#endif
#endif
#if __x86_64
#define CPU_LE 1
#define CPU_LITTLE_ENDIAN 1
#define CPU_UNALIGNED 1
#define CPU_X86 1
#define CPU_64 1
#define CPU_AMD64 1
#define CPU_SSE2 1
#define CPU_IA64 1
#elif __i386 || __i386__ || i386
#define CPU_LE 1
#define CPU_LITTLE_ENDIAN 1
#define CPU_UNALIGNED 1
#define CPU_X86 1
#define CPU_32 1
#define CPU_IA32 1
#ifdef flagSSE2
#define CPU_SSE2 1
#endif
#elif __sparc // ToDo!
#define CPU_32 1
#define CPU_SPARC 1
#define CPU_BE 1
#define CPU_BIG_ENDIAN 1
#define CPU_ALIGNED 1
#elif __arm // ToDo!
#define CPU_32 1
#define CPU_ARM 1
#define CPU_LE 1
#define CPU_LITTLE_ENDIAN 1 // is it really?
#define CPU_ALIGNED 1
#elif __bfin
#define CPU_32 1
#define CPU_BLACKFIN
#define CPU_LE 1
#define CPU_LITTLE_ENDIAN 1
#define CPU_ALIGNED 1
#define _HAVE_NO_STDWSTRING 1
//BF toolchain has no support for __thread (TLS), so U++ Heap not possible
#define flagUSEMALLOC
#else
#error Unknown CPU architecture
#endif
#endif
#ifdef _MSC_VER
#define COMPILER_MSC 1
#ifndef _CPPRTTI
#error RTTI must be enabled !!!
#endif //_CPPRTTI
#if _MSC_VER <= 1300
#error MSC 6.0 not supported anymore
#endif
#pragma warning(disable: 4786)
#define _CRT_SECURE_NO_DEPRECATE 1 // we really need strcpy etc. to work with MSC 8.0
#define PLATFORM_WIN32 1
#define CPU_LE 1
#define CPU_LITTLE_ENDIAN 1
#define CPU_UNALIGNED 1
#define CPU_X86 1
#ifdef _WIN64
#define PLATFORM_WIN64 1
#define CPU_64 1
#define CPU_AMD64 1
#define CPU_SSE2 1
#define CPU_IA64 1
#else
#define CPU_32 1
#define CPU_IA32 1
#ifdef flagSSE2
#define CPU_SSE2 1
#endif
#endif
#endif
#ifdef flagCLR
#define flagUSEMALLOC
#endif
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MovieScene.h"
#include "MovieSceneTrack.h"
#include "MovieScenePropertyTrack.h"
#include "MovieScene3DTransformTrack.generated.h"
namespace F3DTransformTrackKey
{
enum Type
{
Key_Translation = 0x00000001,
Key_Rotation = 0x00000002,
Key_Scale = 0x00000004,
Key_All = Key_Translation | Key_Rotation | Key_Scale
};
}
/**
* Stores information about a transform for the purpose of adding keys to a transform section
*/
struct FTransformData
{
/** Translation component */
FVector Translation;
/** Rotation component */
FRotator Rotation;
/** Scale component */
FVector Scale;
/** Whether or not the data is valid (any values set) */
bool bValid;
bool IsValid() const { return bValid; }
/**
* Constructor. Builds the data from a scene component
* Uses relative transform only
*
* @param InComponent The component to build from
*/
FTransformData( const USceneComponent* InComponent )
: Translation( InComponent->RelativeLocation )
, Rotation( InComponent->RelativeRotation )
, Scale( InComponent->RelativeScale3D )
, bValid( true )
{}
FTransformData()
: bValid( false )
{}
};
/**
* Represents a transform that should be keyed at a specific time
*
* Only keys components of the transform that have changed
*/
class FTransformKey
{
public:
/**
* Constructor
*
* @param InKeyTime The time where keys should be added
* @param InNewTransform The transform values that should be keyed
* @param PreviousTransform The previous transform values (for comparing against new values). If this is set only changed values will be keyed
*
*/
FTransformKey( float InKeyTime, const FTransformData& InNewTransform, const FTransformData& InPreviousTransform = FTransformData() )
: NewTransform( InNewTransform )
, PreviousTransform( InPreviousTransform )
, KeyTime( InKeyTime )
{
}
/** @return The time where transform keys should be added */
float GetKeyTime() const { return KeyTime; }
/** @return the translation value of the key */
const FVector& GetTranslationValue() const { return NewTransform.Translation; }
/** @return the rotation value of the key */
const FRotator& GetRotationValue() const { return NewTransform.Rotation; }
/** @return the scale value of the key */
const FVector& GetScaleValue() const { return NewTransform.Scale; }
/**
* Determines if a key should be added on the given axis of translation
*
* @param Axis The axis to check
* @return Whether or not we should key translation on the given axis
*/
bool ShouldKeyTranslation( EAxis::Type Axis ) const;
/**
* Determines if a key should be added on the given axis of rotation
*
* @param Axis The axis to check
* @return Whether or not we should key rotation on the given axis
*/
bool ShouldKeyRotation( EAxis::Type Axis ) const;
/**
* Determines if a key should be added on the given axis of scale
*
* @param Axis The axis to check
* @return Whether or not we should key scale on the given axis
*/
bool ShouldKeyScale( EAxis::Type Axis ) const;
/**
* Determines if a key should be added to any axis for any type of transform
*
* @return Whether or not we should key on the given axis
*/
bool ShouldKeyAny() const;
private:
/**
* Determines whether or not a vector component is different on the given axis
*
* @param Axis The axis to check
* @param Current The current vector value
* @param Previous The previous vector value
* @return true if a vector component is different on the given axis
*/
bool GetVectorComponentIfDifferent( EAxis::Type Axis, const FVector& Current, const FVector& Previous ) const;
private:
/** New transform data */
FTransformData NewTransform;
FTransformData PreviousTransform;
float KeyTime;
};
/**
* Handles manipulation of component transforms in a movie scene
*/
UCLASS( MinimalAPI )
class UMovieScene3DTransformTrack : public UMovieScenePropertyTrack
{
GENERATED_UCLASS_BODY()
public:
/** UMovieSceneTrack interface */
virtual UMovieSceneSection* CreateNewSection() override;
virtual TSharedPtr<IMovieSceneTrackInstance> CreateInstance() override;
/**
* Adds a key to a section. Will create the section if it doesn't exist
*
* @param ObjectHandle Handle to the object(s) being changed
* @param InKey The transform key to add
* @param bUnwindRotation When true, the value will be treated like a rotation value in degrees, and will automatically be unwound to prevent flipping 360 degrees from the previous key
* @param KeyType Key type (trans, rot, scale)
* @return True if the key was successfully added.
*/
virtual bool AddKeyToSection( const FGuid& ObjectHandle, const FTransformKey& InKey, const bool bUnwindRotation, F3DTransformTrackKey::Type KeyType = F3DTransformTrackKey::Key_All );
/**
* Evaluates the track at the playback position
*
* @param Position The current playback position
* @param LastPosition The last plackback position
* @param OutTranslation The evalulated translation component of the transform
* @param OutRotation The evalulated rotation component of the transform
* @param OutScale The evalulated scale component of the transform
* @param OutHasTranslationKeys true if a translation key was evaluated
* @param OutHasRotationKeys true if a rotation key was evaluated
* @param OutHasScaleKeys true if a scale key was evaluated
* @return true if anything was evaluated. Note: if false is returned OutBool remains unchanged
*/
virtual bool Eval( float Position, float LastPosition, FVector& OutTranslation, FRotator& OutRotation, FVector& OutScale, TArray<bool>& OutHasTranslationKeys, TArray<bool>& OutHasRotationKeys, TArray<bool>& OutHasScaleKeys ) const;
};
|
#define CTR_REGEX_PLUGIN "Regex" |
/*
* Copyright 2016, Data61, CSIRO (ABN 41 687 119 230)
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#ifndef _REFOS_UTIL_DEVICE_IRQ_HANDLER_HELPER_LIBRARY_H_
#define _REFOS_UTIL_DEVICE_IRQ_HANDLER_HELPER_LIBRARY_H_
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#include <sel4/sel4.h>
#include <refos/refos.h>
#include <refos-util/serv_common.h>
#include <refos-util/serv_connect.h>
#include <data_struct/cvector.h>
#define DEVICE_MAX_IRQ 256
#define DEVICE_IRQ_BADGE_MAX_CHANNELS 28
#define DEVICE_IRQ_MAGIC 0x6220E130
/*! @file
@brief Device IRQ handling library.
Unfortunately seL4 async device IRQ badges are quite complicated.
Firstly, a badgeMaskBits mask is used to distinguish between device IRQ messages and messages of
other type that the server may recieve, so endpoint sharing is supported. If the server does not
share the device IRQ endpoint with anything else then simply set this badgeMaskBits to 0.
In the example below, bit 19 has been used as the device IRQ badge flag.
Then, out of the remaining available bits, a bit range is used to indicate an IRQ happening.
In the example below, bits 1 - 18 has been used as the range. Every IRQ that the server needs
to be able to handle is allocated a bit. If the server needs to handle more than 18 different
IRQ then channel conflict occurs and we reuse an allocated channel, resulting in both IRQ
handlers getting called, spurious IRQs. This is a limitation of a single endpoint IRQ reciever
design.
IRQ badges:
◀――― lower bits higher bits ―――▶
0 0 1 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 1
⎣_________________________________⎦ ▲ badgeMaskBits = 0x80000
▲ ▲ ▲
badgeBaseBit Bitmask indicating badgeTopBit
which IRQ channels
happened.
numIRQChannels = badgeTopBit - badgeBaseBit - 1
*/
typedef void (*dev_irq_callback_fn_t)(void *cookie, uint32_t irq);
/*! @brief IRQ handler struct. */
typedef struct dev_irq_handler {
seL4_CPtr handler;
dev_irq_callback_fn_t callback;
void *cookie;
} dev_irq_handler_t;
/*! @brief IRQ state configuration struct.
*/
typedef struct dev_irq_config {
int numIRQChannels;
int badgeBaseBit;
int badgeTopBit;
uint32_t badgeMaskBits;
seL4_CPtr notifyAsyncEP;
seL4_CPtr (*getIRQHandlerEndpoint)(void *cookie, int irq);
void *getIRQHandlerEndpointCookie;
} dev_irq_config_t;
/*! @brief IRQ handler state struct. */
typedef struct dev_irq_state {
int magic;
dev_irq_config_t cfg;
dev_irq_handler_t handler[DEVICE_MAX_IRQ];
cvector_t channel[DEVICE_IRQ_BADGE_MAX_CHANNELS];
uint32_t nextIRQChannel;
} dev_irq_state_t;
/*! @brief Initialise IRQ handler helper library state.
@param irqState The IRQ state struct.
@param config The config struct.
*/
void dev_irq_init(dev_irq_state_t *irqState, dev_irq_config_t config);
/*! @brief Helper function to set up a callback function to the given IRQ number.
Each IRQ number by only have one callback set.
@param irqState The IRQ state struct.
@param irq The IRQ number to set callback for.
@param callback The callback function to set.
@param cookie The cookie that will be passed onto the callback function.
@return ESUCCESS if success, refos_err_t otherwise.
*/
int dev_handle_irq(dev_irq_state_t *irqState, uint32_t irq,
dev_irq_callback_fn_t callback, void *cookie);
/*! @brief Dispatch a device interrupt message.
@param irqState The IRQ state struct.
@param m The recieved interrupt message.
@return DISPATCH_SUCCESS if successfully dispatched, DISPATCH_ERROR if there was an unexpected
error, DISPATCH_PASS if the given message is not an interrupt message.
*/
int dev_dispatch_interrupt(dev_irq_state_t *irqState, srv_msg_t *m);
#endif /* _REFOS_UTIL_DEVICE_IRQ_HANDLER_HELPER_LIBRARY_H_ */
|
/*
* Copyright (C) 2012-2015, Juan Manuel Barrios <http://juan.cl/>
* All rights reserved.
*
* This file is part of P-VCD. http://p-vcd.org/
* P-VCD is made available under the terms of the BSD 2-Clause License.
*/
#include "process.h"
#ifndef NO_OPENCV
struct State_ComputePca {
char *filenameState;
double sampleFractionSegments, sampleFractionPerFrame;
};
static void computePca_new(const char *segCode, const char *segParameters,
void **out_state) {
MyTokenizer *tk = my_tokenizer_new(segParameters, '_');
struct State_ComputePca *es = MY_MALLOC(1, struct State_ComputePca);
es->filenameState = my_tokenizer_nextToken_newString(tk);
es->sampleFractionSegments = my_tokenizer_nextDouble0(tk);
es->sampleFractionPerFrame = my_tokenizer_nextDouble0(tk);
my_tokenizer_releaseValidateEnd(tk);
my_assert_notNull("filenameState", es->filenameState);
*out_state = es;
}
static void computePca_process(LoadDescriptors *desloader, void *state) {
struct State_ComputePca *es = state;
MknnPcaAlgorithm *pca = mknn_pca_new();
DB *db = loadDescriptors_getDb(desloader);
for (int64_t i = 0; i < db->numFilesDb; ++i) {
struct DescriptorsFile *df = loadDescriptorsFileDB(desloader,
db->filesDb[i]);
MknnDataset *dataset = loadDescriptorsFile_getMknnDataset(df,
es->sampleFractionSegments, es->sampleFractionPerFrame);
mknn_pca_addDatasetToVectorStats(pca, dataset);
mknn_dataset_release(dataset);
releaseLoadDescriptors_allFileBytes(desloader);
}
mknn_pca_computeTransformationMatrix(pca);
mknn_pca_save(pca, es->filenameState, true);
mknn_pca_release(pca);
}
static void computePca_release(void *state) {
struct State_ComputePca *es = state;
MY_FREE_MULTI(es->filenameState, es);
}
#endif
void proc_reg_computePca() {
#ifndef NO_OPENCV
addProcessorDefDescriptor("PCA-COMPUTE",
"filenameStatePca_(sampleFractionSegments)_(sampleFractionPerFrame)",
computePca_new, computePca_process, computePca_release);
#endif
}
|
/*
* Copyright (C) 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef AccessibilityTable_h
#define AccessibilityTable_h
#include "AccessibilityRenderObject.h"
#include <wtf/Forward.h>
namespace WebCore {
class AccessibilityTableCell;
class HTMLTableElement;
class RenderTableSection;
class AccessibilityTable : public AccessibilityRenderObject {
public:
static Ref<AccessibilityTable> create(RenderObject*);
virtual ~AccessibilityTable();
void init() final;
AccessibilityRole roleValue() const final;
virtual bool isAriaTable() const { return false; }
void addChildren() override;
void clearChildren() final;
const AccessibilityChildrenVector& columns();
const AccessibilityChildrenVector& rows();
virtual bool supportsSelectedRows() { return false; }
unsigned columnCount();
unsigned rowCount();
int tableLevel() const final;
String title() const final;
// all the cells in the table
void cells(AccessibilityChildrenVector&);
AccessibilityTableCell* cellForColumnAndRow(unsigned column, unsigned row);
void columnHeaders(AccessibilityChildrenVector&);
void rowHeaders(AccessibilityChildrenVector&);
void visibleRows(AccessibilityChildrenVector&);
// an object that contains, as children, all the objects that act as headers
AccessibilityObject* headerContainer();
// isExposableThroughAccessibility() is whether it is exposed as an AccessibilityTable to the platform.
bool isExposableThroughAccessibility() const;
int ariaColumnCount() const;
int ariaRowCount() const;
protected:
explicit AccessibilityTable(RenderObject*);
AccessibilityChildrenVector m_rows;
AccessibilityChildrenVector m_columns;
RefPtr<AccessibilityObject> m_headerContainer;
bool m_isExposableThroughAccessibility;
bool hasARIARole() const;
// isTable is whether it's an AccessibilityTable object.
bool isTable() const final { return true; }
// isDataTable is whether it is exposed as an AccessibilityTable because the heuristic
// think this "looks" like a data-based table (instead of a table used for layout).
bool isDataTable() const final;
bool computeAccessibilityIsIgnored() const final;
private:
virtual bool computeIsTableExposableThroughAccessibility() const;
void titleElementText(Vector<AccessibilityText>&) const final;
HTMLTableElement* tableElement() const;
void addChildrenFromSection(RenderTableSection*, unsigned& maxColumnCount);
void addTableCellChild(AccessibilityObject*, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount);
};
} // namespace WebCore
SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityTable, isTable())
#endif // AccessibilityTable_h
|
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)if_dl.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: releng/10.2/sys/net/if_dl.h 235640 2012-05-19 02:39:43Z marcel $
*/
#ifndef _NET_IF_DL_H_
#define _NET_IF_DL_H_
/*
* A Link-Level Sockaddr may specify the interface in one of two
* ways: either by means of a system-provided index number (computed
* anew and possibly differently on every reboot), or by a human-readable
* string such as "il0" (for managerial convenience).
*
* Census taking actions, such as something akin to SIOCGCONF would return
* both the index and the human name.
*
* High volume transactions (such as giving a link-level ``from'' address
* in a recvfrom or recvmsg call) may be likely only to provide the indexed
* form, (which requires fewer copy operations and less space).
*
* The form and interpretation of the link-level address is purely a matter
* of convention between the device driver and its consumers; however, it is
* expected that all drivers for an interface of a given if_type will agree.
*/
/*
* Structure of a Link-Level sockaddr:
*/
struct sockaddr_dl {
u_char sdl_len; /* Total length of sockaddr */
u_char sdl_family; /* AF_LINK */
u_short sdl_index; /* if != 0, system given index for interface */
u_char sdl_type; /* interface type */
u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
u_char sdl_alen; /* link level address length */
u_char sdl_slen; /* link layer selector length */
char sdl_data[46]; /* minimum work area, can be larger;
contains both if name and ll address */
};
#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
#define LLINDEX(s) ((s)->sdl_index)
#ifndef _KERNEL
#include <sys/cdefs.h>
__BEGIN_DECLS
void link_addr(const char *, struct sockaddr_dl *);
char *link_ntoa(const struct sockaddr_dl *);
__END_DECLS
#endif /* !_KERNEL */
#endif
|
/*
* YAFFS: Yet another FFS. A NAND-flash specific file system.
*
* Copyright (C) 2002-2018 Aleph One Ltd.
*
* Created by Timothy Manning <timothy@yaffs.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include "test_yaffs_sync_ENODEV.h"
int test_yaffs_sync_ENODEV(void)
{
int error_code=-1;
int output = yaffs_sync("non-existing-dir/foo");
if (output<0){
error_code=yaffs_get_error();
if (abs(error_code)==ENODEV){
return 1;
} else {
print_message("returned error does not match the the expected error\n",2);
return -1;
}
} else {
print_message("synced a file in a non-existing directory (which is a bad thing)\n",2);
return -1;
}
}
int test_yaffs_sync_ENODEV_clean(void)
{
return 1;
}
|
/* Copyright (c) 2012, Bastien Dejean
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BSPWM_RESTORE_H
#define BSPWM_RESTORE_H
#include "jsmn.h"
bool restore_tree(const char *file_path);
monitor_t *restore_monitor(jsmntok_t **t, char *json);
desktop_t *restore_desktop(jsmntok_t **t, char *json);
node_t *restore_node(jsmntok_t **t, char *json);
presel_t *restore_presel(jsmntok_t **t, char *json);
client_t *restore_client(jsmntok_t **t, char *json);
void restore_rectangle(xcb_rectangle_t *r, jsmntok_t **t, char *json);
void restore_padding(padding_t *p, jsmntok_t **t, char *json);
void restore_history(jsmntok_t **t, char *json);
void restore_coordinates(coordinates_t *loc, jsmntok_t **t, char *json);
void restore_stack(jsmntok_t **t, char *json);
void restore_wm_state(xcb_atom_t *w, jsmntok_t **t, char *json);
bool keyeq(char *s, jsmntok_t *key, char *json);
#endif
|
// https://github.com/attractivechaos/klib/blob/master/krng.h
#pragma once
#include <stdint.h>
typedef struct {
uint64_t s[2];
} krng_t;
static inline uint64_t kr_splitmix64(uint64_t x)
{
uint64_t z = (x += 0x9E3779B97F4A7C15ULL);
z = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9ULL;
z = (z ^ (z >> 27)) * 0x94D049BB133111EBULL;
return z ^ (z >> 31);
}
static inline uint64_t kr_rand_r(krng_t * r)
{
const uint64_t s0 = r->s[0];
uint64_t s1 = r->s[1];
const uint64_t result = s0 + s1;
s1 ^= s0;
r->s[0] = (s0 << 55 | s0 >> 9) ^ s1 ^ (s1 << 14);
r->s[1] = s0 << 36 | s0 >> 28;
return result;
}
static inline void kr_jump_r(krng_t * r)
{
static const uint64_t JUMP[] = {0xbeac0467eba5facbULL,
0xd86b048b86aa9922ULL};
uint64_t s0 = 0, s1 = 0;
int i, b;
for (i = 0; i < 2; ++i)
for (b = 0; b < 64; b++) {
if (JUMP[i] & 1ULL << b) {
s0 ^= r->s[0];
s1 ^= r->s[1];
}
kr_rand_r(r);
}
r->s[0] = s0;
r->s[1] = s1;
}
static inline void kr_srand_r(krng_t * r, uint64_t seed)
{
r->s[0] = kr_splitmix64(seed);
r->s[1] = kr_splitmix64(r->s[0]);
}
static inline double kr_drand_r(krng_t * r)
{
union {
uint64_t i;
double d;
} u;
u.i = 0x3FFULL << 52 | kr_rand_r(r) >> 12;
return u.d - 1.0;
}
|
/* Copyright (c) Citrix Systems Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms,
* with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _XENVBD_BUFFER_H
#define _XENVBD_BUFFER_H
#include <wdm.h>
#include <xenvbd-storport.h>
extern VOID
BufferInitialize(
);
extern VOID
BufferTerminate(
);
extern BOOLEAN
BufferGet(
OUT PULONG BufferId,
OUT PFN_NUMBER* Pfn
);
extern VOID
BufferPut(
IN ULONG BufferId
);
extern VOID
BufferCopyIn(
IN ULONG BufferId,
IN PVOID Input,
IN ULONG Length
);
extern VOID
BufferCopyOut(
IN ULONG BufferId,
IN PVOID Output,
IN ULONG Length
);
#endif // _XENVBD_BUFFER_H
|
#ifndef VRPTW_RELOCATE_H
#define VRPTW_RELOCATE_H
/*
This file is part of VROOM.
Copyright (c) 2015-2022, Julien Coupey.
All rights reserved (see LICENSE).
*/
#include "problems/cvrp/operators/relocate.h"
namespace vroom {
namespace vrptw {
class Relocate : public cvrp::Relocate {
private:
TWRoute& _tw_s_route;
TWRoute& _tw_t_route;
public:
Relocate(const Input& input,
const utils::SolutionState& sol_state,
TWRoute& tw_s_route,
Index s_vehicle,
Index s_rank,
TWRoute& tw_t_route,
Index t_vehicle,
Index t_rank);
virtual bool is_valid() override;
virtual void apply() override;
};
} // namespace vrptw
} // namespace vroom
#endif
|
#ifndef _COORD_H_
#define _COORD_H_
/*
###################################################################################
#
# CDMlib - Cartesian Data Management library
#
# Copyright (c) 2013-2017 Advanced Institute for Computational Science (AICS), RIKEN.
# All rights reserved.
#
# Copyright (c) 2016-2017 Research Institute for Information Technology (RIIT), Kyushu University.
# All rights reserved.
#
###################################################################################
*/
class Coord {
public:
double x,y,z;
public:
/** コンストラクタ */
Coord(){
x=y=z=0.0e0;
};
/** デストラクタ */
~Coord(){};
public:
//2点間の距離
static double Distance(Coord a, Coord b)
{
return sqrt((b.x-a.x)*(b.x-a.x)+(b.y-a.y)*(b.y-a.y)+(b.z-a.z)*(b.z-a.z));
};
//same判定
static bool Same(Coord a, Coord b, double tol)
{
if( Distance(a,b) > tol ) return false;
return true;
};
};
#endif // _COORD_H_
|
// Copyright (c) 2021 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef API_LOADER_ENABLE_IN_TRACEE_H_
#define API_LOADER_ENABLE_IN_TRACEE_H_
#include "GrpcProtos/capture.pb.h"
#include "OrbitBase/Result.h"
namespace orbit_api_loader {
ErrorMessageOr<void> EnableApiInTracee(const orbit_grpc_protos::CaptureOptions& capture_options);
ErrorMessageOr<void> DisableApiInTracee(const orbit_grpc_protos::CaptureOptions& capture_options);
} // namespace orbit_api_loader
#endif
|
/* $NetBSD: process_machdep.c,v 1.19.2.1 2012/05/21 15:25:55 riz Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Charles M. Hannum.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* This file may seem a bit stylized, but that so that it's easier to port.
* Functions to be implemented here are:
*
* process_read_regs(proc, regs)
* Get the current user-visible register set from the process
* and copy it into the regs structure (<machine/reg.h>).
* The process is stopped at the time read_regs is called.
*
* process_write_regs(proc, regs)
* Update the current register set from the passed in regs
* structure. Take care to avoid clobbering special CPU
* registers or privileged bits in the PSL.
* The process is stopped at the time write_regs is called.
*
* process_sstep(proc)
* Arrange for the process to trap after executing a single instruction.
*
* process_set_pc(proc)
* Set the process's program counter.
*/
#include <special_includes/sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.19.2.1 2012/05/21 15:25:55 riz Exp $");
#include <special_includes/sys/param.h>
#include <special_includes/sys/systm.h>
#include <special_includes/sys/time.h>
#include <special_includes/sys/kernel.h>
#include <special_includes/sys/proc.h>
#include <special_includes/sys/vnode.h>
#include <special_includes/sys/ptrace.h>
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/segments.h>
#include <machine/fpu.h>
static inline struct trapframe *process_frame(struct lwp *);
static inline struct fxsave64 *process_fpframe(struct lwp *);
#if 0
static inline int verr_gdt(struct pmap *, int sel);
static inline int verr_ldt(struct pmap *, int sel);
#endif
static inline struct trapframe *
process_frame(struct lwp *l)
{
return (l->l_md.md_regs);
}
static inline struct fxsave64 *
process_fpframe(struct lwp *l)
{
struct pcb *pcb = lwp_getpcb(l);
return &pcb->pcb_savefpu.fp_fxsave;
}
int
process_read_regs(struct lwp *l, struct reg *regs)
{
struct trapframe *tf = process_frame(l);
#define copy_to_reg(reg, REG, idx) regs->regs[_REG_##REG] = tf->tf_##reg;
_FRAME_GREG(copy_to_reg)
#undef copy_to_reg
return (0);
}
int
process_read_fpregs(struct lwp *l, struct fpreg *regs)
{
struct fxsave64 *frame = process_fpframe(l);
if (l->l_md.md_flags & MDP_USEDFPU) {
fpusave_lwp(l, true);
} else {
uint16_t cw;
uint32_t mxcsr, mxcsr_mask;
/*
* Fake a FNINIT.
* The initial control word was already set by setregs(), so
* save it temporarily.
*/
cw = frame->fx_fcw;
mxcsr = frame->fx_mxcsr;
mxcsr_mask = frame->fx_mxcsr_mask;
memset(frame, 0, sizeof(*regs));
frame->fx_fcw = cw;
frame->fx_fsw = 0x0000;
frame->fx_ftw = 0x00; /* abridged tag; all empty */
frame->fx_mxcsr = mxcsr;
frame->fx_mxcsr_mask = mxcsr_mask;
l->l_md.md_flags |= MDP_USEDFPU;
}
memcpy(®s->fxstate, frame, sizeof(*regs));
return (0);
}
int
process_write_regs(struct lwp *l, const struct reg *regp)
{
struct trapframe *tf = process_frame(l);
int error;
const long *regs = regp->regs;
/*
* Check for security violations.
* Note that struct regs is compatible with
* the __gregs array in mcontext_t.
*/
error = cpu_mcontext_validate(l, (const mcontext_t *)regs);
if (error != 0)
return error;
#define copy_to_frame(reg, REG, idx) tf->tf_##reg = regs[_REG_##REG];
_FRAME_GREG(copy_to_frame)
#undef copy_to_frame
return (0);
}
int
process_write_fpregs(struct lwp *l, const struct fpreg *regs)
{
struct fxsave64 *frame = process_fpframe(l);
if (l->l_md.md_flags & MDP_USEDFPU) {
fpusave_lwp(l, false);
} else {
l->l_md.md_flags |= MDP_USEDFPU;
}
memcpy(frame, ®s->fxstate, sizeof(*regs));
return (0);
}
int
process_sstep(struct lwp *l, int sstep)
{
struct trapframe *tf = process_frame(l);
if (sstep)
tf->tf_rflags |= PSL_T;
else
tf->tf_rflags &= ~PSL_T;
return (0);
}
int
process_set_pc(struct lwp *l, void *addr)
{
struct trapframe *tf = process_frame(l);
if ((uint64_t)addr > VM_MAXUSER_ADDRESS)
return EINVAL;
tf->tf_rip = (uint64_t)addr;
return (0);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.