text stringlengths 4 6.14k |
|---|
//
// Constants.h
// Baccarat
//
// Created by Chicago Team on 12/30/14.
// Copyright (c) 2014 AutoBetic. All rights reserved.
//
typedef enum {
Hearts,
Diamonds,
Spades,
Clubs
} CardSuite;
typedef enum {
Zero = 0,
Ace = 1,
Two = 2,
Three = 3,
Four = 4,
Five = 5,
Six = 6,
Seven = 7,
Eight = 8,
Nine = 9,
Ten = 10,
Jack = 11,
Queen = 12,
King = 13
} CardValue;
typedef enum {
Unknown = -1,
Banker = 0,
Player = 1,
Tie = 2
} CoupResult;
typedef enum {
BetLoss = 0,
BetWin = 1,
BetTie = 2
} BetOutcome;
extern NSString *const NOTIFICATION_SESSION_RESULTS;
|
//
// AppDelegate.h
// 06-画板
//
// Created by yhp on 16/5/9.
// Copyright © 2016年 YouHuaPei. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* For more information, please refer to <http://unlicense.org/>
*/
#include "stack.h"
/** Creates a stack and populates the previous
* allocated structure pointed by `s`;
*
* @param s pointer to a stack structure;
* @param member_size size of the elements that will be
* indexed by `s`
*
* @return GERROR_OK in case of success operation;
* GERROR_NULL_ELEMENT in case that `e` is empty.
*/
gerror_t stack_create(struct stack_t* s, size_t member_size)
{
if(!s) return GERROR_NULL_STRUCTURE;
s->member_size = member_size;
s->size = 0;
s->head = NULL;
return GERROR_OK;
}
/** Add the element `e` in the beginning of the stack `s`.
*
* @param s pointer to a stack structure;
* @param e pointer to the element that will be indexed
* by s.
*
* @return GERROR_OK in case of success operation;
* GERROR_NULL_STRUCURE in case `s` is a NULL
*/
gerror_t stack_push(struct stack_t* s, void* e)
{
if(!s) return GERROR_NULL_STRUCTURE;
struct snode_t* new_node = (snode_t*) malloc(sizeof(snode_t));
if( s->member_size )
new_node->data = malloc(s->member_size);
else
new_node->data = NULL;
new_node->prev = NULL;
new_node->next = s->head;
if(s->member_size && e)
memcpy(new_node->data, e, s->member_size);
s->head = new_node;
s->size++;
return GERROR_OK;
}
/** Pops the first element of the stack `s`.
*
* @param s pointer to a stack structure;
* @param e pointer to the previous allocated element
*
* @return GERROR_OK in case of success operation;
* GERROR_NULL_STRUCURE in case `s` is a NULL
* GERROR_NULL_HEAD in case that the head `s->head`
* GERROR_TRY_REMOVE_EMPTY_STRUCTURE in case that `s`
* is empty
*/
gerror_t stack_pop (struct stack_t* s, void* e)
{
if(!s) return GERROR_NULL_STRUCTURE;
if(!s->head) return GERROR_NULL_HEAD;
if(!s->size) return GERROR_TRY_REMOVE_EMPTY_STRUCTURE;
void* ptr = s->head->data;
struct snode_t* old_node = s->head;
s->head = s->head->next;
if( s->head )
s->head->prev = NULL;
s->size--;
free(old_node);
if(s->member_size && e)
memcpy(e, ptr, s->member_size);
if(ptr)
free(ptr);
return GERROR_OK;
}
/** Deallocates the nodes of the structure pointed
* by `s`. This function WILL NOT deallocate the
* pointer `q`.
*
* @param s pointer to a stack structure;
*
* @return GERROR_OK in case of success operation;
* GERROR_NULL_STRUCURE in case `s` is a NULL
*/
gerror_t stack_destroy(struct stack_t* s)
{
if(!s) return GERROR_NULL_STRUCTURE;
struct snode_t* i, *j;
for( i=s->head; i!=NULL; i=j ){
j = i->next;
if(i->data)
free(i->data);
free(i);
}
return GERROR_OK;
}
|
typedef struct Reader
{
void *data;
char *source;
u32 (*curr)(struct Reader *);
u32 (*next)(struct Reader *);
u32 (*moveahead)(struct Reader *, u64);
u32 (*prev)(struct Reader *);
u32 (*moveback)(struct Reader *, u64);
u32 (*move)(struct Reader *, s64);
u32 (*peekahead)(struct Reader *, u64);
u32 (*peekback)(struct Reader *, u64);
u32 (*peek)(struct Reader *, s64);
} Reader;
u32 curr(Reader *reader) {return reader->curr(reader);}
u32 next(Reader *reader) {return reader->next(reader);}
u32 moveahead(Reader *reader, s64 amount) {return reader->moveahead(reader, amount);}
u32 prev(Reader *reader) {return reader->prev(reader);}
u32 moveback(Reader *reader, s64 amount) {return reader->moveback(reader, amount);}
u32 move(Reader *reader, s64 amount) {return reader->move(reader, amount);}
u32 peekahead(Reader *reader, s64 amount) {return reader->peekahead(reader, amount);}
u32 peekback(Reader *reader, s64 amount) {return reader->peekback(reader, amount);}
u32 peek(Reader *reader, s64 amount) {return reader->peek(reader, amount);}
u32 strong_curr(Reader *reader)
{
return reader->moveahead(reader, 0);
}
u32 strong_next(Reader *reader)
{
return reader->moveahead(reader, 1);
}
u32 strong_moveahead__next(Reader *reader, u64 count)
{
--count;
while(count)
{
reader->next(reader);
--count;
}
return reader->next(reader);
}
u32 strong_prev(Reader *reader)
{
return reader->moveback(reader, 1);
}
u32 strong_moveback__prev(Reader *reader, u64 count)
{
--count;
while(count)
{
reader->prev(reader);
--count;
}
return reader->prev(reader);
}
u32 strong_move(Reader *reader, s64 count)
{
if(count < 0)
return reader->moveback(reader, -count);
else
return reader->moveahead(reader, count);
}
u32 strong_moveahead__move(Reader *reader, u64 count)
{
return reader->move(reader, (s64)count);
}
u32 strong_moveback__move(Reader *reader, u64 count)
{
return reader->move(reader, -(s64)count);
}
u32 strong_peekahead__move(Reader *reader, u64 count)
{
u32 result = reader->moveahead(reader, count);
reader->moveback(reader, count);
return result;
}
u32 strong_peekback__move(Reader *reader, u64 count)
{
u32 result = reader->moveback(reader, count);
reader->moveahead(reader, count);
return result;
}
u32 strong_peek(Reader *reader, s64 count)
{
if(count < 0)
return reader->peekback(reader, -count);
else
return reader->peekahead(reader, count);
}
u32 strong_peekahead__peek(Reader *reader, u64 count)
{
return reader->peek(reader, (s64)count);
}
u32 strong_peekback__peek(Reader *reader, u64 count)
{
return reader->peek(reader, -(s64)count);
}
void strengthen_reader(Reader *reader)
{
if(reader->peek)
{
if(!reader->peekahead) reader->peekahead = strong_peekahead__peek;
if(!reader->peekback) reader->peekback = strong_peekback__peek;
}
if(reader->move)
{
if(!reader->moveahead) reader->moveahead = strong_moveahead__move;
if(!reader->moveback) reader->moveback = strong_moveback__move;
}
else
{
if(reader->next && !reader->moveahead) reader->moveahead = strong_moveahead__next;
if(reader->prev && !reader->moveback) reader->moveback = strong_moveback__prev;
if(reader->moveahead && reader->moveback)
{
reader->move = strong_move;
if(!reader->peekahead) reader->peekahead = strong_peekahead__move;
if(!reader->peekback) reader->peekback = strong_peekback__move;
}
}
if(reader->moveahead && !reader->curr) reader->curr = strong_curr;
if(reader->moveahead && !reader->next) reader->next = strong_next;
if(reader->moveback && !reader->prev) reader->prev = strong_prev;
if(reader->peekahead && reader->peekback && !reader->peek) reader->peek = strong_peek;
} |
/*Copyright 2014 George Karagoulis
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 GKCHESS_COLORED_PIECE_ICON_FACTORY_H
#define GKCHESS_COLORED_PIECE_ICON_FACTORY_H
#include "gkchess_ifactory_pieceicon.h"
#include <gutil/macros.h>
#include <QDir>
#include <QMutex>
#include <QFuture>
#include <QWaitCondition>
namespace GKChess{ namespace UI{
/** Implements a piece icon factory that dynamically generates colored icons.
* It expects as input to the constructor a directory of template icons with the following
* requirements: Each should have a color index (GIMP can do this) and when it generates the
* colored icons it replaces white (0xFFFFFFFF) with whatever color you want.
*
* \note This is not a thread-safe implementation (but it does use threads in the implementation)
*/
class ColoredPieceIconFactory :
public IFactory_PieceIcon
{
Q_OBJECT
GUTIL_DISABLE_COPY(ColoredPieceIconFactory);
// Readonly members, unprotected, can be safely shared between threads
QString const dir_templates;
// Main GUI thread members, unprotected
QMap<int, QIcon> index;
QFuture<void> bg_threadRef;
// Shared members between main and background thread, protected by this_lock
QString dir_deploy;
QColor light_color;
QColor dark_color;
int light_progress;
int dark_progress;
bool index_finished_updating;
bool shutting_down;
QMutex this_lock;
QWaitCondition something_to_do;
public:
/** Constructs an icon factory with the given icon template path, and initializes them with
* the given colors.
*/
ColoredPieceIconFactory(const QString &template_dir_path,
const QColor &light_color,
const QColor &dark_color,
QObject * = 0);
virtual ~ColoredPieceIconFactory();
/** Changes the colors of the icons. It may take a second or two before the icons are updated. */
void ChangeColors(const QColor &light_color, const QColor &dark_color);
/** Returns the light piece color. */
QColor GetLightColor() const{ return light_color; }
/** Returns the dark piece color. */
QColor GetDarkColor() const{ return dark_color; }
/** \name IFactory_PieceIcon interface
* \{
*/
virtual QIcon GetIcon(Piece const &);
/** \} */
private slots:
void _update_index();
private:
void _worker_thread();
void _validate_template_icons();
};
}}
#endif // GKCHESS_COLORED_PIECE_ICON_FACTORY_H
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// System.String
struct String_t;
#include "mscorlib_System_Attribute498693649.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ObsoleteAttribute
struct ObsoleteAttribute_t699313272 : public Attribute_t498693649
{
public:
// System.String System.ObsoleteAttribute::_message
String_t* ____message_0;
// System.Boolean System.ObsoleteAttribute::_error
bool ____error_1;
public:
inline static int32_t get_offset_of__message_0() { return static_cast<int32_t>(offsetof(ObsoleteAttribute_t699313272, ____message_0)); }
inline String_t* get__message_0() const { return ____message_0; }
inline String_t** get_address_of__message_0() { return &____message_0; }
inline void set__message_0(String_t* value)
{
____message_0 = value;
Il2CppCodeGenWriteBarrier(&____message_0, value);
}
inline static int32_t get_offset_of__error_1() { return static_cast<int32_t>(offsetof(ObsoleteAttribute_t699313272, ____error_1)); }
inline bool get__error_1() const { return ____error_1; }
inline bool* get_address_of__error_1() { return &____error_1; }
inline void set__error_1(bool value)
{
____error_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
//
// concrteFeed.h
// TestTabelController
//
// Created by 王智刚 on 16/6/12.
// Copyright © 2016年 王智刚. All rights reserved.
//
#import "feed.h"
@interface concrteFeed : feed<feed>
@end
|
//
// SWPTableViewCell.h
// 多图片下载01
//
// Created by sixleaves on 15/7/10.
// Copyright (c) 2015年 sixleaves. All rights reserved.
//
#import <UIKit/UIKit.h>
@class SWPApp;
@interface SWPTableViewCell : UITableViewCell
@property (nonatomic, strong) SWPApp * app;
@end
|
/* CFKnownLocations.c
Copyright (c) 1999-2017, Apple Inc. and the Swift project authors
Portions Copyright (c) 2014-2017, Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
*/
#include "CFKnownLocations.h"
#include <CoreFoundation/CFString.h>
#include "CFPriv.h"
#include "CFInternal.h"
#include <assert.h>
CFURLRef _Nullable _CFKnownLocationCreatePreferencesURLForUser(CFKnownLocationUser user, CFStringRef _Nullable username) {
CFURLRef location = NULL;
#if TARGET_OS_MAC
/*
Building for a Darwin OS. (We use these paths on Swift builds as well, so that we can interoperate a little with Darwin's defaults(1) command and the other system facilities; but you want to use the system version of CF if possible on those platforms, which will talk to cfprefsd(8) and has stronger interprocess consistency guarantees.)
User:
- Any: /Library/Preferences
- Current: $HOME/Library/Preferences
*/
switch (user) {
case _kCFKnownLocationUserAny:
location = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, CFSTR("/Library/Preferences"), kCFURLPOSIXPathStyle, true);
break;
case _kCFKnownLocationUserCurrent:
username = NULL;
// passthrough to:
case _kCFKnownLocationUserByName: {
CFURLRef home = CFCopyHomeDirectoryURLForUser(username);
location = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, CFSTR("/Library/Preferences"), kCFURLPOSIXPathStyle, true, home);
CFRelease(home);
break;
}
}
#elif !DEPLOYMENT_RUNTIME_OBJC && !TARGET_OS_WIN32 && !TARGET_OS_ANDROID
/*
Building for an OS that uses the FHS, BSD's hier(7), and/or the XDG specification for paths:
User:
- Any: /usr/local/etc/
- Current: $XDG_CONFIG_PATH (usually: $HOME/.config/).
*/
switch (user) {
case _kCFKnownLocationUserAny:
location = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, CFSTR("/usr/local/etc"), kCFURLPOSIXPathStyle, true);
break;
case _kCFKnownLocationUserByName:
assert(username == NULL);
// passthrough to:
case _kCFKnownLocationUserCurrent: {
CFStringRef path = _CFXDGCreateConfigHomePath();
location = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, path, kCFURLPOSIXPathStyle, true);
CFRelease(path);
break;
}
}
#elif TARGET_OS_WIN32
switch (user) {
case _kCFKnownLocationUserAny:
location = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, CFSTR("\\Users\\All Users\\AppData\\Local"), kCFURLWindowsPathStyle, true);
break;
case _kCFKnownLocationUserCurrent:
username = CFGetUserName();
// fallthrough
case _kCFKnownLocationUserByName:
const char *user = CFStringGetCStringPtr(username, kCFStringEncodingUTF8);
CFURLRef userdir = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, (const unsigned char *)user, strlen(user), true);
CFURLRef homedir = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, CFSTR("\\Users"), kCFURLWindowsPathStyle, true, userdir);
location = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, CFSTR("\\AppData\\Local"), kCFURLWindowsPathStyle, true, homedir);
CFRelease(homedir);
CFRelease(userdir);
break;
}
#elif TARGET_OS_ANDROID
switch (user) {
case _kCFKnownLocationUserAny:
case _kCFKnownLocationUserByName:
abort();
case _kCFKnownLocationUserCurrent: {
const char *buffer = getenv("CFFIXED_USER_HOME");
if (buffer == NULL || *buffer == '\0') {
CFLog(__kCFLogAssertion, CFSTR("CFFIXED_USER_HOME is unset"));
HALT;
}
CFURLRef userdir = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, (const unsigned char *)buffer, strlen(buffer), true);
location = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, CFSTR("/Apple/Library/Preferences"), kCFURLPOSIXPathStyle, true, userdir);
CFRelease(userdir);
break;
}
}
#else
#error For this platform, you need to define a preferences path for both 'any user' (i.e. installation-wide preferences) or the current user.
#endif
return location;
}
|
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASYNC_STREAMING_READ_WRITE_RPC_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASYNC_STREAMING_READ_WRITE_RPC_H
#include "google/cloud/future.h"
#include "google/cloud/status.h"
#include "google/cloud/version.h"
#include "absl/types/optional.h"
#include <grpcpp/support/async_stream.h>
namespace google {
namespace cloud {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
/**
* A streaming read-write RPC
*
* Streaming read-write RPCs (sometimes called bidirectional streaming RPCs)
* allow applications to send multiple "requests" and receive multiple
* "responses" on the same request. They are often used in services where
* sending one request at a time introduces too much latency. The requests
*/
template <typename Request, typename Response>
class AsyncStreamingReadWriteRpc {
public:
virtual ~AsyncStreamingReadWriteRpc() = default;
/**
* Sends a best-effort request to cancel the RPC.
*
* The application should still wait for the current operation(s) (any pending
* `Start()`, `Read()`, or `Write*()` requests) to complete and use `Finish()`
* to determine the status of the RPC.
*/
virtual void Cancel() = 0;
/**
* Start the streaming RPC.
*
* Applications should call `Start()` and wait for its result before calling
* `Read()` and/or `Write()`. If `Start()` completes with `false` the stream
* has completed with an error. The application should not call `Read()` or
* `Write()` in this case. On errors, the application should call`Finish()` to
* determine the status of the streaming RPC.
*/
virtual future<bool> Start() = 0;
/**
* Read one response from the streaming RPC.
*
* @note Only **one** `Read()` operation may be pending at a time. The
* application is responsible for waiting until any previous `Read()`
* operations have completed before calling `Read()` again.
*
* Whether `Read()` can be called before a `Write()` operation is specified by
* each service and RPC. Most services require at least one `Write()` call
* before calling `Read()`. Many services may return more than one response
* for a single `Write()` request. Each service and RPC specifies how to
* discover if more responses will be forthcoming.
*
* If the `optional<>` is not engaged the streaming RPC has completed. The
* application should wait until any other pending operations (typically any
* other `Write()` calls) complete and then call `Finish()` to find the status
* of the streaming RPC.
*/
virtual future<absl::optional<Response>> Read() = 0;
/**
* Write one request to the streaming RPC.
*
* @note Only **one** `Write()` operation may be pending at a time. The
* application is responsible for waiting until any previous `Write()`
* operations have completed before calling `Write()` again.
*
* Whether `Write()` can be called before waiting for a matching `Read()`
* operation is specified by each service and RPC. Many services tolerate
* multiple `Write()` calls before performing or at least receiving a `Read()`
* response.
*
* If `Write()` completes with `false` the streaming RPC has completed. The
* application should wait until any other pending operations (typically any
* other `Read()` calls) complete and then call `Finish()` to find the status
* of the streaming RPC.
*/
virtual future<bool> Write(Request const&, grpc::WriteOptions) = 0;
/**
* Half-closes the streaming RPC.
*
* Sends an indication to the service that no more requests will be issued by
* the client.
*
* If `WritesDone()` completes with `false` the streaming RPC has completed.
* The application should wait until any other pending operations (typically
* any other `Read()` calls) complete and then call `Finish()` to find the
* status of the streaming RPC.
*/
virtual future<bool> WritesDone() = 0;
/**
* Return the final status of the streaming RPC.
*
* Streaming RPCs may return an error because the stream is closed,
* independently of any whether the application has called `WritesDone()` or
* signaled that the stream is closed using other mechanisms (some RPCs define
* specific attributes to "close" the stream).
*
* The application must wait until all pending `Read()` and `Write()`
* operations have completed before calling `Finish()`.
*/
virtual future<Status> Finish() = 0;
};
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace cloud
} // namespace google
#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASYNC_STREAMING_READ_WRITE_RPC_H
|
#ifndef __ANG_DOM_XML_H__
#error ...
#elif !defined __ANG_DOM_XML_XML_DOCUMENT_H__
#define __ANG_DOM_XML_XML_DOCUMENT_H__
namespace ang
{
namespace dom
{
namespace xml
{
class LINK xml_document final
: public smart<xml_document, ixml_document>
{
public:
static xml_document_t from_file(core::files::input_text_file_t);
private:
class xml_document_iterator
{
protected:
mutable weak_ptr<xml_document> m_doc;
xml_node_t m_current;
xml_node_t m_child;
public:
xml_document_iterator();
xml_document_iterator(xml_document*);
xml_document_iterator(const xml_document_iterator&);
~xml_document_iterator();
private:
xml_node_t xml_current()const;
xml_node_t xml_child()const;
void xml_current(xml_node_t);
void xml_child(xml_node_t);
public: //Properties
void xml_parent(xml_document_t);
xml_document_t xml_parent()const;
xml_iterator_t current()const;
xml_iterator_t child()const;
public: //Methods
bool begin_child();
bool end_child();
bool next();
bool prev();
bool next_child();
bool prev_Child();
bool backward();
bool forward();
friend xml_document;
};
nullable<bool> m_stand_alone;
string m_version;
xml_encoding_t m_encoding;
text::istring_factory_t m_factory;
wsize m_count;
xml_node* m_first;
xml_node* m_root;
xml_node* m_last;
xml_document_iterator m_current;
astring m_last_parsing_error;
public:
xml_document(xml_encoding_t = xml_encoding::utf8);
xml_document(xml_document const*);
protected:
virtual~xml_document();
protected: //overrides
virtual void dispose()override;
public:
ANG_DECLARE_INTERFACE();
bool is_empty()const;
virtual void clear()override;
virtual xml_type_t xml_type()const override;
virtual bool xml_is_type_of(xml_type_t)const override;
virtual streams::itext_output_stream_t& xml_print(streams::itext_output_stream_t& stream, const xml_format_t& flag = xml_format::wrap_text_space + xml_format::fix_entity, ushort level = 0)const override;
virtual wsize counter()const override;
virtual xml::xml_node_t at(xml_base_iterator_t const&) override;
virtual bool increase(xml_base_iterator_t&)const override;
virtual bool increase(xml_base_iterator_t&, int offset)const override;
virtual bool decrease(xml_base_iterator_t&)const override;
virtual bool decrease(xml_base_iterator_t&, int offset)const override;
virtual xml_forward_iterator_t begin() override;
virtual xml_forward_iterator_t end() override;
virtual xml_const_forward_iterator_t begin()const override;
virtual xml_const_forward_iterator_t end()const override;
inline xml_forward_iterator_t last() override;
inline xml_const_forward_iterator_t last()const override;
virtual xml_backward_iterator_t rbegin() override;
virtual xml_backward_iterator_t rend() override;
virtual xml_const_backward_iterator_t rbegin()const override;
virtual xml_const_backward_iterator_t rend()const override;
virtual string xml_version()const override;
virtual xml_encoding_t xml_encoding()const override;
virtual bool xml_stand_alone()const override;
virtual xml_node_t xml_data_type()const override;
virtual xml_node_t xml_root_element()const override;
virtual xml_document_t xml_clone()const override;
virtual xml_iterator_t find(cstr_t, bool invert = false)const override;
virtual xml_iterator_t find(cstr_t, xml_iterator_t next_to, bool invert = false)const override;
virtual xml_iterator_t xml_current()const override;
virtual xml_node_t xml_current_element()const override;
virtual string create_cdata(cstr_t)const;
virtual string create_pcdata(cstr_t)const;
virtual bool move_to(xml_iterator_t current) override;
virtual bool move_to_child(xml_iterator_t child) override;
virtual bool move_up() override;
virtual bool move_down() override;
virtual bool move_forward() override;
virtual bool move_backward() override;
virtual void push_header(cstr_t version = "1.0"_s, nullable<bool> standalone = null) override;
virtual bool begin_element(cstr_t name) override;
virtual bool end_element() override;
virtual bool push_element(cstr_t name, cstr_t value) override;
virtual bool push_element(cstr_t element) override;
virtual bool push_data(cstr_t value) override;
virtual bool push_value(cstr_t value) override;
virtual bool push_attribute(cstr_t name, cstr_t value) override;
virtual bool push_namespace(cstr_t name, cstr_t value) override;
virtual bool push_comment(cstr_t value) override;
virtual void load(core::files::input_text_file_t) override;
virtual void save(core::files::output_text_file_t)const override;
//virtual void parse(cstr_t data)override;
virtual void parse(ibuffer_view_t data)override;
virtual void parse(text::istring_view_t data)override;
using ixml_document::parse;
private:
bool begin_element(string name);
bool push_element(string name, string value);
bool push_element(string element);
bool push_data(string value);
bool push_value(string value);
bool push_attribute(string name, string value);
bool push_comment(string value);
protected:
static bool decode_header(text::istring_view_t data, windex& idx, string& version, xml_encoding_t& encoding, nullable<bool>& standalone);
static bool decode_dtd(xml_document_t doc, text::istring_view_t data, windex& idx);
static bool decode_elements(xml_document_t doc, text::istring_view_t data, windex& idx);
xml_node* xml_first()const;
xml_node* xml_root()const;
xml_node* xml_last()const;
void insert_next_to(xml_node*, xml_node*);
void insert_prev_to(xml_node*, xml_node*);
void insert_first(xml_node*);
void insert_last(xml_node*);
void xml_first(xml_node_t);
void xml_root(xml_node_t);
void xml_last(xml_node_t);
};
}
}
}
#endif//__ANG_DOM_XML_XML_DOCUMENT_H__
|
// Copyright 2017 The CrunchyCrypt 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 CRUNCHY_ALGS_HYBRID_OPENSSL_KEM_H_
#define CRUNCHY_ALGS_HYBRID_OPENSSL_KEM_H_
#include <stddef.h>
#include <memory>
#include <string>
#include <utility>
#include "absl/strings/string_view.h"
#include "crunchy/internal/algs/hybrid/kem.h"
#include "crunchy/internal/algs/kdf/hkdf.h"
#include "crunchy/internal/algs/openssl/openssl_unique_ptr.h"
#include "crunchy/util/status.h"
#include <openssl/base.h>
#include <openssl/ec.h>
namespace crunchy {
typedef StatusOr<std::unique_ptr<Hkdf>>(HkdfFactory)(absl::string_view in_key,
absl::string_view salt);
class OpensslKemFactory : public KemFactory {
public:
OpensslKemFactory(int curve_nid, HkdfFactory* hkdf_factory);
// Creates a public/private keypair
Status NewKeypair(std::unique_ptr<KemPublicKey>* public_key,
std::unique_ptr<KemPrivateKey>* private_key) const override;
// Deserialize functions.
StatusOr<std::unique_ptr<KemPublicKey>> DeserializeKemPublicKey(
absl::string_view serialized) const override;
StatusOr<std::unique_ptr<KemPrivateKey>> DeserializeKemPrivateKey(
absl::string_view serialized) const override;
// The size of serialized keys and tokens.
size_t KemPublicTokenSerializedSize() const override;
size_t KemPublicKeySerializedSize() const override;
size_t KemPrivateKeySerializedSize() const override;
StatusOr<std::string> ComputeDhAndHkdf(const EC_KEY* private_key,
const EC_POINT* public_key,
absl::string_view public_token,
absl::string_view info,
size_t num_bytes) const;
StatusOr<std::string> SerializePoint(const EC_POINT* point) const;
StatusOr<openssl_unique_ptr<EC_POINT>> DeserializePoint(
absl::string_view serialized_point) const;
StatusOr<std::string> SerializePrivateKey(const EC_KEY* key) const;
StatusOr<openssl_unique_ptr<EC_KEY>> DeserializePrivateKey(
absl::string_view serialized) const;
StatusOr<std::unique_ptr<Hkdf>> CreateHkdf(absl::string_view in_key,
absl::string_view salt) const {
return hkdf_factory_(in_key, salt);
}
const EC_GROUP* group() const { return group_; }
int curve_nid() const { return curve_nid_; }
private:
const int curve_nid_;
const EC_GROUP* group_;
const int field_byte_length_;
HkdfFactory* hkdf_factory_;
};
class OpensslKemPublicKey : public KemPublicKey {
public:
OpensslKemPublicKey(const OpensslKemFactory& factory,
openssl_unique_ptr<EC_POINT> point,
const std::string& serialized_point)
: factory_(factory),
point_(std::move(point)),
serialized_point_(serialized_point) {}
Status NewKeyAndToken(size_t num_bytes, absl::string_view info, std::string* key,
std::string* token) const override;
std::string Serialize() const override { return serialized_point_; }
private:
const OpensslKemFactory& factory_;
openssl_unique_ptr<EC_POINT> point_;
const std::string serialized_point_;
};
class OpensslKemPrivateKey : public KemPrivateKey {
public:
OpensslKemPrivateKey(const OpensslKemFactory& factory,
openssl_unique_ptr<EC_KEY> key,
const std::string& serialized_key)
: factory_(factory),
key_(std::move(key)),
serialized_key_(serialized_key) {}
// Can be used to derive the same key bytes given by KemPublicKey::NewToken.
StatusOr<std::string> DeriveKeyFromToken(absl::string_view token, size_t num_bytes,
absl::string_view info) const override;
std::string Serialize() const override { return serialized_key_; }
private:
const OpensslKemFactory& factory_;
openssl_unique_ptr<EC_KEY> key_;
const std::string serialized_key_;
};
const KemFactory& GetP256KemFactory();
const KemFactory& GetP521KemFactory();
} // namespace crunchy
#endif // CRUNCHY_ALGS_HYBRID_OPENSSL_KEM_H_
|
//
// WDCalendarTableViewController.h
// Everything
//
// Created by Louis on 16/7/10.
// Copyright © 2016年 Louis. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface WDCalendarTableViewController : UIViewController
@end
|
//
// UITextField+JGL.h
// PPChat
//
// Created by jiaguanglei on 15/9/14.
// Copyright (c) 2015年 roseonly. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UITextField (JGL)
/**
添加文件输入框左边的View,添加图片
*/
-(void)addLeftViewWithImage:(NSString *)image;
/**
* 判断是否为手机号码
*/
-(BOOL)isTelphoneNum;
@end
|
/* $NetBSD: processor.h,v 1.2.8.1 2014/11/10 19:45:54 martin Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Taylor R. Campbell.
*
* 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.
*/
#ifndef _ASM_PROCESSOR_H_
#define _ASM_PROCESSOR_H_
#include <machine/param.h>
#define cpu_relax() DELAY(1) /* XXX */
#endif /* _ASM_PROCESSOR_H_ */
|
//
// GoodTableViewCell.h
// HappyWeekDayer
//
// Created by scjy on 16/1/8.
// Copyright © 2016年 李志鹏. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GoodModel.h"
@interface GoodTableViewCell : UITableViewCell
@property (nonatomic, strong) GoodModel *goodModel;
@end
|
#ifndef VFI_HTTP_NET_H
#define VFI_HTTP_NET_H
#include <cstring>
#include <errno.h>
#include <stdio.h>
#include <signal.h>
#include <stdint.h>
#include <iostream>
#include <map>
#ifndef _MSC_VER
#include <netinet/in.h>
# ifdef _XOPEN_SOURCE_EXTENDED
# include <arpa/inet.h>
# endif
#include <sys/socket.h>
#endif
#include <vector>
#include <functional>
#include <memory>
#include <list>
#include <vector>
#include <assert.h>
#ifdef _MSC_VER
#include <windows.h>
#else
#include <unistd.h>
#endif
typedef std::function<void(struct evhttp_request *req, const std::string& strCommand, const std::string& strUrl)> HTTPNET_RECEIVE_FUNCTOR;
typedef std::shared_ptr<HTTPNET_RECEIVE_FUNCTOR> HTTPNET_RECEIVE_FUNCTOR_PTR;
class VFIHttpNet
{
public:
virtual bool Execute() = 0;
virtual int InitServer(const unsigned short nPort) = 0;
virtual bool Final() = 0;
public:
virtual bool SendMsg(struct evhttp_request *req, const char* strMsg) = 0;
virtual bool SendFile(struct evhttp_request * req, const int fd, struct stat st, const std::string& strType) = 0;
};
#endif
|
#ifndef QTREE_H
#define QTREE_H
#include <QtGui>
#include <QtCore>
#include <Qt>
#include <QTreeView>
#include <QApplication>
#include <QFileSystemModel>
#include <QList>
#include <QDirModel>
class QTree:public QTreeView
{
Q_OBJECT
public:
QTree(QWidget *parent = 0);
protected:
void mousePressEvent(QMouseEvent *event);
// void mouseMoveEvent(QMouseEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event);
void dragMoveEvent(QDragMoveEvent *event);
private:
QPoint startPos;
};
#endif // QTREE_H
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_XCTest_Gherkin_Example_XCTest_Gherkin_ExampleUITestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_XCTest_Gherkin_Example_XCTest_Gherkin_ExampleUITestsVersionString[];
|
//
// SVProgressHUD.h
//
// Created by Sam Vermette on 27.03.11.
// Copyright 2011 Sam Vermette. All rights reserved.
//
// https://github.com/samvermette/SVProgressHUD
//
#import <UIKit/UIKit.h>
#import <AvailabilityMacros.h>
enum {
SVProgressHUDMaskTypeNone = 1, // allow user interactions while HUD is displayed
SVProgressHUDMaskTypeClear, // don't allow
SVProgressHUDMaskTypeBlack, // don't allow and dim the UI in the back of the HUD
SVProgressHUDMaskTypeGradient // don't allow and dim the UI with a a-la-alert-view bg gradient
};
typedef NSUInteger SVProgressHUDMaskType;
@interface SVProgressHUD : UIView
+ (void)show;
+ (void)showWithStatus:(NSString*)status;
+ (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType;
+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType;
+ (void)showSuccessWithStatus:(NSString*)string;
+ (void)showSuccessWithStatus:(NSString *)string duration:(NSTimeInterval)duration;
+ (void)showErrorWithStatus:(NSString *)string;
+ (void)showErrorWithStatus:(NSString *)string duration:(NSTimeInterval)duration;
+ (void)setStatus:(NSString*)string; // change the HUD loading status while it's showing
+ (void)dismiss; // simply dismiss the HUD with a fade+scale out animation
+ (void)dismissWithSuccess:(NSString*)successString; // also displays the success icon image
+ (void)dismissWithSuccess:(NSString*)successString afterDelay:(NSTimeInterval)seconds;
+ (void)dismissWithError:(NSString*)errorString; // also displays the error icon image
+ (void)dismissWithError:(NSString*)errorString afterDelay:(NSTimeInterval)seconds;
+ (BOOL)isVisible;
@end
// 版权属于原作者
// http://code4app.com (cn) http://code4app.net (en)
// 发布代码于最专业的源码分享网站: Code4App.com |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#pragma once
#include "InternalFunction.h"
#include "ProxyObject.h"
#include "ThrowScope.h"
namespace JSC {
class ArrayAllocationProfile;
class ArrayPrototype;
class JSArray;
class GetterSetter;
class ArrayConstructor : public InternalFunction {
public:
typedef InternalFunction Base;
static const unsigned StructureFlags = HasStaticPropertyTable | InternalFunction::StructureFlags;
static ArrayConstructor* create(VM& vm, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype, GetterSetter* speciesSymbol)
{
ArrayConstructor* constructor = new (NotNull, allocateCell<ArrayConstructor>(vm.heap)) ArrayConstructor(vm, structure);
constructor->finishCreation(vm, globalObject, arrayPrototype, speciesSymbol);
return constructor;
}
DECLARE_INFO;
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
{
return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
}
protected:
void finishCreation(VM&, JSGlobalObject*, ArrayPrototype*, GetterSetter* speciesSymbol);
private:
ArrayConstructor(VM&, Structure*);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
};
JSValue constructArrayWithSizeQuirk(ExecState*, ArrayAllocationProfile*, JSGlobalObject*, JSValue length, JSValue prototype = JSValue());
EncodedJSValue JSC_HOST_CALL arrayConstructorPrivateFuncIsArrayConstructor(ExecState*);
EncodedJSValue JSC_HOST_CALL arrayConstructorPrivateFuncIsArraySlow(ExecState*);
bool isArraySlow(ExecState*, ProxyObject* argument);
// ES6 7.2.2
// https://tc39.github.io/ecma262/#sec-isarray
inline bool isArray(ExecState* exec, JSValue argumentValue)
{
if (!argumentValue.isObject())
return false;
JSObject* argument = jsCast<JSObject*>(argumentValue);
if (argument->type() == ArrayType || argument->type() == DerivedArrayType)
return true;
if (argument->type() != ProxyObjectType)
return false;
return isArraySlow(exec, jsCast<ProxyObject*>(argument));
}
} // namespace JSC
|
#ifndef TEST_TRACE_CALL_STACK_H
#define TEST_TRACE_CALL_STACK_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <string>
#include <vector>
#include <map>
#include <sstream>
namespace Dali
{
std::string ToString(int x);
std::string ToString(unsigned int x);
std::string ToString(float x);
/**
* Helper class to track method calls in the abstraction and search for them in test cases
*/
class TraceCallStack
{
public:
/// Typedef for passing and storing named parameters
typedef std::map< std::string, std::string > NamedParams;
/**
* Constructor
*/
TraceCallStack();
/**
* Destructor
*/
~TraceCallStack();
/**
* Turn on / off tracing
*/
void Enable(bool enable);
bool IsEnabled();
/**
* Push a call onto the stack if the trace is active
* @param[in] method The name of the method
* @param[in] params A comma separated list of parameter values
*/
void PushCall(std::string method, std::string params);
/**
* Push a call onto the stack if the trace is active
* @param[in] method The name of the method
* @param[in] params A comma separated list of parameter values
* @param[in] altParams A map of named parameter values
*/
void PushCall(std::string method, std::string params, const NamedParams& altParams);
/**
* Search for a method in the stack
* @param[in] method The name of the method
* @return true if the method was in the stack
*/
bool FindMethod(std::string method) const;
/**
* Count how many times a method was called
* @param[in] method The name of the method
* @return The number of times it was called
*/
int CountMethod(std::string method) const;
/**
* Search for a method in the stack with the given parameter list
* @param[in] method The name of the method
* @param[in] params A comma separated list of parameter values
* @return true if the method was in the stack
*/
bool FindMethodAndParams(std::string method, std::string params) const;
/**
* Search for a method in the stack with the given parameter list
* @param[in] method The name of the method
* @param[in] params A map of named parameters to test for
* @return true if the method was in the stack
*/
bool FindMethodAndParams(std::string method, const NamedParams& params) const;
/**
* Search for a method in the stack with the given parameter list.
* The search is done from a given index.
* This allows the order of methods and parameters to be checked.
* @param[in] method The name of the method
* @param[in] params A comma separated list of parameter values
* @param[in/out] startIndex The method index to start looking from.
* This is updated if a method is found so subsequent
* calls can search for methods occuring after this one.
* @return True if the method was in the stack
*/
bool FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const;
/**
* Search for a method in the stack with the given parameter list
* @param[in] method The name of the method
* @param[in] params A comma separated list of parameter values
* @return index in the stack where the method was found or -1 otherwise
*/
int FindIndexFromMethodAndParams(std::string method, std::string params) const;
/**
* Search for a method in the stack with the given parameter list
* @param[in] method The name of the method
* @param[in] params A map of named parameter values to match
* @return index in the stack where the method was found or -1 otherwise
*/
int FindIndexFromMethodAndParams(std::string method, const NamedParams& params) const;
/**
* Test if the given method and parameters are at a given index in the stack
* @param[in] index Index in the call stack
* @param[in] method Name of method to test
* @param[in] params A comma separated list of parameter values to test
*/
bool TestMethodAndParams(int index, std::string method, std::string params) const;
/**
* Reset the call stack
*/
void Reset();
/**
* Method to display contents of the TraceCallStack.
* @return A string containing a list of function calls and parameters (may contain newline characters)
*/
std::string GetTraceString()
{
std::stringstream traceStream;
int functionCount = mCallStack.size();
for( int i = 0; i < functionCount; ++i )
{
Dali::TraceCallStack::FunctionCall functionCall = mCallStack[ i ];
traceStream << "StackTrace: Index:" << i << ", Function:" << functionCall.method << ", ParamList:" << functionCall.paramList << std::endl;
}
return traceStream.str();
}
private:
bool mTraceActive; ///< True if the trace is active
struct FunctionCall
{
std::string method;
std::string paramList;
NamedParams namedParams;
FunctionCall( const std::string& aMethod, const std::string& aParamList )
: method( aMethod ), paramList( aParamList )
{
}
FunctionCall( const std::string& aMethod, const std::string& aParamList, const NamedParams& altParams )
: method( aMethod ), paramList( aParamList ), namedParams( altParams )
{
}
};
std::vector< FunctionCall > mCallStack; ///< The call stack
};
} // namespace dali
#endif // TEST_TRACE_CALL_STACK_H
|
//
// CultureTableViewCell.h
// ViewLuoYang
//
// Created by scjy on 16/4/7.
// Copyright © 2016年 秦俊珍. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CultureModel.h"
@interface CultureTableViewCell : UITableViewCell
@property(nonatomic, strong) CultureModel *modelCuture;
@end
|
#include "skbuff.h"
struct sk_buff * alloc_skb(uint32_t datasize)
{
struct sk_buff *skb = malloc(sizeof(struct sk_buff));
skb->dev = NULL;
skb->dst = NULL;
skb->protocol = 0;
skb->len = 0;
skb->data = malloc(datasize);
skb->head = skb->data;
skb->tail = skb->data;
skb->end = skb->data+ datasize;
skb->alloc_mode = SKBUFF_ALLOC_DEFAULT;
}
struct sk_buff * alloc_p_skb(uint8_t *buf,uint32_t len)
{
struct sk_buff *skb = malloc(sizeof(struct sk_buff));
skb->dev = NULL;
skb->dst = NULL;
skb->list = NULL;
skb->prev = NULL;
skb->next = NULL;
skb->protocol = 0;
skb->len = 0;
skb->data = buf;
skb->head = skb->data;
skb->tail = skb->data;
skb->end = skb->data+ len;
skb->alloc_mode = SKBUFF_ALLOC_PARTIAL;
}
void free_skb(struct sk_buff* skb)
{
if(skb->alloc_mode == SKBUFF_ALLOC_DEFAULT)
free(skb->head);
free(skb);
}
static uint8_t* __skb_put(struct sk_buff* skb,uint32_t len)
{
uint8_t *tmp = skb->tail;
skb->tail += len;
skb->len += len;
return tmp;
}
static uint8_t * __skb_push(struct sk_buff * skb,uint32_t len)
{
skb->data -= len;
skb->len += len;
return skb->data;
}
static uint8_t* __skb_pull(struct sk_buff *skb,uint32_t len)
{
skb->len -= len;
return skb->data += len;
}
uint8_t* skb_put(struct sk_buff* skb,uint32_t len)
{
return __skb_put(skb,len);
}
uint8_t * skb_push(struct sk_buff * skb,uint32_t len)
{
return __skb_push(skb,len);
}
uint8_t* skb_pull(struct sk_buff *skb,uint32_t len)
{
return __skb_pull(skb,len);
}
void skb_reserve(struct sk_buff* skb,uint32_t len)
{
skb->data += len;
skb->tail += len;
}
///////////////////////////////////
void skb_queue_init(struct sk_buff_head * list)
{
list->prev = (struct sk_buff *)list;
list->next = (struct sk_buff *)list;
list->len = 0;
pthread_mutex_init(&list->lock,NULL);
}
void skb_queue_push_front(struct sk_buff_head * list,struct sk_buff * skb)
{
pthread_mutex_lock(&list->lock);
skb->list = list;
struct sk_buff * tprev = (struct sk_buff *)list;
struct sk_buff* tnext = list->next;
skb->prev = tprev;
skb->next = tnext;
tprev->next = skb;
tnext->prev = skb;
list->len++;
pthread_mutex_unlock(&list->lock);
}
void skb_queue_push_back(struct sk_buff_head * list,struct sk_buff * skb)
{
pthread_mutex_lock(&list->lock);
skb->list = list;
struct sk_buff * tnext = (struct sk_buff *)list;
struct sk_buff* tprev = list->prev;
skb->prev = tprev;
skb->next = tnext;
tprev->next = skb;
tnext->prev = skb;
list->len++;
pthread_mutex_unlock(&list->lock);
}
struct sk_buff * skb_queue_pop_front(struct sk_buff_head *list)
{
pthread_mutex_lock(&list->lock);
struct sk_buff * tprev = (struct sk_buff*) list;
struct sk_buff * res = list->next;
if(tprev == res)
{
pthread_mutex_unlock(&list->lock);
return NULL;
}
struct sk_buff * tnext = res->next;
tprev->next = tnext;
tnext->prev = tprev;
list->len--;
res->next = NULL;
res->prev = NULL;
res->list = NULL;
pthread_mutex_unlock(&list->lock);
return res;
}
struct sk_buff * skb_queue_pop_back(struct sk_buff_head *list)
{
pthread_mutex_lock(&list->lock);
struct sk_buff * tnext = (struct sk_buff*) list;
struct sk_buff * res = list->prev;
if(tnext == res)
{
pthread_mutex_unlock(&list->lock);
return NULL;
}
struct sk_buff * tprev = res->prev;
tprev->next = tnext;
tnext->prev = tprev;
list->len--;
res->next = NULL;
res->prev = NULL;
res->list = NULL;
pthread_mutex_unlock(&list->lock);
return res;
}
|
// . this is a virtual TCP socket (TcpSocket)
// . they are 1-1 with all socket descriptors
// . it's used to control the non-blocking polling etc. of the sockets
// . we also use it for re-using sockets w/o having to reconnect
#ifndef _TCPSOCKET_H_
#define _TCPSOCKET_H_
#include <sys/time.h> // timeval data type
#include <openssl/ssl.h>
// . this specifies max # of bytes to do in a read() statement
// . we use stack space for the read's buffer so this is how much stack space
// . we usually copy the stack to a permanent malloc'ed buffer
// . we read into this buf first to get the msg size (Content-Length: xxxx)
#define READ_CHUNK_SIZE (10*1024)
// . states of a non-blocking TcpSocket
// . held by TcpSocket's m_sockState member variable
#define ST_AVAILABLE 0 // means it's connected but not being used
#define ST_CONNECTING 2
//#define ST_CLOSED 3
#define ST_READING 4
#define ST_WRITING 5
#define ST_NEEDS_CLOSE 6
#define ST_CLOSE_CALLED 7
#define ST_SSL_ACCEPT 8
#define ST_SSL_SHUTDOWN 9
// hack to repopulate the socket's send buf when its done sending
// it's current sendbuf in order to transmit large amounts of data that
// can't all fit in memory at the same time:
//#define ST_SEND_AGAIN 10
#define TCP_READ_BUF_SIZE 1024
#include "SafeBuf.h"
class TcpSocket {
public:
// some handy little thingies...
bool isAvailable ( ) { return ( m_sockState == ST_AVAILABLE ); };
bool isConnecting ( ) { return ( m_sockState == ST_CONNECTING ); };
//bool isClosed ( ) { return ( m_sockState == ST_CLOSED ); };
bool isReading ( ) { return ( m_sockState == ST_READING ||
m_sockState == ST_SSL_ACCEPT ); };
bool isSending ( ) { return ( m_sockState == ST_WRITING ); };
bool isReadingReply ( ) { return ( isReading() && m_sendBuf); };
bool isSendingReply ( ) { return ( isSending() && m_readBuf); };
bool isSendingRequest( ) { return ( isSending() && ! m_readBuf); };
bool sendCompleted ( ) { return ( m_totalSent == m_totalToSend ); };
bool readCompleted ( ) { return ( m_totalRead == m_totalToRead ); };
void setTimeout (long timeout ) { m_timeout = timeout; };
// . call m_callback when on transcation completion, error or timeout
// . m_sockState is the caller's state data
void (* m_callback )( void *state , TcpSocket *socket );
void *m_state;
class TcpServer *m_this;
int m_sd; // socket descriptor
char *m_hostname; // may be NULL
long long m_startTime; // time the send/read started
long long m_lastActionTime; // of send or receive or connect
// m_ip is 0 on dns lookup error, -1 if not found
long m_ip; // ip of connected host
short m_port; // port of connected host
char m_sockState; // see #defines above
// userid that is logged in
//long m_userId32;
long m_numDestroys;
char m_tunnelMode;
// . getMsgPiece() is called when we need more to send
char *m_sendBuf;
long m_sendBufSize;
long m_sendOffset;
long m_sendBufUsed; // how much of it is relevant data
long m_totalSent; // bytes sent so far
long m_totalToSend;
// NOTE: for now i've skipped allowing reception of LARGE msgs and
// thereby freezing putMsgPiece() for a while
// . putMsgPiece() is called to flush m_readBuf (if > m_maxReadBufSize)
char *m_readBuf; // might be NULL if unalloc'd
long m_readBufSize; // size of alloc'd buffer, m_readBuf
long m_readOffset; // next position to read into m_readBuf
//long m_storeOffset; // how much of it is stored (putMsgPiece)
long m_totalRead; // bytes read so far
long m_totalToRead; // -1 means unknown
//void *m_readCallbackData; // maybe holds reception file handle
//char m_tmpBuf[TCP_READ_BUF_SIZE];
char m_waitingOnHandler;
char m_prefLevel;
// is it in incoming request socket?
char m_isIncoming;
// . is the tcp socket originating from a compression proxy?
// . 0x01 means we need to compress the reply to send back to
// a query compression proxy
char m_flags;
// timeout (ms) relative to m_lastActionTime (last read or write)
long m_timeout;
// . max bytes to read as a function of content type
// . varies from collection to collection so you must specify it
// in call to HttpServer::getDoc()
long m_maxTextDocLen; // if reading text/html or text/plain
long m_maxOtherDocLen; // if reading other doc types
char m_niceness;
char m_streamingMode;
long m_shutdownStart;
// SSL members
SSL *m_ssl;
class UdpSlot *m_udpSlot;
// m_handyBuf is used to hold the parmlist we generate in Pages.cpp
// which we then broadcast to all the nodes in the cluster. so its
// just a substitute for avoid the new of a state class.
SafeBuf m_handyBuf;
// this maps the requested http path to a service in our
// WebPages[] array. like "search" or "admin controls" etc.
long m_pageNum;
// used for debugging, PageResults.cpp sets this to the State0 ptr
char *m_tmp;
};
#endif
|
//
// processor.h
// BetaOS
//
// Created by Adam Kopeć on 6/28/16.
// Copyright © 2016 Adam Kopeć. All rights reserved.
//
#ifndef processor_h
#define processor_h
#include <kernel/queue.h>
typedef struct processor *processor_t;
struct processor {
queue_chain_t processor_queue;/* idle/active queue link,
* MUST remain the first element */
int state; /* See below */
bool is_SMT;
bool is_recommended;
struct thread
*active_thread, /* thread running on processor */
*next_thread, /* next thread when dispatched */
*idle_thread; /* this processor's idle thread. */
//processor_set_t processor_set; /* assigned set */
int current_pri; /* priority of current thread */
//sched_mode_t current_thmode; /* sched mode of current thread */
//sfi_class_id_t current_sfi_class; /* SFI class of current thread */
int cpu_id; /* platform numeric id */
//timer_call_data_t quantum_timer; /* timer for quantum expiration */
uint64_t quantum_end; /* time when current quantum ends */
uint64_t last_dispatch; /* time of last dispatch */
uint64_t deadline; /* current deadline */
bool first_timeslice; /* has the quantum expired since context switch */
#if defined(CONFIG_SCHED_TRADITIONAL) || defined(CONFIG_SCHED_MULTIQ)
struct run_queue runq; /* runq for this processor */
#endif
#if defined(CONFIG_SCHED_TRADITIONAL)
int runq_bound_count; /* # of threads bound to this processor */
#endif
#if defined(CONFIG_SCHED_GRRR)
struct grrr_run_queue grrr_runq; /* Group Ratio Round-Robin runq */
#endif
processor_t processor_primary; /* pointer to primary processor for
* secondary SMT processors, or a pointer
* to ourselves for primaries or non-SMT */
processor_t processor_secondary;
struct ipc_port * processor_self; /* port for operations */
processor_t processor_list; /* all existing processors */
//processor_data_t processor_data; /* per-processor data */
};
#endif /* processor_h */
|
/* Mechforce
*
* @author Kari Vatjus-Anttila <karidaserious@gmail.com>
*
* For conditions of distribution and use, see copyright notice in LICENSE
*
* StateMachine.h 1.00 by Kari Vatjus-Anttila
*
*/
#pragma once
#ifndef STATEMACHINE_H
#define STATEMACHINE_H
void MF_StateMachine(int width, int height); /*State machine where we check what state the user is in and act accordingly*/
#endif /*STATEMACHINE_H*/
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include <os/mynewt.h>
#include <mcu/mcu.h>
#include <tusb.h>
#include <mcu/stm32_hal.h>
static void
OTG_FS_IRQHandler(void)
{
/* TinyUSB provides interrupt handler code */
tud_int_handler(0);
}
void
tinyusb_hardware_init(void)
{
NVIC_SetVector(OTG_FS_IRQn, (uint32_t)OTG_FS_IRQHandler);
NVIC_SetPriority(OTG_FS_IRQn, 2);
/*
* USB Pin Init
* PA11- DM, PA12- DP
*/
hal_gpio_init_af(MCU_GPIO_PORTA(11), GPIO_AF10_OTG_FS, GPIO_NOPULL, GPIO_MODE_AF_PP);
#if MYNEWT_VAL(USB_DP_HAS_EXTERNAL_PULL_UP)
hal_gpio_init_out(MCU_GPIO_PORTA(12), 0);
os_time_delay(1);
#endif
hal_gpio_init_af(MCU_GPIO_PORTA(12), GPIO_AF10_OTG_FS, GPIO_NOPULL, GPIO_MODE_AF_PP);
/*
* Enable USB OTG clock, force device mode
*/
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
USB_OTG_FS->GUSBCFG &= ~USB_OTG_GUSBCFG_FHMOD;
USB_OTG_FS->GUSBCFG |= USB_OTG_GUSBCFG_FDMOD;
#ifdef USB_OTG_GCCFG_NOVBUSSENS
#if !MYNEWT_VAL(USB_VBUS_DETECTION_ENABLE)
/* PA9- VUSB not used for USB */
USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS;
USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN;
USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSASEN;
#else
USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_NOVBUSSENS;
USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN;
USB_OTG_FS->GCCFG |= ~USB_OTG_GCCFG_VBUSASEN;
hal_gpio_init_af(MCU_GPIO_PORTA(9), GPIO_AF10_OTG_FS, GPIO_NOPULL, GPIO_MODE_AF_PP);
#endif
#endif
}
|
/*
* Copyright 2017 AVSystem <avsystem@avsystem.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <config.h>
#include "../servers.h"
#include "../anjay_core.h"
#define ANJAY_SERVERS_INTERNALS
#include "connection_info.h"
VISIBILITY_SOURCE_BEGIN
static void disable_connection(anjay_server_connection_t *connection) {
_anjay_connection_internal_clean_socket(connection);
connection->needs_socket_update = false;
}
static int enter_offline_job(anjay_t *anjay,
void *dummy) {
(void) dummy;
AVS_LIST(anjay_active_server_info_t) server;
AVS_LIST_FOREACH(server, anjay->servers.active) {
disable_connection(&server->udp_connection);
_anjay_sched_del(anjay->sched, &server->sched_update_handle);
}
_anjay_sched_del(anjay->sched, &anjay->reload_servers_sched_job_handle);
anjay->offline = true;
return 0;
}
bool anjay_is_offline(anjay_t *anjay) {
return anjay->offline;
}
int anjay_enter_offline(anjay_t *anjay) {
if (_anjay_sched_now(anjay->sched, NULL, enter_offline_job, NULL)) {
anjay_log(ERROR, "could not schedule enter_offline_job");
return -1;
}
return 0;
}
static int exit_offline_job(anjay_t *anjay, void *dummy) {
(void) dummy;
int result = _anjay_schedule_reload_servers(anjay);
if (result) {
return result;
}
anjay->offline = false;
AVS_LIST(anjay_active_server_info_t) server;
AVS_LIST_FOREACH(server, anjay->servers.active) {
server->udp_connection.needs_socket_update = true;
}
return 0;
}
int anjay_exit_offline(anjay_t *anjay) {
if (_anjay_sched_now(anjay->sched, NULL, exit_offline_job, NULL)) {
anjay_log(ERROR, "could not schedule enter_offline_job");
return -1;
}
return 0;
}
|
/* Web Polygraph http://www.web-polygraph.org/
* Copyright 2003-2011 The Measurement Factory
* Licensed under the Apache License, Version 2.0 */
#ifndef POLYGRAPH__PGL_PROXYSYM_H
#define POLYGRAPH__PGL_PROXYSYM_H
#include "pgl/AgentSym.h"
class RobotSym;
class ServerSym;
class CacheSym;
// server side configuration
class ProxySym: public AgentSym {
public:
static const String TheType;
public:
ProxySym();
ProxySym(const String &aType, PglRec *aRec);
virtual bool isA(const String &type) const;
RobotSym *client() const;
ServerSym *server() const;
AgentSym *side(const String &sideType) const;
CacheSym *cache() const;
protected:
virtual SynSym *dupe(const String &dType) const;
virtual String msgTypesField() const;
};
#endif
|
#include <stdio.h>
#include "esp32/rom/tjpgd.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "unity.h"
#include "test_tjpgd_logo.h"
typedef struct {
const unsigned char *inData;
int inPos;
unsigned char *outData;
int outW;
int outH;
} JpegDev;
static UINT infunc(JDEC *decoder, BYTE *buf, UINT len)
{
JpegDev *jd = (JpegDev *)decoder->device;
printf("Reading %d bytes from pos %d\n", len, jd->inPos);
if (buf != NULL) {
memcpy(buf, jd->inData + jd->inPos, len);
}
jd->inPos += len;
return len;
}
static UINT outfunc(JDEC *decoder, void *bitmap, JRECT *rect)
{
unsigned char *in = (unsigned char *)bitmap;
unsigned char *out;
int y;
printf("Rect %d,%d - %d,%d\n", rect->top, rect->left, rect->bottom, rect->right);
JpegDev *jd = (JpegDev *)decoder->device;
for (y = rect->top; y <= rect->bottom; y++) {
out = jd->outData + ((jd->outW * y) + rect->left) * 3;
memcpy(out, in, ((rect->right - rect->left) + 1) * 3);
in += ((rect->right - rect->left) + 1) * 3;
}
return 1;
}
#define TESTW 48
#define TESTH 48
#define WORKSZ 3100
TEST_CASE("Test JPEG decompression library", "[tjpgd]")
{
char aapix[] = " .:;+=xX$$";
unsigned char *decoded, *p;
char *work;
int r;
int x, y, v;
JDEC decoder;
JpegDev jd;
decoded = malloc(48 * 48 * 3);
for (x = 0; x < 48 * 48 * 3; x += 2) {
decoded[x] = 0; decoded[x + 1] = 0xff;
}
work = malloc(WORKSZ);
memset(work, 0, WORKSZ);
jd.inData = logo_jpg;
jd.inPos = 0;
jd.outData = decoded;
jd.outW = TESTW;
jd.outH = TESTH;
r = jd_prepare(&decoder, infunc, work, WORKSZ, (void *)&jd);
TEST_ASSERT_EQUAL(r, JDR_OK);
r = jd_decomp(&decoder, outfunc, 0);
TEST_ASSERT_EQUAL(r, JDR_OK);
p = decoded + 2;
for (y = 0; y < TESTH; y++) {
for (x = 0; x < TESTH; x++) {
v = ((*p) * (sizeof(aapix) - 2) * 2) / 256;
printf("%c%c", aapix[v / 2], aapix[(v + 1) / 2]);
p += 3;
}
printf("%c%c", ' ', '\n');
}
free(work);
free(decoded);
}
|
//
// CJSystemSettingViewController.h
// 示例-ItcastWeibo
//
// Created by MJ Lee on 14-5-4.
// Copyright (c) 2014年 itcast. All rights reserved.
//
#import "CJSettingViewController.h"
@interface CJSystemSettingViewController : CJSettingViewController
@end
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\nsIFeedGenerator.idl
*/
#ifndef __gen_nsIFeedGenerator_h__
#define __gen_nsIFeedGenerator_h__
#ifndef __gen_nsIFeedElementBase_h__
#include "nsIFeedElementBase.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIURI; /* forward declaration */
/* starting interface: nsIFeedGenerator */
#define NS_IFEEDGENERATOR_IID_STR "0fecd56b-bd92-481b-a486-b8d489cdd385"
#define NS_IFEEDGENERATOR_IID \
{0x0fecd56b, 0xbd92, 0x481b, \
{ 0xa4, 0x86, 0xb8, 0xd4, 0x89, 0xcd, 0xd3, 0x85 }}
class NS_NO_VTABLE nsIFeedGenerator : public nsIFeedElementBase {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFEEDGENERATOR_IID)
/* attribute AString agent; */
NS_IMETHOD GetAgent(nsAString & aAgent) = 0;
NS_IMETHOD SetAgent(const nsAString & aAgent) = 0;
/* attribute AString version; */
NS_IMETHOD GetVersion(nsAString & aVersion) = 0;
NS_IMETHOD SetVersion(const nsAString & aVersion) = 0;
/* attribute nsIURI uri; */
NS_IMETHOD GetUri(nsIURI * *aUri) = 0;
NS_IMETHOD SetUri(nsIURI *aUri) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIFeedGenerator, NS_IFEEDGENERATOR_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIFEEDGENERATOR \
NS_IMETHOD GetAgent(nsAString & aAgent) override; \
NS_IMETHOD SetAgent(const nsAString & aAgent) override; \
NS_IMETHOD GetVersion(nsAString & aVersion) override; \
NS_IMETHOD SetVersion(const nsAString & aVersion) override; \
NS_IMETHOD GetUri(nsIURI * *aUri) override; \
NS_IMETHOD SetUri(nsIURI *aUri) override;
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIFEEDGENERATOR(_to) \
NS_IMETHOD GetAgent(nsAString & aAgent) override { return _to GetAgent(aAgent); } \
NS_IMETHOD SetAgent(const nsAString & aAgent) override { return _to SetAgent(aAgent); } \
NS_IMETHOD GetVersion(nsAString & aVersion) override { return _to GetVersion(aVersion); } \
NS_IMETHOD SetVersion(const nsAString & aVersion) override { return _to SetVersion(aVersion); } \
NS_IMETHOD GetUri(nsIURI * *aUri) override { return _to GetUri(aUri); } \
NS_IMETHOD SetUri(nsIURI *aUri) override { return _to SetUri(aUri); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIFEEDGENERATOR(_to) \
NS_IMETHOD GetAgent(nsAString & aAgent) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAgent(aAgent); } \
NS_IMETHOD SetAgent(const nsAString & aAgent) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAgent(aAgent); } \
NS_IMETHOD GetVersion(nsAString & aVersion) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVersion(aVersion); } \
NS_IMETHOD SetVersion(const nsAString & aVersion) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetVersion(aVersion); } \
NS_IMETHOD GetUri(nsIURI * *aUri) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUri(aUri); } \
NS_IMETHOD SetUri(nsIURI *aUri) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetUri(aUri); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsFeedGenerator : public nsIFeedGenerator
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIFEEDGENERATOR
nsFeedGenerator();
private:
~nsFeedGenerator();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS(nsFeedGenerator, nsIFeedGenerator)
nsFeedGenerator::nsFeedGenerator()
{
/* member initializers and constructor code */
}
nsFeedGenerator::~nsFeedGenerator()
{
/* destructor code */
}
/* attribute AString agent; */
NS_IMETHODIMP nsFeedGenerator::GetAgent(nsAString & aAgent)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFeedGenerator::SetAgent(const nsAString & aAgent)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute AString version; */
NS_IMETHODIMP nsFeedGenerator::GetVersion(nsAString & aVersion)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFeedGenerator::SetVersion(const nsAString & aVersion)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute nsIURI uri; */
NS_IMETHODIMP nsFeedGenerator::GetUri(nsIURI * *aUri)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFeedGenerator::SetUri(nsIURI *aUri)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIFeedGenerator_h__ */
|
/* Copyright 2015 Sindre Ilebekk Johansen and Andreas Sløgedal Løvland
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "Utils.generated.h"
inline float map_value(float value, float istart, float istop, float ostart, float ostop) {
return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
}
UENUM(BlueprintType)
enum class EFlockingState : uint8 {
FS_Default UMETA(DisplayName = "Default"),
FS_Onramp UMETA(DisplayName = "On Ramp"),
FS_OnrampWait UMETA(DisplayName = "On Ramp Waiting"),
FS_NoChange,
};
typedef struct {
int32 StationID;
FVector Location;
FVector ForwardVector;
float speed; // cm/s
// This is the only field not part of the ETSI standard. We only use this in OnRampWaiting.
float GoalSpeed;
float timestamp;
// MaxSpeed is only used when the CamPacket is originating from the current vehile, meaning that even though it is
// not in the ETSI standard, it is not needed.
float MaxSpeed; // cm/s
float Width;
float Length;
uint32 PriorityLevel;
// Not part of the ETSI standard. This is purely an optimization, this is calculated directly from the Location.
float RoadmapTValue;
// Not part of the ETSI standard, but only used when originating from the current vehicle. This is only used in the OnRampWaiting
// behavior to make sure the vehicle does not start before it have lived long enough to have received CAM packages from all neighbors
float CreationTime;
} FCamPacket;
UENUM(BlueprintType)
enum class EVehicleType : uint8 {
VT_Car = 0 UMETA(DisplayName = "Car"),
VT_Sedan = 1 UMETA(DisplayName = "Sedan"),
VT_Bus = 2 UMETA(DisplayName = "Bus"),
VT_Emergency = 3 UMETA(DisplayName = "Emergency"),
};
FVector ShortestVectorBetween(FCamPacket Vehicle1, FCamPacket Vehicle2, const float Time, const UWorld* world);
FVector ShortestVectorBetweenLineAndVehicle(FVector LineA, FVector LineB, FCamPacket Vehicle, const float Time, const UWorld* world);
bool VehiclesOverlap(FCamPacket Vehicle1, FCamPacket Vehicle2, const float Time, const UWorld* world, const float ExtraFront, const float ExtraSide);
FVector ShortestVectorFromFront(FCamPacket Vehicle1, FCamPacket Vehicle2, const float Time, const UWorld* world);
|
//==-- AArch64Subtarget.h - Define Subtarget for the AArch64 ---*- C++ -*--===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the AArch64 specific subclass of TargetSubtargetInfo.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TARGET_AARCH64_SUBTARGET_H
#define LLVM_TARGET_AARCH64_SUBTARGET_H
#include "llvm/ADT/Triple.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#define GET_SUBTARGETINFO_HEADER
#include "AArch64GenSubtargetInfo.inc"
#include <string>
namespace llvm {
class StringRef;
class GlobalValue;
class AArch64Subtarget : public AArch64GenSubtargetInfo {
protected:
bool HasNEON;
bool HasCrypto;
/// TargetTriple - What processor and OS we're targeting.
Triple TargetTriple;
public:
/// This constructor initializes the data members to match that
/// of the specified triple.
///
AArch64Subtarget(StringRef TT, StringRef CPU, StringRef FS);
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
bool GVIsIndirectSymbol(const GlobalValue *GV, Reloc::Model RelocM) const;
bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
bool isTargetLinux() const { return TargetTriple.getOS() == Triple::Linux; }
bool hasNEON() const { return HasNEON; }
bool hasCrypto() const { return HasCrypto; }
};
} // End llvm namespace
#endif // LLVM_TARGET_AARCH64_SUBTARGET_H
|
/*
* Copyright (C) 2004-2015 ZNC, see the NOTICE file for details.
*
* 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 ZNC_NICK_H
#define ZNC_NICK_H
#include <znc/zncconfig.h>
#include <znc/ZNCString.h>
#include <vector>
// Forward Decl
class CIRCNetwork;
class CChan;
// !Forward Decl
class CNick
{
public:
CNick();
CNick(const CString& sNick);
~CNick();
CNick(const CNick&) = default;
CNick& operator=(const CNick&) = default;
void Reset();
void Parse(const CString& sNickMask);
CString GetHostMask() const;
size_t GetCommonChans(std::vector<CChan*>& vChans, CIRCNetwork* pNetwork) const;
bool NickEquals(const CString& nickname) const;
// Setters
void SetNetwork(CIRCNetwork* pNetwork);
void SetNick(const CString& s);
void SetIdent(const CString& s);
void SetHost(const CString& s);
bool AddPerm(unsigned char uPerm);
bool RemPerm(unsigned char uPerm);
// !Setters
// Getters
CString GetPermStr() const;
unsigned char GetPermChar() const;
bool HasPerm(unsigned char uPerm) const;
const CString& GetNick() const;
const CString& GetIdent() const;
const CString& GetHost() const;
CString GetNickMask() const;
// !Getters
void Clone(const CNick& SourceNick);
private:
CString m_sChanPerms;
CIRCNetwork* m_pNetwork;
CString m_sNick;
CString m_sIdent;
CString m_sHost;
};
#endif // !ZNC_NICK_H
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_indexeddb_databaseinfo_h__
#define mozilla_dom_indexeddb_databaseinfo_h__
#include "mozilla/dom/indexedDB/IndexedDatabase.h"
#include "mozilla/dom/indexedDB/Key.h"
#include "mozilla/dom/indexedDB/IDBObjectStore.h"
#include "nsRefPtrHashtable.h"
#include "nsHashKeys.h"
BEGIN_INDEXEDDB_NAMESPACE
class IndexedDBDatabaseChild;
struct ObjectStoreInfo;
typedef nsRefPtrHashtable<nsStringHashKey, ObjectStoreInfo>
ObjectStoreInfoHash;
struct DatabaseInfoGuts
{
DatabaseInfoGuts()
: nextObjectStoreId(1), nextIndexId(1)
{ }
bool operator==(const DatabaseInfoGuts& aOther) const
{
return this->name == aOther.name &&
this->origin == aOther.origin &&
this->version == aOther.version &&
this->nextObjectStoreId == aOther.nextObjectStoreId &&
this->nextIndexId == aOther.nextIndexId;
};
// Make sure to update ipc/SerializationHelpers.h when changing members here!
nsString name;
nsCString origin;
PRUint64 version;
PRInt64 nextObjectStoreId;
PRInt64 nextIndexId;
};
struct DatabaseInfo : public DatabaseInfoGuts
{
DatabaseInfo()
: cloned(false)
{ }
~DatabaseInfo();
static bool Get(nsIAtom* aId,
DatabaseInfo** aInfo);
static bool Put(DatabaseInfo* aInfo);
static void Remove(nsIAtom* aId);
static void RemoveAllForOrigin(const nsACString& aOrigin);
bool GetObjectStoreNames(nsTArray<nsString>& aNames);
bool ContainsStoreName(const nsAString& aName);
ObjectStoreInfo* GetObjectStore(const nsAString& aName);
bool PutObjectStore(ObjectStoreInfo* aInfo);
void RemoveObjectStore(const nsAString& aName);
already_AddRefed<DatabaseInfo> Clone();
nsCOMPtr<nsIAtom> id;
nsString filePath;
bool cloned;
nsAutoPtr<ObjectStoreInfoHash> objectStoreHash;
NS_INLINE_DECL_REFCOUNTING(DatabaseInfo)
};
struct IndexInfo
{
#ifdef NS_BUILD_REFCNT_LOGGING
IndexInfo();
IndexInfo(const IndexInfo& aOther);
~IndexInfo();
#else
IndexInfo()
: id(LL_MININT), unique(false), multiEntry(false) { }
#endif
bool operator==(const IndexInfo& aOther) const
{
return this->name == aOther.name &&
this->id == aOther.id &&
this->keyPath == aOther.keyPath &&
this->keyPathArray == aOther.keyPathArray &&
this->unique == aOther.unique &&
this->multiEntry == aOther.multiEntry;
};
// Make sure to update ipc/SerializationHelpers.h when changing members here!
nsString name;
PRInt64 id;
nsString keyPath;
nsTArray<nsString> keyPathArray;
bool unique;
bool multiEntry;
};
struct ObjectStoreInfoGuts
{
ObjectStoreInfoGuts()
: id(0), autoIncrement(false)
{ }
bool operator==(const ObjectStoreInfoGuts& aOther) const
{
return this->name == aOther.name &&
this->id == aOther.id;
};
// Make sure to update ipc/SerializationHelpers.h when changing members here!
// Constant members, can be gotten on any thread
nsString name;
PRInt64 id;
nsString keyPath;
nsTArray<nsString> keyPathArray;
bool autoIncrement;
// Main-thread only members. This must *not* be touced on the database thread
nsTArray<IndexInfo> indexes;
};
struct ObjectStoreInfo : public ObjectStoreInfoGuts
{
#ifdef NS_BUILD_REFCNT_LOGGING
ObjectStoreInfo();
#else
ObjectStoreInfo()
: nextAutoIncrementId(0), comittedAutoIncrementId(0) { }
#endif
ObjectStoreInfo(ObjectStoreInfo& aOther);
private:
#ifdef NS_BUILD_REFCNT_LOGGING
~ObjectStoreInfo();
#else
~ObjectStoreInfo() {}
#endif
public:
// Database-thread members. After the ObjectStoreInfo has been initialized,
// these can *only* be touced on the database thread.
PRInt64 nextAutoIncrementId;
PRInt64 comittedAutoIncrementId;
// This is threadsafe since the ObjectStoreInfos are created on the database
// thread but then only used from the main thread. Ideal would be if we
// could transfer ownership from the database thread to the main thread, but
// we don't have that ability yet.
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ObjectStoreInfo)
};
struct IndexUpdateInfo
{
#ifdef NS_BUILD_REFCNT_LOGGING
IndexUpdateInfo();
~IndexUpdateInfo();
#endif
bool operator==(const IndexUpdateInfo& aOther) const
{
return this->indexId == aOther.indexId &&
this->indexUnique == aOther.indexUnique &&
this->value == aOther.value;
};
// Make sure to update ipc/SerializationHelpers.h when changing members here!
PRInt64 indexId;
bool indexUnique;
Key value;
};
END_INDEXEDDB_NAMESPACE
#endif // mozilla_dom_indexeddb_databaseinfo_h__
|
/******************************************************************************
*
* file: CmdLineInterface.h
*
* Copyright (c) 2003, Michael E. Smoot .
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
* All rights reverved.
*
* See the file COPYING in the top directory of this distribution for
* more information.
*
* THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*****************************************************************************/
#ifndef TCLAP_COMMANDLINE_INTERFACE_H
#define TCLAP_COMMANDLINE_INTERFACE_H
#include <algorithm>
#include <iostream>
#include <list>
#include <string>
#include <vector>
namespace TCLAP {
class Arg;
class CmdLineOutput;
class XorHandler;
/**
* The base class that manages the command line definition and passes
* along the parsing to the appropriate Arg classes.
*/
class CmdLineInterface
{
public:
/**
* Destructor
*/
virtual ~CmdLineInterface() {}
/**
* Adds an argument to the list of arguments to be parsed.
* \param a - Argument to be added.
*/
virtual void add( Arg& a )=0;
/**
* An alternative add. Functionally identical.
* \param a - Argument to be added.
*/
virtual void add( Arg* a )=0;
/**
* Add two Args that will be xor'd.
* If this method is used, add does
* not need to be called.
* \param a - Argument to be added and xor'd.
* \param b - Argument to be added and xor'd.
*/
virtual void xorAdd( Arg& a, Arg& b )=0;
/**
* Add a list of Args that will be xor'd. If this method is used,
* add does not need to be called.
* \param xors - List of Args to be added and xor'd.
*/
virtual void xorAdd( std::vector<Arg*>& xors )=0;
/**
* Parses the command line.
* \param argc - Number of arguments.
* \param argv - Array of arguments.
*/
virtual void parse(int argc, const char * const * argv)=0;
/**
* Parses the command line.
* \param args - A vector of strings representing the args.
* args[0] is still the program name.
*/
void parse(std::vector<std::string>& args);
/**
* Returns the CmdLineOutput object.
*/
virtual CmdLineOutput* getOutput()=0;
/**
* \param co - CmdLineOutput object that we want to use instead.
*/
virtual void setOutput(CmdLineOutput* co)=0;
/**
* Returns the version string.
*/
virtual std::string& getVersion()=0;
/**
* Returns the program name string.
*/
virtual std::string& getProgramName()=0;
/**
* Returns the argList.
*/
virtual std::list<Arg*>& getArgList()=0;
/**
* Returns the XorHandler.
*/
virtual XorHandler& getXorHandler()=0;
/**
* Returns the delimiter string.
*/
virtual char getDelimiter()=0;
/**
* Returns the message string.
*/
virtual std::string& getMessage()=0;
/**
* Indicates whether or not the help and version switches were created
* automatically.
*/
virtual bool hasHelpAndVersion()=0;
/**
* Resets the instance as if it had just been constructed so that the
* instance can be reused.
*/
virtual void reset()=0;
};
} //namespace
#endif
|
//
// WTXMStatusPhotosInfoModel.h
// WTXMMicroblog
//
// Created by 王涛 on 15/8/24.
// Copyright (c) 2015年 王涛. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface WTXMStatusPhotosInfoModel : NSObject
@property (nonatomic,copy) NSString *thumbnail_pic;
@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/dataexchange/DataExchange_EXPORTS.h>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace DataExchange
{
namespace Model
{
class AWS_DATAEXCHANGE_API StartJobResult
{
public:
StartJobResult();
StartJobResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
StartJobResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
};
} // namespace Model
} // namespace DataExchange
} // namespace Aws
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-2.0-xr-w32-bld/build/dom/interfaces/svg/nsIDOMSVGPresAspectRatio.idl
*/
#ifndef __gen_nsIDOMSVGPresAspectRatio_h__
#define __gen_nsIDOMSVGPresAspectRatio_h__
#ifndef __gen_domstubs_h__
#include "domstubs.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsIDOMSVGPreserveAspectRatio */
#define NS_IDOMSVGPRESERVEASPECTRATIO_IID_STR "7ae42f27-4799-4e7c-86c6-e1dae6ad5157"
#define NS_IDOMSVGPRESERVEASPECTRATIO_IID \
{0x7ae42f27, 0x4799, 0x4e7c, \
{ 0x86, 0xc6, 0xe1, 0xda, 0xe6, 0xad, 0x51, 0x57 }}
class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMSVGPreserveAspectRatio : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMSVGPRESERVEASPECTRATIO_IID)
enum { SVG_PRESERVEASPECTRATIO_UNKNOWN = 0U };
enum { SVG_PRESERVEASPECTRATIO_NONE = 1U };
enum { SVG_PRESERVEASPECTRATIO_XMINYMIN = 2U };
enum { SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3U };
enum { SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4U };
enum { SVG_PRESERVEASPECTRATIO_XMINYMID = 5U };
enum { SVG_PRESERVEASPECTRATIO_XMIDYMID = 6U };
enum { SVG_PRESERVEASPECTRATIO_XMAXYMID = 7U };
enum { SVG_PRESERVEASPECTRATIO_XMINYMAX = 8U };
enum { SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9U };
enum { SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10U };
enum { SVG_MEETORSLICE_UNKNOWN = 0U };
enum { SVG_MEETORSLICE_MEET = 1U };
enum { SVG_MEETORSLICE_SLICE = 2U };
/* attribute unsigned short align; */
NS_SCRIPTABLE NS_IMETHOD GetAlign(PRUint16 *aAlign) = 0;
NS_SCRIPTABLE NS_IMETHOD SetAlign(PRUint16 aAlign) = 0;
/* attribute unsigned short meetOrSlice; */
NS_SCRIPTABLE NS_IMETHOD GetMeetOrSlice(PRUint16 *aMeetOrSlice) = 0;
NS_SCRIPTABLE NS_IMETHOD SetMeetOrSlice(PRUint16 aMeetOrSlice) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMSVGPreserveAspectRatio, NS_IDOMSVGPRESERVEASPECTRATIO_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMSVGPRESERVEASPECTRATIO \
NS_SCRIPTABLE NS_IMETHOD GetAlign(PRUint16 *aAlign); \
NS_SCRIPTABLE NS_IMETHOD SetAlign(PRUint16 aAlign); \
NS_SCRIPTABLE NS_IMETHOD GetMeetOrSlice(PRUint16 *aMeetOrSlice); \
NS_SCRIPTABLE NS_IMETHOD SetMeetOrSlice(PRUint16 aMeetOrSlice);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMSVGPRESERVEASPECTRATIO(_to) \
NS_SCRIPTABLE NS_IMETHOD GetAlign(PRUint16 *aAlign) { return _to GetAlign(aAlign); } \
NS_SCRIPTABLE NS_IMETHOD SetAlign(PRUint16 aAlign) { return _to SetAlign(aAlign); } \
NS_SCRIPTABLE NS_IMETHOD GetMeetOrSlice(PRUint16 *aMeetOrSlice) { return _to GetMeetOrSlice(aMeetOrSlice); } \
NS_SCRIPTABLE NS_IMETHOD SetMeetOrSlice(PRUint16 aMeetOrSlice) { return _to SetMeetOrSlice(aMeetOrSlice); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMSVGPRESERVEASPECTRATIO(_to) \
NS_SCRIPTABLE NS_IMETHOD GetAlign(PRUint16 *aAlign) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAlign(aAlign); } \
NS_SCRIPTABLE NS_IMETHOD SetAlign(PRUint16 aAlign) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAlign(aAlign); } \
NS_SCRIPTABLE NS_IMETHOD GetMeetOrSlice(PRUint16 *aMeetOrSlice) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMeetOrSlice(aMeetOrSlice); } \
NS_SCRIPTABLE NS_IMETHOD SetMeetOrSlice(PRUint16 aMeetOrSlice) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMeetOrSlice(aMeetOrSlice); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsDOMSVGPreserveAspectRatio : public nsIDOMSVGPreserveAspectRatio
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMSVGPRESERVEASPECTRATIO
nsDOMSVGPreserveAspectRatio();
private:
~nsDOMSVGPreserveAspectRatio();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsDOMSVGPreserveAspectRatio, nsIDOMSVGPreserveAspectRatio)
nsDOMSVGPreserveAspectRatio::nsDOMSVGPreserveAspectRatio()
{
/* member initializers and constructor code */
}
nsDOMSVGPreserveAspectRatio::~nsDOMSVGPreserveAspectRatio()
{
/* destructor code */
}
/* attribute unsigned short align; */
NS_IMETHODIMP nsDOMSVGPreserveAspectRatio::GetAlign(PRUint16 *aAlign)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMSVGPreserveAspectRatio::SetAlign(PRUint16 aAlign)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute unsigned short meetOrSlice; */
NS_IMETHODIMP nsDOMSVGPreserveAspectRatio::GetMeetOrSlice(PRUint16 *aMeetOrSlice)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMSVGPreserveAspectRatio::SetMeetOrSlice(PRUint16 aMeetOrSlice)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIDOMSVGPresAspectRatio_h__ */
|
c***************************************************************
c F-K: @(#) constants.h 1.0 4/29/2000
c
c Copyright (c) 2000 by L. Zhu
c See README file for copying and redistribution conditions.
c
c some constants
real pi, pi2
parameter(pi=3.1415926536,pi2=6.2831853072)
real*8 zero,one,two,three,four
parameter(zero=0.d0,one=1.d0,two=2.d0,three=3.d0,four=4.d0)
|
//
// WYOperationView.h
// WYBezierTool
//
// Created by yunyao on 16/9/22.
// Copyright © 2016年 yunyao. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface WYOperationView : NSView
@property (copy) void(^addClik)();
@property (copy) void(^minusClik)();
@end
|
//
// EventWindow.h
// gomacdraw
//
// Created by John Asmuth on 5/11/11.
// Copyright 2011 Rutgers University. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "EventHolder.h"
#import "gmd.h"
@class GoWindow;
@interface EventWindow : NSWindow <NSWindowDelegate> {
@private
NSConditionLock* lock;
NSMutableArray* eventQ;
NSTrackingRectTag currentTrackingRect;
GoWindow* gw;
}
@property (retain) NSMutableArray* eventQ;
@property (retain) NSConditionLock* lock;
@property (assign) GoWindow* gw;
- (void)nq:(GMDEvent)eh;
- (GMDEvent)dq;
@end
|
/*
Copyright 2012 SinnerSchrader Mobile GmbH.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import <Foundation/Foundation.h>
@interface FBObject : NSObject
@property (nonatomic, copy) NSString *uid;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *type;
- (id)initWithDictionary:(NSDictionary *)dic;
@end
|
//
// IPSum.h
// DarwinCore
//
// Created by 孔祥波 on 02/06/2017.
// Copyright © 2017 Kong XiangBo. All rights reserved.
//
#import <Foundation/Foundation.h>
NSData* ipHeader(int len,__uint32_t src,__uint32_t dst,__uint16_t iden, u_char p);
void print_free_memory (void);
|
/* Copyright JS Foundation and other contributors, http://js.foundation
*
* 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 OPCODES_H
#define OPCODES_H
#include "ecma-globals.h"
#include "vm-defines.h"
/** \addtogroup vm Virtual machine
* @{
*
* \addtogroup vm_opcodes Opcodes
* @{
*/
/**
* Number arithmetic operations.
*/
typedef enum
{
NUMBER_ARITHMETIC_SUBSTRACTION, /**< substraction */
NUMBER_ARITHMETIC_MULTIPLICATION, /**< multiplication */
NUMBER_ARITHMETIC_DIVISION, /**< division */
NUMBER_ARITHMETIC_REMAINDER, /**< remainder calculation */
} number_arithmetic_op;
/**
* Number bitwise logic operations.
*/
typedef enum
{
NUMBER_BITWISE_LOGIC_AND, /**< bitwise AND calculation */
NUMBER_BITWISE_LOGIC_OR, /**< bitwise OR calculation */
NUMBER_BITWISE_LOGIC_XOR, /**< bitwise XOR calculation */
NUMBER_BITWISE_SHIFT_LEFT, /**< bitwise LEFT SHIFT calculation */
NUMBER_BITWISE_SHIFT_RIGHT, /**< bitwise RIGHT_SHIFT calculation */
NUMBER_BITWISE_SHIFT_URIGHT, /**< bitwise UNSIGNED RIGHT SHIFT calculation */
NUMBER_BITWISE_NOT, /**< bitwise NOT calculation */
} number_bitwise_logic_op;
ecma_value_t
vm_var_decl (vm_frame_ctx_t *frame_ctx_p, ecma_string_t *var_name_str_p);
ecma_value_t
opfunc_equality (ecma_value_t left_value, ecma_value_t right_value);
ecma_value_t
do_number_arithmetic (number_arithmetic_op op, ecma_value_t left_value, ecma_value_t right_value);
ecma_value_t
opfunc_unary_operation (ecma_value_t left_value, bool is_plus);
ecma_value_t
do_number_bitwise_logic (number_bitwise_logic_op op, ecma_value_t left_value, ecma_value_t right_value);
ecma_value_t
opfunc_addition (ecma_value_t left_value, ecma_value_t right_value);
ecma_value_t
opfunc_relation (ecma_value_t left_value, ecma_value_t right_value, bool left_first, bool is_invert);
ecma_value_t
opfunc_in (ecma_value_t left_value, ecma_value_t right_value);
ecma_value_t
opfunc_instanceof (ecma_value_t left_value, ecma_value_t right_value);
ecma_value_t
opfunc_typeof (ecma_value_t left_value);
void
opfunc_set_accessor (bool is_getter, ecma_value_t object, ecma_string_t *accessor_name_p, ecma_value_t accessor);
ecma_value_t
vm_op_delete_prop (ecma_value_t object, ecma_value_t property, bool is_strict);
ecma_value_t
vm_op_delete_var (ecma_value_t name_literal, ecma_object_t *lex_env_p);
ecma_collection_chunk_t *
opfunc_for_in (ecma_value_t left_value, ecma_value_t *result_obj_p);
/**
* @}
* @}
*/
#endif /* !OPCODES_H */
|
/*
* Copyright (c) 2015 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#undef BIHASH_TYPE
#undef BIHASH_KVP_PER_PAGE
#undef BIHASH_32_64_SVM
#undef BIHASH_ENABLE_STATS
#define BIHASH_TYPE _24_8
#define BIHASH_KVP_PER_PAGE 4
#ifndef __included_bihash_24_8_h__
#define __included_bihash_24_8_h__
#include <vppinfra/crc32.h>
#include <vppinfra/heap.h>
#include <vppinfra/format.h>
#include <vppinfra/pool.h>
#include <vppinfra/xxhash.h>
typedef struct
{
u64 key[3];
u64 value;
} clib_bihash_kv_24_8_t;
static inline int
clib_bihash_is_free_24_8 (const clib_bihash_kv_24_8_t * v)
{
/* Free values are clib_memset to 0xff, check a bit... */
if (v->key[0] == ~0ULL && v->value == ~0ULL)
return 1;
return 0;
}
static inline u64
clib_bihash_hash_24_8 (const clib_bihash_kv_24_8_t * v)
{
#ifdef clib_crc32c_uses_intrinsics
return clib_crc32c ((u8 *) v->key, 24);
#else
u64 tmp = v->key[0] ^ v->key[1] ^ v->key[2];
return clib_xxhash (tmp);
#endif
}
static inline u8 *
format_bihash_kvp_24_8 (u8 * s, va_list * args)
{
clib_bihash_kv_24_8_t *v = va_arg (*args, clib_bihash_kv_24_8_t *);
s = format (s, "key %llu %llu %llu value %llu",
v->key[0], v->key[1], v->key[2], v->value);
return s;
}
static inline int
clib_bihash_key_compare_24_8 (u64 * a, u64 * b)
{
#if defined (CLIB_HAVE_VEC512)
u64x8 v = u64x8_load_unaligned (a) ^ u64x8_load_unaligned (b);
return (u64x8_is_zero_mask (v) & 0x7) == 0;
#elif defined(CLIB_HAVE_VEC128) && defined(CLIB_HAVE_VEC128_UNALIGNED_LOAD_STORE)
u64x2 v = { a[2] ^ b[2], 0 };
v |= u64x2_load_unaligned (a) ^ u64x2_load_unaligned (b);
return u64x2_is_all_zero (v);
#else
return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) == 0;
#endif
}
#undef __included_bihash_template_h__
#include <vppinfra/bihash_template.h>
#endif /* __included_bihash_24_8_h__ */
/*
* fd.io coding-style-patch-verification: ON
*
* Local Variables:
* eval: (c-set-style "gnu")
* End:
*/
|
/*
* Copyright (c) 2021 Project CHIP 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.
*/
#pragma once
#include <messaging/tests/MessagingContext.h>
#include <transport/raw/tests/NetworkTestHelpers.h>
namespace chip {
namespace Test {
/**
* @brief The context of test cases for messaging layer. It wil initialize network layer and system layer, and create
* two secure sessions, connected with each other. Exchanges can be created for each secure session.
*/
class AppContext : public LoopbackMessagingContext<>
{
typedef LoopbackMessagingContext<> Super;
public:
// Disallow initialization as a sync loopback context.
static void Initialize(void *) = delete;
/// Initialize the underlying layers.
CHIP_ERROR Init() override;
// Shutdown all layers, finalize operations
CHIP_ERROR Shutdown() override;
};
} // namespace Test
} // namespace chip
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/lexv2-models/LexModelsV2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace LexModelsV2
{
namespace Model
{
enum class SlotTypeFilterName
{
NOT_SET,
SlotTypeName,
ExternalSourceType
};
namespace SlotTypeFilterNameMapper
{
AWS_LEXMODELSV2_API SlotTypeFilterName GetSlotTypeFilterNameForName(const Aws::String& name);
AWS_LEXMODELSV2_API Aws::String GetNameForSlotTypeFilterName(SlotTypeFilterName value);
} // namespace SlotTypeFilterNameMapper
} // namespace Model
} // namespace LexModelsV2
} // namespace Aws
|
/*
* 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/AWSMigrationHub/MigrationHub_EXPORTS.h>
#include <aws/AWSMigrationHub/MigrationHubRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace MigrationHub
{
namespace Model
{
/**
*/
class AWS_MIGRATIONHUB_API ImportMigrationTaskRequest : public MigrationHubRequest
{
public:
ImportMigrationTaskRequest();
// 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 "ImportMigrationTask"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The name of the ProgressUpdateStream. </p>
*/
inline const Aws::String& GetProgressUpdateStream() const{ return m_progressUpdateStream; }
/**
* <p>The name of the ProgressUpdateStream. </p>
*/
inline void SetProgressUpdateStream(const Aws::String& value) { m_progressUpdateStreamHasBeenSet = true; m_progressUpdateStream = value; }
/**
* <p>The name of the ProgressUpdateStream. </p>
*/
inline void SetProgressUpdateStream(Aws::String&& value) { m_progressUpdateStreamHasBeenSet = true; m_progressUpdateStream = std::move(value); }
/**
* <p>The name of the ProgressUpdateStream. </p>
*/
inline void SetProgressUpdateStream(const char* value) { m_progressUpdateStreamHasBeenSet = true; m_progressUpdateStream.assign(value); }
/**
* <p>The name of the ProgressUpdateStream. </p>
*/
inline ImportMigrationTaskRequest& WithProgressUpdateStream(const Aws::String& value) { SetProgressUpdateStream(value); return *this;}
/**
* <p>The name of the ProgressUpdateStream. </p>
*/
inline ImportMigrationTaskRequest& WithProgressUpdateStream(Aws::String&& value) { SetProgressUpdateStream(std::move(value)); return *this;}
/**
* <p>The name of the ProgressUpdateStream. </p>
*/
inline ImportMigrationTaskRequest& WithProgressUpdateStream(const char* value) { SetProgressUpdateStream(value); return *this;}
/**
* <p>Unique identifier that references the migration task.</p>
*/
inline const Aws::String& GetMigrationTaskName() const{ return m_migrationTaskName; }
/**
* <p>Unique identifier that references the migration task.</p>
*/
inline void SetMigrationTaskName(const Aws::String& value) { m_migrationTaskNameHasBeenSet = true; m_migrationTaskName = value; }
/**
* <p>Unique identifier that references the migration task.</p>
*/
inline void SetMigrationTaskName(Aws::String&& value) { m_migrationTaskNameHasBeenSet = true; m_migrationTaskName = std::move(value); }
/**
* <p>Unique identifier that references the migration task.</p>
*/
inline void SetMigrationTaskName(const char* value) { m_migrationTaskNameHasBeenSet = true; m_migrationTaskName.assign(value); }
/**
* <p>Unique identifier that references the migration task.</p>
*/
inline ImportMigrationTaskRequest& WithMigrationTaskName(const Aws::String& value) { SetMigrationTaskName(value); return *this;}
/**
* <p>Unique identifier that references the migration task.</p>
*/
inline ImportMigrationTaskRequest& WithMigrationTaskName(Aws::String&& value) { SetMigrationTaskName(std::move(value)); return *this;}
/**
* <p>Unique identifier that references the migration task.</p>
*/
inline ImportMigrationTaskRequest& WithMigrationTaskName(const char* value) { SetMigrationTaskName(value); return *this;}
/**
* <p>Optional boolean flag to indicate whether any effect should take place. Used
* to test if the caller has permission to make the call.</p>
*/
inline bool GetDryRun() const{ return m_dryRun; }
/**
* <p>Optional boolean flag to indicate whether any effect should take place. Used
* to test if the caller has permission to make the call.</p>
*/
inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; }
/**
* <p>Optional boolean flag to indicate whether any effect should take place. Used
* to test if the caller has permission to make the call.</p>
*/
inline ImportMigrationTaskRequest& WithDryRun(bool value) { SetDryRun(value); return *this;}
private:
Aws::String m_progressUpdateStream;
bool m_progressUpdateStreamHasBeenSet;
Aws::String m_migrationTaskName;
bool m_migrationTaskNameHasBeenSet;
bool m_dryRun;
bool m_dryRunHasBeenSet;
};
} // namespace Model
} // namespace MigrationHub
} // namespace Aws
|
//
// NSLocale+FWTNotifiable.h
// Notifiable-iOS
// Copyright © 2016 Future Workshops. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSLocale (FWTNotifiable)
NS_ASSUME_NONNULL_BEGIN
+ (NSLocale *)fwt_currentLocale;
- (NSString *)fwt_countryCode;
- (NSString *)fwt_languageCode;
NS_ASSUME_NONNULL_END
@end
|
/*
* Software License Agreement (Apache License)
*
* Copyright (c) 2014, Southwest Research Institute
*
* 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.
*/
/*
* Planning_graph.h
*
* Created on: Jun 5, 2014
* Author: Dan Solomon
* Author: Jonathan Meyer
*/
#ifndef PLANNING_GRAPH_H_
#define PLANNING_GRAPH_H_
#include <boost/function.hpp>
#include "descartes_core/trajectory_pt.h"
#include "descartes_trajectory/cart_trajectory_pt.h"
#include "descartes_trajectory/joint_trajectory_pt.h"
#include "descartes_planner/ladder_graph.h"
namespace descartes_planner
{
typedef boost::function<double(const double*, const double*)> CostFunction;
class PlanningGraph
{
public:
PlanningGraph(descartes_core::RobotModelConstPtr model, CostFunction cost_function_callback = CostFunction{});
/** \brief Clear all previous graph data */
void clear() { graph_.clear(); }
/** @brief initial population of graph trajectory elements
* @param points list of trajectory points to be used to construct the graph
* @return True if the graph was successfully created
*/
bool insertGraph(const std::vector<descartes_core::TrajectoryPtPtr>& points);
/** @brief adds a single trajectory point to the graph
* @param point The new point to add to the graph
* @return True if the point was successfully added
*/
bool addTrajectory(descartes_core::TrajectoryPtPtr point, descartes_core::TrajectoryPt::ID previous_id,
descartes_core::TrajectoryPt::ID next_id);
bool modifyTrajectory(descartes_core::TrajectoryPtPtr point);
bool removeTrajectory(const descartes_core::TrajectoryPt::ID& point);
bool getShortestPath(double &cost, std::list<descartes_trajectory::JointTrajectoryPt> &path);
const descartes_planner::LadderGraph& graph() const noexcept { return graph_; }
descartes_core::RobotModelConstPtr getRobotModel() const { return robot_model_; }
protected:
descartes_planner::LadderGraph graph_;
descartes_core::RobotModelConstPtr robot_model_;
CostFunction custom_cost_function_;
/**
* @brief A pair indicating the validity of the edge, and if valid, the cost associated
* with that edge
*/
bool calculateJointSolutions(const descartes_core::TrajectoryPtPtr* points, const std::size_t count,
std::vector<std::vector<std::vector<double>>>& poses) const;
/** @brief (Re)create the actual graph nodes(vertices) from the list of joint solutions (vertices) */
bool populateGraphVertices(const std::vector<descartes_core::TrajectoryPtPtr> &points,
std::vector<std::vector<descartes_trajectory::JointTrajectoryPt>> &poses);
void computeAndAssignEdges(const std::size_t start_idx, const std::size_t end_idx);
template <typename EdgeBuilder>
std::vector<LadderGraph::EdgeList> calculateEdgeWeights(EdgeBuilder&& builder,
const std::vector<double> &start_joints,
const std::vector<double> &end_joints,
const size_t dof,
bool& has_edges) const;
};
} /* namespace descartes_planner */
#endif /* PLANNING_GRAPH_H_ */
|
#ifndef DALI_PROPERTY_HELPER_H
#define DALI_PROPERTY_HELPER_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// INTERNAL INCLUDES
#include <dali/integration-api/bitmap.h>
#include <dali/devel-api/scripting/enum-helper.h>
namespace Dali
{
namespace Internal
{
/**
* @brief Structure for setting up default properties and their details.
*/
struct PropertyDetails
{
const char* name; ///< The name of the property.
Property::Type type; ///< The property type.
bool writable:1; ///< Whether the property is writable
bool animatable:1; ///< Whether the property is animatable.
bool constraintInput:1; ///< Whether the property can be used as an input to a constraint.
#ifdef DEBUG_ENABLED
Property::Index enumIndex; ///< Used to check the index is correct within a debug build.
#endif
};
/**
* These macros are used to define a table of property details per Actor object.
* The index property is only compiled in for DEBUG_ENABLED builds and allows checking the table index VS the property enum index.
* DALI_PROPERTY_TABLE_END Forces a run-time check that will happen once.
*/
#define DALI_PROPERTY_TABLE_BEGIN const Internal::PropertyDetails DEFAULT_PROPERTY_DETAILS[] = {
#ifdef DEBUG_ENABLED
#define DALI_PROPERTY_TABLE_END( startIndex ) }; const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( Internal::PropertyDetails ); \
struct PROPERTY_CHECK \
{ \
PROPERTY_CHECK() \
{ \
for( int i = 0; i < DEFAULT_PROPERTY_COUNT; i++ ) \
{ \
if ( DEFAULT_PROPERTY_DETAILS[i].enumIndex != ( startIndex + i ) ) \
{ \
DALI_LOG_ERROR( "Checking property failed: index:%d, enumIndex:%d == index+start:%d, (name:%s)\n", i, \
DEFAULT_PROPERTY_DETAILS[i].enumIndex, (startIndex + i), DEFAULT_PROPERTY_DETAILS[i].name ); \
DALI_ASSERT_DEBUG( false && "Property enumeration mismatch" ); \
} \
} \
} \
}; \
static PROPERTY_CHECK PROPERTY_CHECK_INSTANCE;
#else
#define DALI_PROPERTY_TABLE_END( startIndex ) }; const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( Internal::PropertyDetails );
#endif
#ifdef DEBUG_ENABLED
#define DALI_PROPERTY( text, type, writable, animatable, constraint, index ) { text, Dali::Property::type, writable, animatable, constraint, index },
#else
#define DALI_PROPERTY( text, type, writable, animatable, constraint, index ) { text, Dali::Property::type, writable, animatable, constraint },
#endif
/**
* @brief Case insensitive string comparison.
*
* Additionally, '-' and '_' can be used interchangeably as well.
* Returns if both strings have a ',' or a '\0' at the same point.
*
* @param[in] first The first string.
* @param[in] second The string to compare it to.
* @param[out] size The size of the string.
*
* @return true if strings are the same
*/
bool CompareTokens( const char * first, const char * second, size_t& size );
} // namespace Internal
} // namespace Dali
#endif // DALI_PROPERTY_HELPER_H
|
/**
* Helper functions for dealing with sockets
*/
#ifndef __SOCKET_HELPERS_H__
#define __SOCKET_HELPERS_H__
#include <sys/types.h>
#include <sys/socket.h>
int setnonblock(int fd);
char *get_ip_str(struct sockaddr *sa, char *s, ssize_t maxlen);
#endif // __SOCKET_HELPERS_H__
|
#ifndef ___REALTIME_VIDEO_PROCESSOR_HPP______
#define ___REALTIME_VIDEO_PROCESSOR_HPP______
#include "../EstimationAndControl/StateAndMeasurementClasses.h"
#include "Utils/Clock.h"
#include <thread>
#include <mutex>
class RealtimeVideoProcessor
{
protected:
double est_delay_not_including_grabtime;
myclock imgProcessingTimer;
virtual void DoInitialization() = 0;
virtual void CheckForCapturedImage(double *& possible_returned_delaytime, cv::Mat *& possible_returned_img) = 0;
virtual CV_PendCart_Raw_Measurement* ProcessImageToMeasurements(cv::Mat * givenMat) = 0;
void ThreadMainLoopForProcessingIncomingImagesToMeasurements();
std::thread* threaded_image_processing;
std::vector<CV_PendCart_Raw_Measurement*> recent_measurements;
std::mutex recent_measurements_mutex;
public:
RealtimeVideoProcessor() : est_delay_not_including_grabtime(0.0), threaded_image_processing(nullptr) {}
void InitializeNow();
//note: the timestamp on the measurement won't be valid... it will be set to the delay time
// it will need to be filled in using the KalmanFilter's current simulation time by subtracting that delay time
std::vector<CV_PendCart_Raw_Measurement*>* UpdateAndCheckForMeasurements();
};
#endif
|
/* $Xorg: AuFileName.c,v 1.5 2001/02/09 02:03:42 xorgcvs Exp $ */
/*
Copyright 1988, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/lib/Xau/AuFileName.c,v 3.7 2001/12/14 19:54:36 dawes Exp $ */
#include <X11/Xauth.h>
#include <X11/Xos.h>
#include <stdlib.h>
char *
XauFileName ()
{
char *slashDotXauthority = "/Xauthority";
char *name;
static char *buf;
static int bsize;
int size;
if ((name = getenv ("XAUTHORITY"))) return name;
name = getenv ("HOME");
if (!name) { return 0; }
size = strlen (name) + strlen(&slashDotXauthority[1]) + 2;
if (size > bsize) {
if (buf) free (buf);
buf = malloc ((unsigned) size);
if (!buf) return 0;
bsize = size;
}
sprintf(buf,"%s%s",name, slashDotXauthority + (name[1] == '\0' ? 1 : 0));
#if 0
strcpy (buf, name);
strcat (buf, slashDotXauthority + (name[1] == '\0' ? 1 : 0));
#endif
return buf;
}
|
/*
*
* Copyright 2017 Asylo 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 ASYLO_CRYPTO_UTIL_BYTE_CONTAINER_UTIL_H_
#define ASYLO_CRYPTO_UTIL_BYTE_CONTAINER_UTIL_H_
#include <vector>
#include "asylo/crypto/util/byte_container_util_internal.h"
#include "asylo/crypto/util/byte_container_view.h"
#include "asylo/util/status.h"
namespace asylo {
// Serializes |args| and appends the serializations to |serialized|.
//
// ByteContainerT must have a value_type that is 1-byte in size. Each of |args|
// must be implicitly convertible to a ByteContainerView.
template <class ByteContainerT, typename... Args>
Status AppendSerializedByteContainers(ByteContainerT *serialized,
Args... args) {
std::vector<ByteContainerView> views =
internal::CreateByteContainerViewVector(std::forward<Args>(args)...);
return internal::AppendSerializedByteContainers(views, serialized);
}
// Appends the raw bytes of |obj| to |view|.
//
// ByteContainerT must have a value_type that is 1-byte in size.
template <class ByteContainerT, typename ObjT>
void AppendTrivialObject(const ObjT &obj, ByteContainerT *view) {
static_assert(std::is_trivially_copy_assignable<ObjT>::value,
"ObjT is not trivially copy-assignable.");
static_assert(sizeof(typename ByteContainerT::value_type) == 1,
"ConstViewT must have a 1-byte value_type");
ByteContainerView obj_bytes(&obj, sizeof(obj));
std::copy(obj_bytes.cbegin(), obj_bytes.cend(), std::back_inserter(*view));
}
// Serializes |args| into |serialized|, overwriting any existing contents.
//
// ByteContainerT must have a value_type that is 1-byte in size. Each of |args|
// must be implicitly convertible to a ByteContainerView.
template <class ByteContainerT, typename... Args>
Status SerializeByteContainers(ByteContainerT *serialized, Args... args) {
serialized->clear();
std::vector<ByteContainerView> views =
internal::CreateByteContainerViewVector(std::forward<Args>(args)...);
return internal::AppendSerializedByteContainers(views, serialized);
}
// Copies the contents of a ByteContainerView to a newly created object of type
// ByteContainerT and returns the object by value.
//
// ByteContainerT must have a value_type that is 1-byte in size. Additionally,
// ByteContainerT must have a constructor that accepts an iterator range
// comprising first and last iterators.
template <class ByteContainerT>
ByteContainerT CopyToByteContainer(ByteContainerView view) {
static_assert(
sizeof(typename ByteContainerT::value_type) == 1,
"ByteContainerT must be a container that uses 1-byte characters");
return ByteContainerT(view.begin(), view.end());
}
// Creates a ConstViewT from the contents of |view|.
//
// ConstViewT must have a 1-byte value_type, and must have a constructor that
// takes const value_type * and size as its parameters.
template <class ConstViewT>
ConstViewT MakeView(ByteContainerView view) {
static_assert(sizeof(typename ConstViewT::value_type) == 1,
"ConstViewT must have a 1-byte value_type");
return ConstViewT(
reinterpret_cast<const typename ConstViewT::value_type *>(view.data()),
view.size());
}
// Performs a side-channel-resistant comparison of the contents of two
// ByteContainerView objects. Returns true if the contents are equal.
inline bool SafeCompareByteContainers(ByteContainerView lhs,
ByteContainerView rhs) {
return lhs.SafeEquals(rhs);
}
} // namespace asylo
#endif // ASYLO_CRYPTO_UTIL_BYTE_CONTAINER_UTIL_H_
|
#include <stdio.h>
#include "gumball.h"
int main(int argc, char **argv)
{
GUMBALL m1[1] ;
GUMBALL m2[1] ;
/* init gumball machines */
init_gumball( m1, 1 ) ;
init_gumball( m2, 10 ) ;
printf("Simple Gumball Machine - Version 3\n");
insert_quarter( m1 ) ;
turn_crank( m1 ) ;
insert_quarter( m1 ) ;
turn_crank( m1 ) ;
insert_quarter( m1 ) ;
turn_crank( m1 ) ;
insert_quarter( m2 ) ;
turn_crank( m2 ) ;
turn_crank( m2 ) ;
insert_quarter( m2 ) ;
eject_quarter( m2 ) ;
return 0;
}
|
/*
* Copyright 2020 Makani Technologies 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.
*/
// The net_probe module uses specially defined segment VLANs to verify the wing
// network connectivity. We transmit special probe packets which are designed
// to propogate one hop on the network and ensure that switches are connected
// as specified in network.yaml.
// Every segment on the network is assigned a unique ID. This ID is known by
// both switches attached to that segment. TMS570s will send out probe packets
// with each ID periodically (specified in the VLAN tag). The switches are
// configured to route each ID to the TMS570 and one of the switch ports.
// The tagged packet hits the switch and is forwarded to a specific egress port.
// The tagged packet hits an ingress port on the opposite switch. If the
// packet's VLAN ID matches the ingress port, the packet will be forwarded to
// that TMS570. In this manner, the fact of receiving a probe message with
// a specific ID means that that segment is connected to the correct switch
// ports on the correct nodes on both sides.
#include "avionics/firmware/network/net_probe.h"
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "avionics/common/endian.h"
#include "avionics/firmware/cpu/clock.h"
#include "avionics/firmware/identity/identity.h"
#include "avionics/firmware/network/net.h"
#include "avionics/firmware/network/pack_net_probe_message.h"
#include "avionics/network/switch_config.h"
#include "avionics/network/switch_info.h"
#define PROBE_SEND_INTERVAL CLOCK32_MSEC_TO_CYCLES(250)
#define PROBE_EXPIRE CLOCK32_MSEC_TO_CYCLES(10000)
static struct {
int16_t send_port;
uint32_t receive_cycles[NUM_SWITCH_PORTS_MAX];
uint32_t send_timeout;
uint32_t segment_status;
} g_state;
static const SwitchInfo *g_info;
static bool SendNetProbeMessage(int16_t send_port) {
assert(0 <= send_port && send_port < g_info->num_ports);
if (g_info->segment_vlans[send_port] == 0) {
return true;
}
NetProbeMessage probe;
uint8_t buf[PACK_NETPROBEMESSAGE_SIZE];
memset(buf, 0, sizeof(buf));
IpAddress dest_ip = {192, 168, 1, 255};
EthernetAddress dest_mac = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
VlanTag vlan = {.drop_eligible = false, .priority = 0,
.vlan_id = g_info->segment_vlans[send_port]};
probe.segment_id = g_info->segment_vlans[send_port];
probe.source_node = AppConfigGetAioNode();
PackNetProbeMessage(&probe, 1, buf);
return NetSendUdp(dest_ip, dest_mac, UDP_PORT_NET_PROBE, UDP_PORT_NET_PROBE,
buf, sizeof(buf), &vlan);
}
void NetProbeInit(const SwitchInfo *switch_info) {
memset(&g_state, 0, sizeof(g_state));
g_state.segment_status = 0;
g_state.send_timeout = Clock32GetCycles();
g_info = switch_info;
}
void NetProbePoll(void) {
uint32_t now = Clock32GetCycles();
if (CLOCK32_GE(now, g_state.send_timeout)) {
if (SendNetProbeMessage(g_state.send_port)) {
g_state.send_port = (g_state.send_port + 1) % g_info->num_ports;
g_state.send_timeout += PROBE_SEND_INTERVAL;
}
}
for (int32_t i = 0; i < g_info->num_ports; i++) {
if (CLOCK32_GE(now, (g_state.receive_cycles[i] + PROBE_EXPIRE))) {
g_state.segment_status &= ~(1 << i);
}
}
// Show correct segment for TMS570 port.
g_state.segment_status |= 1 << g_info->host_port;
}
bool NetProbeReceive(int32_t msg_len, const uint8_t *msg) {
NetProbeMessage probe;
if (msg_len < (int32_t)sizeof(probe)) return false;
UnpackNetProbeMessage(msg, 1, &probe);
for (int32_t i = 0; i < g_info->num_ports; i++) {
if (probe.segment_id == g_info->segment_vlans[i]) {
g_state.segment_status |= 1 << i;
g_state.receive_cycles[i] = Clock32GetCycles();
return true;
}
}
return false;
}
uint32_t NetProbeGetSegmentStatus(void) {
return g_state.segment_status;
}
|
#define C_KINO_FILTERSCORER
#include "KinoSearch/Util/ToolSet.h"
#include "KSx/Search/FilterScorer.h"
FilterScorer*
FilterScorer_new(BitVector *bits, int32_t doc_max)
{
FilterScorer *self = (FilterScorer*)VTable_Make_Obj(FILTERSCORER);
return FilterScorer_init(self, bits, doc_max);
}
FilterScorer*
FilterScorer_init(FilterScorer *self, BitVector *bits, int32_t doc_max)
{
Matcher_init((Matcher*)self);
// Init.
self->doc_id = 0;
// Assign.
self->bits = (BitVector*)INCREF(bits);
self->doc_max = doc_max;
return self;
}
void
FilterScorer_destroy(FilterScorer *self)
{
DECREF(self->bits);
SUPER_DESTROY(self, FILTERSCORER);
}
int32_t
FilterScorer_next(FilterScorer* self)
{
do {
if (++self->doc_id > self->doc_max) {
self->doc_id--;
return 0;
}
} while ( !BitVec_Get(self->bits, self->doc_id) );
return self->doc_id;
}
int32_t
FilterScorer_skip_to(FilterScorer* self, int32_t target)
{
self->doc_id = target - 1;
return FilterScorer_next(self);
}
float
FilterScorer_score(FilterScorer* self)
{
UNUSED_VAR(self);
return 0.0f;
}
int32_t
FilterScorer_get_doc_id(FilterScorer* self)
{
return self->doc_id;
}
/* Copyright 2005-2011 Marvin Humphrey
*
* This program is free software; you can redistribute it and/or modify
* under the same terms as Perl itself.
*/
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef H_BLE_HS_MBUF_
#define H_BLE_HS_MBUF_
#include <inttypes.h>
struct os_mbuf;
struct os_mbuf *ble_hs_mbuf_att_pkt(void);
struct os_mbuf *ble_hs_mbuf_from_flat(const void *buf, uint16_t len);
int ble_hs_mbuf_to_flat(const struct os_mbuf *om, void *flat, uint16_t max_len,
uint16_t *out_copy_len);
#endif
|
/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
#ifndef ANT_SDM_PAGE_22_H__
#define ANT_SDM_PAGE_22_H__
/** @file
*
* @defgroup ant_sdk_profiles_sdm_page22 Stride Based Speed and Distance Monitor profile page 22
* @{
* @ingroup ant_sdk_profiles_sdm_pages
*/
#include <stdint.h>
#include <stdbool.h>
/**@brief Data structure for SDM data page 22.
*/
typedef struct
{
union
{
struct
{
bool time_is_valid : 1; ///< Transmitted time is valid.
bool distance_is_valid : 1; ///< Transmitted distance is valid.
bool speed_is_valid : 1; ///< Transmitted speed is valid.
bool latency_is_valid : 1; ///< Transmitted latency is valid.
bool cadency_is_valid : 1; ///< Transmitted cadency is valid.
bool calorie_is_valid : 1; ///< Transmitted calorie is valid.
} items;
uint8_t byte;
} capabilities;
} ant_sdm_page22_data_t;
/**@brief Initialize page 2.
*/
#define DEFAULT_ANT_SDM_PAGE22() \
(ant_sdm_page22_data_t) \
{ \
.capabilities.byte = 0, \
}
/**@brief Function for encoding page 22.
*
* @param[in] p_page_data Pointer to the page data.
* @param[out] p_page_buffer Pointer to the data buffer.
*/
void ant_sdm_page_22_encode(uint8_t * p_page_buffer,
ant_sdm_page22_data_t const * p_page_data);
/**@brief Function for decoding page 22.
*
* @param[in] p_page_buffer Pointer to the data buffer.
* @param[out] p_page_data Pointer to the page data.
*/
void ant_sdm_page_22_decode(uint8_t const * p_page_buffer,
ant_sdm_page22_data_t * p_page_data);
#endif // ANT_SDM_PAGE_22_H__
/** @} */
|
#import <Foundation/Foundation.h>
@interface ZMDevice : NSObject<NSCoding>
@property (copy, nonatomic, readonly) NSString *deviceId;
@property (copy, nonatomic) NSString *password;
@property (copy, nonatomic) NSString *name;
@property (strong, nonatomic) NSMutableDictionary *images;
@property (nonatomic) NSInteger channelCount;
- (id)initWithDeviceId:(NSString *)deviceId
password:(NSString *)password
deviceName:(NSString *)deviceName
channelCount:(NSInteger)channelCount;
@end
|
/*
* Licensed to Selene developers ('Selene') under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Selene licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "selene.h"
#include "sln_types.h"
#include "selene_trusted_ca_certificates.h"
#include "sln_certs.h"
#include "sln_arrays.h"
#include <openssl/err.h>
#include <string.h>
/* All Certificate related configuration APIs */
/* Based on Node's SSL_CTX_use_certificate_chain, in src/node_crypto.cc */
selene_error_t *read_certificate_chain(selene_conf_t *conf, BIO *in,
selene_cert_chain_t **p_certs) {
X509 *x = NULL;
selene_cert_chain_t *chain;
selene_cert_t *tmpc;
x = PEM_read_bio_X509_AUX(in, NULL, NULL, NULL);
if (x == NULL) {
return selene_error_create(SELENE_ENOMEM, "Failed to parse certificate");
}
SELENE_ERR(sln_cert_chain_create(conf, &chain));
SELENE_ERR(sln_cert_create(conf, x, 0, &tmpc));
SLN_CERT_CHAIN_INSERT_TAIL(chain, tmpc);
{
/**
* If we could set up our certificate, now proceed to
* the CA certificates.
*/
X509 *ca;
unsigned long err;
while ((ca = PEM_read_bio_X509(in, NULL, NULL, NULL))) {
SELENE_ERR(sln_cert_create(conf, ca, 0, &tmpc));
SLN_CERT_CHAIN_INSERT_TAIL(chain, tmpc);
}
/* When the while loop ends, it's usually just EOF. */
err = ERR_peek_last_error();
if (ERR_GET_LIB(err) == ERR_LIB_PEM &&
ERR_GET_REASON(err) == PEM_R_NO_START_LINE) {
ERR_clear_error();
} else {
/* some real error */
/* TODO: handle parse errors of the ca certs */
ERR_clear_error();
}
}
*p_certs = chain;
return SELENE_SUCCESS;
}
selene_error_t *selene_conf_cert_chain_add(selene_conf_t *conf,
const char *certificate,
const char *pkey) {
selene_cert_chain_t *certs = NULL;
BIO *bio = BIO_new(BIO_s_mem());
int r = BIO_write(bio, certificate, strlen(certificate));
if (r <= 0) {
BIO_free(bio);
return selene_error_createf(
SELENE_ENOMEM,
"Attempting to parse Cert Chain certificate, BIO_write returned: %d",
r);
}
/* TODO: private key */
SELENE_ERR(read_certificate_chain(conf, bio, &certs));
SLN_ARRAY_PUSH(conf->certs, selene_cert_chain_t *) = certs;
return SELENE_SUCCESS;
}
selene_error_t *selene_conf_ca_trusted_cert_add(selene_conf_t *conf,
const char *certificate) {
/* TOOD: replace with native x509 :( ) */
X509 *x509;
BIO *bio = BIO_new(BIO_s_mem());
int r = BIO_write(bio, certificate, strlen(certificate));
if (r <= 0) {
BIO_free(bio);
return selene_error_createf(
SELENE_ENOMEM,
"Attempting to parse CA certificate, BIO_write returned: %d", r);
}
x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
if (!x509) {
BIO_free(bio);
/* TODO: better error messages */
return selene_error_create(
SELENE_ENOMEM,
"Attempting to parse CA certificate, PEM_read_bio_X509 failed.");
}
BIO_free(bio);
X509_STORE_add_cert(conf->trusted_cert_store, x509);
return SELENE_SUCCESS;
}
|
//
// LoLStaticSpellVariables.h
// LoLAPI
//
// Created by Troy Stump on 5/4/14.
//
//
#import "LoLBaseDTO.h"
@interface LoLStaticSpellVariables : LoLBaseDTO
@property (nonatomic, strong) NSArray* coeff; // List[double]
@property (nonatomic, strong) NSString *dyn;
@property (nonatomic, strong) NSString *key;
@property (nonatomic, strong) NSString *link;
@property (nonatomic, strong) NSString *ranksWith;
@end |
/* Om Shanti. Om Sai Ram. November 12, 2014. 11:04 p.m. Madison, WI.
Om Shanti. Om Sai Ram. November 12, 2014. 10:00 p.m. Madison, WI.
Om Shanti. Om Sai Ram. November 12, 2014. 8:08 p.m. Madison, WI.
Nagesh Adluru. */
#include <mex.h>
/* mex -I"/home/adluru/GMMProject/JohnBurkardt/include" -largeArrayDims ComputeInnderProductGaussian.c /home/adluru/GMMProject/JohnBurkardt/libc/Linux/pdflib.o /home/adluru/GMMProject/JohnBurkardt/libc/Linux/rnglib.o */
/* mex Check3DArrayAccess.c */
/* The MATLAB-C gateway routine. */
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
/* Declaring variables. */
double *array, *idxArray, *element;
int i, j, k, d1, d2, d3, idx;
/* Extracting the values from input parameters. */
array = mxGetPr(mxGetField(prhs[0], 0, "array"));
idxArray = mxGetPr(mxGetField(prhs[0], 0, "idxArray"));
/* Creating pointers for output parameters. */
plhs[0] = mxCreateDoubleMatrix(1, 1, mxREAL);
element = mxGetPr(plhs[0]);
d1 = (mxGetDimensions(mxGetField(prhs[0], 0, "array")))[0];
d2 = (mxGetDimensions(mxGetField(prhs[0], 0, "array")))[1];
d3 = (mxGetDimensions(mxGetField(prhs[0], 0, "array")))[2];
i = *(idxArray + 0);
j = *(idxArray + 1);
k = *(idxArray + 2);
mexPrintf("\n d1 = %d, d2 = %d, d3 = %d", d1, d2, d3);
mexPrintf("\n i = %d, j = %d, k = %d", i, j, k);
idx = (k - 1) * (d2 * d1) + (j - 1) * (d1) + (i - 1);
*(element) = *(array + idx);
} |
#pragma once
#include "JKBaseModel.h"
class JKProjectVersionModel : public JKBaseModel
{
//friend class JKProjectVersionBLL;
friend class hiberlite::Database;
friend class hiberlite::access;
template<class Archive>
void hibernate(Archive & ar)
{
ar & HIBERLITE_NVP(version);
ar & HIBERLITE_NVP(dataVersion);
}
public:
int version;
int dataVersion;
};
|
/* Generated SBE (Simple Binary Encoding) message codec */
#ifndef _UK_CO_REAL_LOGIC_SBE_IR_GENERATED_MESSAGEHEADER_H_
#define _UK_CO_REAL_LOGIC_SBE_IR_GENERATED_MESSAGEHEADER_H_
#if defined(SBE_HAVE_CMATH)
/* cmath needed for std::numeric_limits<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <functional>
# include <string>
# include <cstring>
#endif
#include <sbe/sbe.h>
using namespace sbe;
namespace uk_co_real_logic_sbe_ir_generated {
class MessageHeader
{
private:
char *m_buffer;
std::uint64_t m_bufferLength;
std::uint64_t m_offset;
std::uint64_t m_actingVersion;
inline void reset(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength, const std::uint64_t actingVersion)
{
if (SBE_BOUNDS_CHECK_EXPECT(((offset + 8) > bufferLength), false))
{
throw std::runtime_error("buffer too short for flyweight [E107]");
}
m_buffer = buffer;
m_bufferLength = bufferLength;
m_offset = offset;
m_actingVersion = actingVersion;
}
public:
MessageHeader(void) : m_buffer(nullptr), m_offset(0) {}
MessageHeader(char *buffer, const std::uint64_t bufferLength, const std::uint64_t actingVersion)
{
reset(buffer, 0, bufferLength, actingVersion);
}
MessageHeader(const MessageHeader& codec) :
m_buffer(codec.m_buffer), m_offset(codec.m_offset), m_actingVersion(codec.m_actingVersion) {}
#if __cplusplus >= 201103L
MessageHeader(MessageHeader&& codec) :
m_buffer(codec.m_buffer), m_offset(codec.m_offset), m_actingVersion(codec.m_actingVersion) {}
MessageHeader& operator=(MessageHeader&& codec)
{
m_buffer = codec.m_buffer;
m_bufferLength = codec.m_bufferLength;
m_offset = codec.m_offset;
m_actingVersion = codec.m_actingVersion;
return *this;
}
#endif
MessageHeader& operator=(const MessageHeader& codec)
{
m_buffer = codec.m_buffer;
m_bufferLength = codec.m_bufferLength;
m_offset = codec.m_offset;
m_actingVersion = codec.m_actingVersion;
return *this;
}
MessageHeader &wrap(char *buffer, const std::uint64_t offset, const std::uint64_t actingVersion, const std::uint64_t bufferLength)
{
reset(buffer, offset, bufferLength, actingVersion);
return *this;
}
static const std::uint64_t encodedLength(void)
{
return 8;
}
static const std::uint16_t blockLengthNullValue()
{
return SBE_NULLVALUE_UINT16;
}
static const std::uint16_t blockLengthMinValue()
{
return (std::uint16_t)0;
}
static const std::uint16_t blockLengthMaxValue()
{
return (std::uint16_t)65534;
}
std::uint16_t blockLength(void) const
{
return SBE_LITTLE_ENDIAN_ENCODE_16(*((std::uint16_t *)(m_buffer + m_offset + 0)));
}
MessageHeader &blockLength(const std::uint16_t value)
{
*((std::uint16_t *)(m_buffer + m_offset + 0)) = SBE_LITTLE_ENDIAN_ENCODE_16(value);
return *this;
}
static const std::uint16_t templateIdNullValue()
{
return SBE_NULLVALUE_UINT16;
}
static const std::uint16_t templateIdMinValue()
{
return (std::uint16_t)0;
}
static const std::uint16_t templateIdMaxValue()
{
return (std::uint16_t)65534;
}
std::uint16_t templateId(void) const
{
return SBE_LITTLE_ENDIAN_ENCODE_16(*((std::uint16_t *)(m_buffer + m_offset + 2)));
}
MessageHeader &templateId(const std::uint16_t value)
{
*((std::uint16_t *)(m_buffer + m_offset + 2)) = SBE_LITTLE_ENDIAN_ENCODE_16(value);
return *this;
}
static const std::uint16_t schemaIdNullValue()
{
return SBE_NULLVALUE_UINT16;
}
static const std::uint16_t schemaIdMinValue()
{
return (std::uint16_t)0;
}
static const std::uint16_t schemaIdMaxValue()
{
return (std::uint16_t)65534;
}
std::uint16_t schemaId(void) const
{
return SBE_LITTLE_ENDIAN_ENCODE_16(*((std::uint16_t *)(m_buffer + m_offset + 4)));
}
MessageHeader &schemaId(const std::uint16_t value)
{
*((std::uint16_t *)(m_buffer + m_offset + 4)) = SBE_LITTLE_ENDIAN_ENCODE_16(value);
return *this;
}
static const std::uint16_t versionNullValue()
{
return SBE_NULLVALUE_UINT16;
}
static const std::uint16_t versionMinValue()
{
return (std::uint16_t)0;
}
static const std::uint16_t versionMaxValue()
{
return (std::uint16_t)65534;
}
std::uint16_t version(void) const
{
return SBE_LITTLE_ENDIAN_ENCODE_16(*((std::uint16_t *)(m_buffer + m_offset + 6)));
}
MessageHeader &version(const std::uint16_t value)
{
*((std::uint16_t *)(m_buffer + m_offset + 6)) = SBE_LITTLE_ENDIAN_ENCODE_16(value);
return *this;
}
};
}
#endif
|
//
// GuanLiShouHuoDiZhiVC.h
// MiaoSha
//
// Created by liqiang on 16/7/6.
// Copyright © 2016年 LiQiang. All rights reserved.
//
#import "ChildBaseViewController.h"
@interface GuanLiShouHuoDiZhiVC : ChildBaseViewController
@end
|
#pragma once
#include <string>
namespace evm { namespace base64 {
using namespace std;
string encode(const char* buf, size_t len);
/* Returns true when decoded successfully, otherwise returns false.
* If returns true, buf points to decoded data, and len is its length.
* User should be delete [] buf after use. */
bool decode(const string& encoded_data, char*& buf, size_t& len);
// Returns encoded data.
inline string encode(const string& raw_data) {
return encode(raw_data.c_str(), raw_data.size());
}
/* Returns decoded data.
* Throw invalid_argument when error. */
string decode(const string& encoded_data);
}}
|
/*
Copyright 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import <Foundation/Foundation.h>
#import "MXSendReplyEventStringLocalizerProtocol.h"
/**
A `MXSendReplyEventDefaultStringLocalizer` instance represents default localization strings used when send reply event to a message in a room.
*/
@interface MXSendReplyEventDefaultStringLocalizer : NSObject<MXSendReplyEventStringLocalizerProtocol>
@end
|
/*
* Copyright 2019 Sergey Khabarov, sergeykhbr@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <inttypes.h>
#include <string.h>
#include <axi_maps.h>
#include "fw_api.h"
static const uint64_t UNMAPPED_ADDRESS = 0x70000040;
void test_missaccess(void) {
pnp_map *pnp = (pnp_map *)ADDR_BUS0_XSLV_PNP;
// jump to unmappedregion and execute instruction
pnp->fwdbg1 = (uint64_t)&&ret_from_exception; // gcc extension
asm("li t0,0x70000000");
asm("jalr x0,0(t0)");
ret_from_exception:
printf_uart("%s", "instr_load_err .");
if (pnp->fwdbg1 != 0x70000000ull) {
printf_uart("FAIL: %08x != %08x\r\n",
pnp->fwdbg1, 0x70000000ull);
} else {
printf_uart("%s", "PASS\r\n");
}
// clear register. it should be modified from exception handler
pnp->fwdbg1 = 0;
// Read unmapped address to some register (to avoid optimization)
pnp->idt = *((uint64_t *)UNMAPPED_ADDRESS);
if (pnp->fwdbg1 != UNMAPPED_ADDRESS) {
printf_uart("rd_missaccess. .FAIL: %08x != %08x\r\n",
pnp->fwdbg1, UNMAPPED_ADDRESS);
} else {
printf_uart("%s", "rd_missaccess. .PASS\r\n");
}
// Test write miss access
pnp->fwdbg1 = 0;
*((uint64_t *)(UNMAPPED_ADDRESS + 8)) = 0x33445566;
// Pipeline can execute up to 2 instructions before store_fault
// exception will be generated, so insert before reading fwdbg1 some logic.
printf_uart("%s", "wr_missaccess. .");
if (pnp->fwdbg1 != (UNMAPPED_ADDRESS+8)) {
printf_uart("FAIL: %08x != %08x\r\n",
pnp->fwdbg1, (UNMAPPED_ADDRESS+8));
} else {
printf_uart("%s", "PASS\r\n");
}
}
|
/*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LYRA_CODEC_VECTOR_QUANTIZER_INTERFACE_H_
#define LYRA_CODEC_VECTOR_QUANTIZER_INTERFACE_H_
#include <string>
#include <vector>
#include "absl/types/optional.h" // IWYU pragma: keep
namespace chromemedia {
namespace codec {
// An interface to abstract the quantization implementation.
class VectorQuantizerInterface {
public:
virtual ~VectorQuantizerInterface() {}
// Converts the features into a bitset representing the indices of code
// vectors closest to the klt transform of features.
virtual absl::optional<std::string> Quantize(
const std::vector<float>& features) const = 0;
// Converts quantized bits back into lossy features in the log mel
// spectrogram domain.
virtual std::vector<float> DecodeToLossyFeatures(
const std::string& quantized_features) const = 0;
};
} // namespace codec
} // namespace chromemedia
#endif // LYRA_CODEC_VECTOR_QUANTIZER_INTERFACE_H_
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// System.Collections.Generic.Dictionary`2<System.Object,System.Boolean>
struct Dictionary_2_t3198324071;
#include "mscorlib_System_Object837106420.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Collections.Generic.Dictionary`2/ValueCollection<System.Object,System.Boolean>
struct ValueCollection_t825493869 : public Il2CppObject
{
public:
// System.Collections.Generic.Dictionary`2<TKey,TValue> System.Collections.Generic.Dictionary`2/ValueCollection::dictionary
Dictionary_2_t3198324071 * ___dictionary_0;
public:
inline static int32_t get_offset_of_dictionary_0() { return static_cast<int32_t>(offsetof(ValueCollection_t825493869, ___dictionary_0)); }
inline Dictionary_2_t3198324071 * get_dictionary_0() const { return ___dictionary_0; }
inline Dictionary_2_t3198324071 ** get_address_of_dictionary_0() { return &___dictionary_0; }
inline void set_dictionary_0(Dictionary_2_t3198324071 * value)
{
___dictionary_0 = value;
Il2CppCodeGenWriteBarrier(&___dictionary_0, value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2016 ArangoDB GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Dr. Frank Celler
////////////////////////////////////////////////////////////////////////////////
#ifndef ARANGODB_APPLICATION_FEATURES_SHUTDOWN_FEATURE_H
#define ARANGODB_APPLICATION_FEATURES_SHUTDOWN_FEATURE_H 1
#include "ApplicationFeatures/ApplicationFeature.h"
namespace arangodb {
class ShutdownFeature final : public application_features::ApplicationFeature {
public:
ShutdownFeature(application_features::ApplicationServer& server,
std::vector<std::type_index> const& features);
void start() override final;
};
} // namespace arangodb
#endif |
//
// ChooseLampSpeciesVC.h
// Intelligentlamp
//
// Created by L on 16/8/25.
// Copyright © 2016年 L. All rights reserved.
//选择灯泡种类页面
#import "RootViewController.h"
@class ZLSwipeableView;
@interface ChooseLampSpeciesVC : RootViewController
@property (nonatomic, strong) ZLSwipeableView *swipeableView;
- (UIView *)nextViewForSwipeableView:(ZLSwipeableView *)swipeableView;
@end
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstmap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lmarti <lmarti@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2013/11/28 14:58:36 by lmarti #+# #+# */
/* Updated: 2014/01/12 12:43:44 by lmarti ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include "libft.h"
static void ft_list_push_back(t_list **begin_lst)
{
t_list *tmp;
t_list *lstcpy;
if (!begin_lst || !*begin_lst)
return ;
tmp = *begin_lst;
while (tmp)
{
lstcpy = ft_lstnew(tmp->content, tmp->content_size);
if (!lstcpy)
return ;
tmp = tmp->next;
lstcpy->next = tmp;
}
}
static t_list *lstcpy(t_list *begin)
{
t_list *lstcpy;
t_list tmp;
tmp = *begin;
lstcpy = &tmp;
ft_list_push_back(&lstcpy);
return (begin);
}
t_list *ft_lstmap(t_list *lst, t_list *(*f)(t_list *elem))
{
t_list *newlst;
t_list *elem;
newlst = lstcpy(lst);
elem = newlst;
while (elem)
{
elem = f(elem);
elem = elem->next;
}
return (newlst);
}
|
/*
* 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/swf/SWF_EXPORTS.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 SWF
{
namespace Model
{
/**
* <p>Provides the details of the <code>LambdaFunctionCompleted</code> event. It
* isn't set for other event types.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/swf-2012-01-25/LambdaFunctionCompletedEventAttributes">AWS
* API Reference</a></p>
*/
class AWS_SWF_API LambdaFunctionCompletedEventAttributes
{
public:
LambdaFunctionCompletedEventAttributes();
LambdaFunctionCompletedEventAttributes(Aws::Utils::Json::JsonView jsonValue);
LambdaFunctionCompletedEventAttributes& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The ID of the <code>LambdaFunctionScheduled</code> event that was recorded
* when this Lambda task was scheduled. To help diagnose issues, use this
* information to trace back the chain of events leading up to this event.</p>
*/
inline long long GetScheduledEventId() const{ return m_scheduledEventId; }
/**
* <p>The ID of the <code>LambdaFunctionScheduled</code> event that was recorded
* when this Lambda task was scheduled. To help diagnose issues, use this
* information to trace back the chain of events leading up to this event.</p>
*/
inline bool ScheduledEventIdHasBeenSet() const { return m_scheduledEventIdHasBeenSet; }
/**
* <p>The ID of the <code>LambdaFunctionScheduled</code> event that was recorded
* when this Lambda task was scheduled. To help diagnose issues, use this
* information to trace back the chain of events leading up to this event.</p>
*/
inline void SetScheduledEventId(long long value) { m_scheduledEventIdHasBeenSet = true; m_scheduledEventId = value; }
/**
* <p>The ID of the <code>LambdaFunctionScheduled</code> event that was recorded
* when this Lambda task was scheduled. To help diagnose issues, use this
* information to trace back the chain of events leading up to this event.</p>
*/
inline LambdaFunctionCompletedEventAttributes& WithScheduledEventId(long long value) { SetScheduledEventId(value); return *this;}
/**
* <p>The ID of the <code>LambdaFunctionStarted</code> event recorded when this
* activity task started. To help diagnose issues, use this information to trace
* back the chain of events leading up to this event.</p>
*/
inline long long GetStartedEventId() const{ return m_startedEventId; }
/**
* <p>The ID of the <code>LambdaFunctionStarted</code> event recorded when this
* activity task started. To help diagnose issues, use this information to trace
* back the chain of events leading up to this event.</p>
*/
inline bool StartedEventIdHasBeenSet() const { return m_startedEventIdHasBeenSet; }
/**
* <p>The ID of the <code>LambdaFunctionStarted</code> event recorded when this
* activity task started. To help diagnose issues, use this information to trace
* back the chain of events leading up to this event.</p>
*/
inline void SetStartedEventId(long long value) { m_startedEventIdHasBeenSet = true; m_startedEventId = value; }
/**
* <p>The ID of the <code>LambdaFunctionStarted</code> event recorded when this
* activity task started. To help diagnose issues, use this information to trace
* back the chain of events leading up to this event.</p>
*/
inline LambdaFunctionCompletedEventAttributes& WithStartedEventId(long long value) { SetStartedEventId(value); return *this;}
/**
* <p>The results of the Lambda task.</p>
*/
inline const Aws::String& GetResult() const{ return m_result; }
/**
* <p>The results of the Lambda task.</p>
*/
inline bool ResultHasBeenSet() const { return m_resultHasBeenSet; }
/**
* <p>The results of the Lambda task.</p>
*/
inline void SetResult(const Aws::String& value) { m_resultHasBeenSet = true; m_result = value; }
/**
* <p>The results of the Lambda task.</p>
*/
inline void SetResult(Aws::String&& value) { m_resultHasBeenSet = true; m_result = std::move(value); }
/**
* <p>The results of the Lambda task.</p>
*/
inline void SetResult(const char* value) { m_resultHasBeenSet = true; m_result.assign(value); }
/**
* <p>The results of the Lambda task.</p>
*/
inline LambdaFunctionCompletedEventAttributes& WithResult(const Aws::String& value) { SetResult(value); return *this;}
/**
* <p>The results of the Lambda task.</p>
*/
inline LambdaFunctionCompletedEventAttributes& WithResult(Aws::String&& value) { SetResult(std::move(value)); return *this;}
/**
* <p>The results of the Lambda task.</p>
*/
inline LambdaFunctionCompletedEventAttributes& WithResult(const char* value) { SetResult(value); return *this;}
private:
long long m_scheduledEventId;
bool m_scheduledEventIdHasBeenSet;
long long m_startedEventId;
bool m_startedEventIdHasBeenSet;
Aws::String m_result;
bool m_resultHasBeenSet;
};
} // namespace Model
} // namespace SWF
} // namespace Aws
|
/*
* 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/connect/Connect_EXPORTS.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 Connect
{
namespace Model
{
/**
* <p>A <code>HierarchyGroupSummary</code> object that contains information about
* the hierarchy group, including ARN, Id, and Name.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/HierarchyGroupSummary">AWS
* API Reference</a></p>
*/
class AWS_CONNECT_API HierarchyGroupSummary
{
public:
HierarchyGroupSummary();
HierarchyGroupSummary(Aws::Utils::Json::JsonView jsonValue);
HierarchyGroupSummary& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The identifier of the hierarchy group.</p>
*/
inline const Aws::String& GetId() const{ return m_id; }
/**
* <p>The identifier of the hierarchy group.</p>
*/
inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; }
/**
* <p>The identifier of the hierarchy group.</p>
*/
inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); }
/**
* <p>The identifier of the hierarchy group.</p>
*/
inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); }
/**
* <p>The identifier of the hierarchy group.</p>
*/
inline HierarchyGroupSummary& WithId(const Aws::String& value) { SetId(value); return *this;}
/**
* <p>The identifier of the hierarchy group.</p>
*/
inline HierarchyGroupSummary& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;}
/**
* <p>The identifier of the hierarchy group.</p>
*/
inline HierarchyGroupSummary& WithId(const char* value) { SetId(value); return *this;}
/**
* <p>The ARN for the hierarchy group.</p>
*/
inline const Aws::String& GetArn() const{ return m_arn; }
/**
* <p>The ARN for the hierarchy group.</p>
*/
inline void SetArn(const Aws::String& value) { m_arnHasBeenSet = true; m_arn = value; }
/**
* <p>The ARN for the hierarchy group.</p>
*/
inline void SetArn(Aws::String&& value) { m_arnHasBeenSet = true; m_arn = std::move(value); }
/**
* <p>The ARN for the hierarchy group.</p>
*/
inline void SetArn(const char* value) { m_arnHasBeenSet = true; m_arn.assign(value); }
/**
* <p>The ARN for the hierarchy group.</p>
*/
inline HierarchyGroupSummary& WithArn(const Aws::String& value) { SetArn(value); return *this;}
/**
* <p>The ARN for the hierarchy group.</p>
*/
inline HierarchyGroupSummary& WithArn(Aws::String&& value) { SetArn(std::move(value)); return *this;}
/**
* <p>The ARN for the hierarchy group.</p>
*/
inline HierarchyGroupSummary& WithArn(const char* value) { SetArn(value); return *this;}
/**
* <p>The name of the hierarchy group.</p>
*/
inline const Aws::String& GetName() const{ return m_name; }
/**
* <p>The name of the hierarchy group.</p>
*/
inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }
/**
* <p>The name of the hierarchy group.</p>
*/
inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }
/**
* <p>The name of the hierarchy group.</p>
*/
inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }
/**
* <p>The name of the hierarchy group.</p>
*/
inline HierarchyGroupSummary& WithName(const Aws::String& value) { SetName(value); return *this;}
/**
* <p>The name of the hierarchy group.</p>
*/
inline HierarchyGroupSummary& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}
/**
* <p>The name of the hierarchy group.</p>
*/
inline HierarchyGroupSummary& WithName(const char* value) { SetName(value); return *this;}
private:
Aws::String m_id;
bool m_idHasBeenSet;
Aws::String m_arn;
bool m_arnHasBeenSet;
Aws::String m_name;
bool m_nameHasBeenSet;
};
} // namespace Model
} // namespace Connect
} // namespace Aws
|
/** http_rest_proxy_impl.h -*- C++ -*-
Jeremy Barnes, 20 February 2015
Copyright (c) 2015 mldb.ai inc. All rights reserved.
Details of the HttpRestProxy connection class. Split out for internal
users that want to use HttpRestProxy's connection pool but not its
request handling logic.
*/
#pragma once
#include "http_rest_proxy.h"
#include "curl_wrapper.h"
namespace MLDB {
struct HttpRestProxy::ConnectionHandler: public CurlWrapper::Easy {
};
struct HttpRestProxy::Connection {
Connection(ConnectionHandler * conn,
HttpRestProxy * proxy)
: conn(conn), proxy(proxy)
{
}
~Connection() noexcept
{
if (!conn)
return;
if (proxy)
proxy->doneConnection(conn);
else delete conn;
}
Connection(Connection && other) noexcept
: conn(other.conn), proxy(other.proxy)
{
other.conn = nullptr;
}
Connection & operator = (Connection && other) noexcept
{
this->conn = other.conn;
this->proxy = other.proxy;
other.conn = 0;
return *this;
}
ConnectionHandler & operator * ()
{
ExcAssert(conn);
return *conn;
}
ConnectionHandler * operator -> ()
{
ExcAssert(conn);
return conn;
}
private:
friend class HttpRestProxy;
ConnectionHandler * conn;
HttpRestProxy * proxy;
};
} // namespace MLDB
|
//
// EponymUpdater.h
// eponyms-touch
//
// Created by Pascal Pfiffner on 08.07.08.
// This sourcecode is released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0.html
//
// Updater object that downloads the eponym XML and fills the SQLite database
// for eponyms-touch
//
#import <UIKit/UIKit.h>
#import <sqlite3.h>
#import "EponymUpdaterDelegate.h"
@class InfoViewController;
@interface EponymUpdater : NSObject <NSXMLParserDelegate> {
sqlite3 *database;
sqlite3 *memory_database;
NSUInteger updateAction; // 1 = check, 2 = download and install
}
@property (nonatomic, unsafe_unretained) id<EponymUpdaterDelegate> delegate;
@property (nonatomic, unsafe_unretained) InfoViewController<EponymUpdaterDelegate> *viewController;
@property (nonatomic, assign) NSUInteger updateAction;
@property (nonatomic, assign) BOOL newEponymsAvailable;
@property (nonatomic, strong) NSString *statusMessage;
// Downloading
@property (nonatomic, assign) BOOL isDownloading;
@property (nonatomic, assign) BOOL downloadFailed;
@property (nonatomic, strong) NSURL *eponymUpdateCheckURL;
@property (nonatomic, strong) NSURL *eponymXMLURL;
@property (nonatomic, assign) NSInteger statusCode;
@property (nonatomic, assign) long long expectedContentLength;
@property (nonatomic, strong) NSURLConnection *myConnection;
@property (nonatomic, strong) NSMutableData *receivedData;
// Parsing
@property (nonatomic, assign) BOOL isParsing;
@property (nonatomic, assign) BOOL mustAbortImport;
@property (nonatomic, assign) BOOL parseFailed;
@property (nonatomic, assign) NSInteger eponymCheck_eponymUpdateTime;
@property (nonatomic, assign) NSInteger eponymCheckFileSize;
@property (nonatomic, assign) NSUInteger readyToLoadNumEponyms;
@property (nonatomic, strong) NSDate *eponymCreationDate;
@property (nonatomic, strong) NSMutableDictionary *currentlyParsedNode;
@property (nonatomic, strong) NSMutableString *contentOfCurrentXMLNode;
@property (nonatomic, strong) NSMutableArray *categoriesOfCurrentEponym;
@property (nonatomic, strong) NSMutableDictionary *categoriesAlreadyInserted;
@property (nonatomic, assign) NSUInteger numEponymsParsed;
- (id) initWithDelegate:(id) myDelegate;
- (void) startUpdaterAction;
- (void) createEponymsWithData:(NSData *)XMLData;
@end
|
/*
* ex0806.c
* create a zombie process and call ps to verify it
*/
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include "../com/comhdr.h"
int main( int argc, char **argv ) {
pid_t pid;
if ( (pid = fork()) < 0 ) {
err_sys( "error on fork()" );
} else if ( pid == 0 ) {
printf( "child: I am gone\n" );
_exit( 0 );
}
sleep( 5 ); /* hope this is long enough */
system( "ps f" );
return 0;
}
|
@protocol MWMSearchTabbedViewProtocol <NSObject>
@required
- (void)searchText:(NSString *)text forInputLocale:(NSString *)locale;
- (void)dismissKeyboard;
@end
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2011 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
// A good bit of this code was derived from the Three20 project
// and was customized to work inside FarmersMarket
//
// All modifications by FarmersMarket are licensed under
// the Apache License, Version 2.0
//
//
// Copyright 2009 Facebook
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifdef USE_TI_UIDASHBOARDVIEW
#import <Foundation/Foundation.h>
@class LauncherItem;
@interface LauncherButton : UIButton {
BOOL dragging;
BOOL editing;
LauncherItem *item;
UIButton *button;
UIButton *closeButton;
UIButton *badge;
}
@property(nonatomic,readwrite,retain) LauncherItem *item;
@property(nonatomic,readonly) UIButton *closeButton;
@property(nonatomic) BOOL dragging;
@property(nonatomic) BOOL editing;
@end
#endif |
///
/// State.h
///
#ifndef STATE_H
#define STATE_H
#include "Object.h"
#define DF_UNDEFINED_STATE "__undefined state__"
class State {
private:
string state_type; /// Name of state.
public:
State();
virtual ~State();
/// Set name of state.
void setType(string new_type);
/// Get name of state.
string getType() const;
/// Invoked when state first entered.
virtual void Enter(Object *p_obj);
/// Invoked every game loop step.
virtual void Execute(Object *p_obj)=0;
/// Invoked when state exited.
virtual void Exit(Object *p_obj);
};
#endif
|
/*=========================================================================
*
* 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 itkDicomImageIOFactory_h
#define itkDicomImageIOFactory_h
#if !defined( ITK_LEGACY_REMOVE )
#include "itkObjectFactoryBase.h"
#include "itkImageIOBase.h"
namespace itk
{
/** \class DicomImageIOFactory
* \brief Create instances of DicomImageIO objects using an object factory.
* \deprecated
* \ingroup ITKDeprecated
*/
class DicomImageIOFactory:public ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef DicomImageIOFactory Self;
typedef ObjectFactoryBase Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Class methods used to interface with the registered factories. */
virtual const char * GetITKSourceVersion(void) const ITK_OVERRIDE;
virtual const char * GetDescription(void) const ITK_OVERRIDE;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(DicomImageIOFactory, ObjectFactoryBase);
/** Register one factory of this type */
static void RegisterOneFactory(void)
{
DicomImageIOFactory::Pointer DicomFactory = DicomImageIOFactory::New();
ObjectFactoryBase::RegisterFactory(DicomFactory);
}
protected:
DicomImageIOFactory();
~DicomImageIOFactory();
private:
ITK_DISALLOW_COPY_AND_ASSIGN(DicomImageIOFactory);
};
} // end namespace itk
#endif //#if !defined( ITK_LEGACY_REMOVE )
#endif
|
/**
* Copyright 2015-2018 MICRORISC s.r.o.
* Copyright 2018 IQRF Tech s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "DpaMessage.h"
#include <chrono>
#include <memory>
#include <sstream>
#include <string>
class IDpaTransactionResult2
{
public:
enum ErrorCode {
// transaction handling
TRN_ERROR_IFACE_EXCLUSIVE_ACCESS = -8,
TRN_ERROR_BAD_RESPONSE = -7,
TRN_ERROR_BAD_REQUEST = -6,
TRN_ERROR_IFACE_BUSY = -5,
TRN_ERROR_IFACE = -4,
TRN_ERROR_ABORTED = -3,
TRN_ERROR_IFACE_QUEUE_FULL = -2,
TRN_ERROR_TIMEOUT = -1,
TRN_OK = STATUS_NO_ERROR,
// DPA response erors
TRN_ERROR_FAIL = ERROR_FAIL,
TRN_ERROR_PCMD = ERROR_PCMD,
TRN_ERROR_PNUM = ERROR_PNUM,
TRN_ERROR_ADDR = ERROR_ADDR,
TRN_ERROR_DATA_LEN = ERROR_DATA_LEN,
TRN_ERROR_DATA = ERROR_DATA,
TRN_ERROR_HWPID = ERROR_HWPID,
TRN_ERROR_NADR = ERROR_NADR,
TRN_ERROR_IFACE_CUSTOM_HANDLER = ERROR_IFACE_CUSTOM_HANDLER,
TRN_ERROR_MISSING_CUSTOM_DPA_HANDLER = ERROR_MISSING_CUSTOM_DPA_HANDLER,
TRN_ERROR_USER_TO = ERROR_USER_TO,
TRN_STATUS_CONFIRMATION = STATUS_CONFIRMATION,
TRN_ERROR_USER_FROM = ERROR_USER_FROM
};
virtual int getErrorCode() const = 0;
virtual void overrideErrorCode( ErrorCode err ) = 0;
virtual std::string getErrorString() const = 0;
virtual const DpaMessage& getRequest() const = 0;
virtual const DpaMessage& getConfirmation() const = 0;
virtual const DpaMessage& getResponse() const = 0;
virtual const std::chrono::time_point<std::chrono::system_clock>& getRequestTs() const = 0;
virtual const std::chrono::time_point<std::chrono::system_clock>& getConfirmationTs() const = 0;
virtual const std::chrono::time_point<std::chrono::system_clock>& getResponseTs() const = 0;
virtual bool isConfirmed() const = 0;
virtual bool isResponded() const = 0;
virtual ~IDpaTransactionResult2() {};
static std::string errorCode(int errorCode)
{
switch (errorCode) {
case TRN_ERROR_IFACE_EXCLUSIVE_ACCESS:
return "ERROR_IFACE_EXCLUSIVE_ACCESS";
case TRN_ERROR_BAD_RESPONSE:
return "BAD_RESPONSE";
case TRN_ERROR_BAD_REQUEST:
return "BAD_REQUEST";
case TRN_ERROR_IFACE_BUSY:
return "ERROR_IFACE_BUSY";
case TRN_ERROR_IFACE:
return "ERROR_IFACE";
case TRN_ERROR_ABORTED:
return "ERROR_ABORTED";
case TRN_ERROR_IFACE_QUEUE_FULL:
return "ERROR_IFACE_QUEUE_FULL";
case TRN_ERROR_TIMEOUT:
return "ERROR_TIMEOUT";
case TRN_OK:
return "ok";
case TRN_ERROR_FAIL:
return "ERROR_FAIL";
case TRN_ERROR_PCMD:
return "ERROR_PCMD";
case TRN_ERROR_PNUM:
return "ERROR_PNUM";
case TRN_ERROR_ADDR:
return "ERROR_ADDR";
case TRN_ERROR_DATA_LEN:
return "ERROR_DATA_LEN";
case TRN_ERROR_DATA:
return "ERROR_DATA";
case TRN_ERROR_HWPID:
return "ERROR_HWPID";
case TRN_ERROR_NADR:
return "ERROR_NADR";
case TRN_ERROR_IFACE_CUSTOM_HANDLER:
return "ERROR_IFACE_CUSTOM_HANDLER";
case TRN_ERROR_MISSING_CUSTOM_DPA_HANDLER:
return "ERROR_MISSING_CUSTOM_DPA_HANDLER";
case TRN_ERROR_USER_TO:
return "ERROR_USER_TO";
case TRN_STATUS_CONFIRMATION:
return "STATUS_CONFIRMATION";
case TRN_ERROR_USER_FROM:
default:
std::ostringstream os;
os << "TRN_ERROR_USER_" << std::hex << errorCode;
return os.str();
}
}
};
|
//
// UIImage+DZYExtension.h
// BS
//
// Created by dzy on 15/9/6.
// Copyright (c) 2015年 董震宇. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (DZYExtension)
/**
* 返回一张圆形的图片
*/
- (instancetype)circleImage;
/**
* 返回一张圆形的图片
*/
+ (instancetype)circleImageNamed:(NSString *)name;
@end
|
//
// MyPostViewController.h
// Clan
//
// Created by 昔米 on 15/4/7.
// Copyright (c) 2015年 Youzu. All rights reserved.
//
#import "BaseViewController.h"
@interface MyPostViewController : BaseViewController
@property (nonatomic, copy) NSString *userId;
@property (nonatomic, assign) int selectedIndex;
@end
|
#pragma once
class XRCORE_API xrMemory {
public:
void _initialize();
void _destroy();
u32 mem_usage(u32* pBlocksUsed = NULL, u32* pBlocksFree = NULL);
void mem_compact();
void* mem_alloc(size_t size);
void* mem_realloc(void* p, size_t size);
void mem_free(void* p);
};
extern XRCORE_API xrMemory Memory;
template <class T>
IC T* xr_alloc(u32 count) {
return (T*)Memory.mem_alloc(count * sizeof(T));
}
template <class T>
IC void xr_free(T*& P) {
if (P) {
Memory.mem_free((void*)P);
P = NULL;
};
}
IC void* xr_malloc(size_t size) { return Memory.mem_alloc(size); }
IC void* xr_realloc(void* P, size_t size) { return Memory.mem_realloc(P, size); }
XRCORE_API char* xr_strdup(const char* string);
#pragma warning(push)
#pragma warning(disable : 4595) // Warning C4595 'operator new': non - member operator new or delete
// functions may not be declared inline
IC void* operator new(size_t size) { return Memory.mem_alloc(size ? size : 1); }
IC void operator delete(void* p) { xr_free(p); }
IC void* operator new[](size_t size) { return Memory.mem_alloc(size ? size : 1); }
IC void operator delete[](void* p) { xr_free(p); }
#pragma warning(pop)
XRCORE_API void vminfo(size_t* _free, size_t* reserved, size_t* committed);
XRCORE_API void log_vminfo();
XRCORE_API u32 mem_usage_impl(u32* pBlocksUsed, u32* pBlocksFree);
template <typename T, typename... Args>
T* xr_new(Args&&... args) {
T* ptr = static_cast<T*>(Memory.mem_alloc(sizeof(T)));
return new (ptr) T(std::forward<Args>(args)...);
}
template <bool _is_pm, typename T>
struct xr_special_free {
IC void operator()(T*& ptr) {
void* _real_ptr = dynamic_cast<void*>(ptr);
ptr->~T();
Memory.mem_free(_real_ptr);
}
};
template <typename T>
struct xr_special_free<false, T> {
IC void operator()(T*& ptr) {
ptr->~T();
Memory.mem_free(ptr);
}
};
template <class T>
IC void xr_delete(T*& ptr) {
if (ptr) {
xr_special_free<std::is_polymorphic_v<T>, T>()(ptr);
ptr = NULL;
}
}
template <class T>
IC void xr_delete(T* const& ptr) {
if (ptr) {
xr_special_free<std::is_polymorphic_v<T>, T>(ptr);
const_cast<T*&>(ptr) = NULL;
}
} |
#ifndef OPCODEONE_H_
#define OPCODEONE_H_
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <functional>
#define VERSION "0.0.1"
#define ENDIANESS "Big endian"
#define PC (reg[0x0f])
#define SP (reg[0x0e])
// MACROS
#define READMEM(addr) memory_bus[addr]
#define WRITEMEM(addr, val) { memory_bus[addr] = (val); }
#define READVID(addr) video_bus[addr]
#define WRITEVID(addr, val) { video_bus[addr] = (val); }
class OpcodeOne {
public:
uint32_t *memory_bus;
uint32_t *video_bus;
uint32_t reg[16]; // Registers
/*
"A": 0x00,
"B": 0x01,
"C": 0x02,
"D": 0x03,
"unused1": 0x04,
"unused2": 0x05,
"unused3": 0x06,
"unused4": 0x07,
"unused5": 0x08,
"unused6": 0x09,
"unused7": 0x0a,
"unused8": 0x0b,
"FL": 0x0c,
"SB": 0x0d,
"SP": 0x0e,
"PC": 0x0f
}
*/
uint8_t halted = 0; // Indicates the machine is halted
OpcodeOne();
~OpcodeOne();
void Run();
void Reset();
void SetIOReadCallback(std::function<uint32_t(uint32_t)> cb);
void SetIOWriteCallback(std::function<void(uint32_t, uint32_t)> cb);
private:
// Flags (TODO)
uint8_t flag_carry;
uint8_t flag_overflow;
uint8_t flag_zero;
std::function<uint32_t(uint32_t)> IOReadCallback;
std::function<void(uint32_t, uint32_t)> IOWriteCallback;
uint32_t ReadIO(uint32_t addr);
void WriteIO(uint32_t addr, uint32_t val);
uint32_t IOReadPlaceholder(uint32_t addr);
void IOWritePlaceholder(uint32_t addr, uint32_t data);
// --- Instruction methods ---
inline void Inst_ADD(); // ADD (ADDition)
inline void Inst_LD();
inline void Inst_DBG();
inline void Inst_HALT(); // HALT
inline void Inst_MR(); // MR (Memory Read)
inline void Inst_MW(); // MW (Memory Write)
inline void Inst_VR(); // VR (Video memory Read)
inline void Inst_VW(); // VW (Video memory Write)
inline void Inst_PUSH(); // PUSH
inline void Inst_POP(); // POP
inline void Inst_RET(); // RET (RETurn)
inline void Inst_JMP(); // JMP (JuMP)
inline void Inst_CALL(); // CALL
};
#endif |
//
// Created by l on 11/27/15.
//
#ifndef ANDROIDJNI_LIB_LOGGER_H
#define ANDROIDJNI_LIB_LOGGER_H
#include <jni.h>
#include <android/log.h>
/**
* 定义log标签
*/
#define TAG "jni_qsatalk"
/**
* 定义info信息
*/
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, TAG, __VA_ARGS__)
/**
* 定义debug信息
*/
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__)
/**
* 定义error信息
*/
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__)
#endif //ANDROIDJNI_LIB_LOGGER_H
|
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <Windows.h>
// TODO: reference additional headers your program requires here |
#include "../atrshmlog_internal.h"
/***************************************************************/
/**
* \file atrshmlogimpl_get_tl_tid.c
*/
/**
* \n Main code:
*
* \brief We get the tid of a thread local
*
* test t_get_tid.c
*/
atrshmlog_tid_t atrshmlog_get_thread_local_tid (volatile const void * const i_local)
{
atrshmlog_g_tl_t *g = (atrshmlog_g_tl_t*) i_local;
if (g == NULL)
return 0;
return g->atrshmlog_thread_tid;
}
|
//------------------------------------------------------------------------------
// Copyright (c) 2016 by contributors. 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.
//------------------------------------------------------------------------------
/*
Author: Chao Ma (mctt90@gmail.com)
This file defines the LinearLoss class.
*/
#ifndef F2M_LOSS_LINEAR_LOSS_H_
#define F2M_LOSS_LINEAR_LOSS_H_
#include "src/loss/loss.h"
namespace f2m {
//------------------------------------------------------------------------------
// LinearLoss is used for linear regression task.
//------------------------------------------------------------------------------
class LinearLoss : public Loss {
public:
LinearLoss() { }
~LinearLoss() { }
// Given the input DMatrix and current model, return the calculated gradients.
void CalcGrad(const DMatrix* matrix,
Model* param,
Updater* updater);
// Given the prediciton results and the ground truth, return the loss value.
// For linear regression, we use the sqaure loss.
real_t Evaluate(const std::vector<real_t>& pred,
const std::vector<real_t>& label);
private:
DISALLOW_COPY_AND_ASSIGN(LinearLoss);
};
} // namespace f2m
#endif // F2M_LOSS_LINEAR_LOSS_H_
|
//
// Copyright (c) 2016 deltaDNA Ltd. 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.
//
#import <UIKit/UIKit.h>
#import <UserNotifications/UserNotifications.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef THIRD_PARTY_TENSORFLOW_CONTRIB_SEQ2SEQ_KERNELS_BEAM_SEARCH_OPS_H_
#define THIRD_PARTY_TENSORFLOW_CONTRIB_SEQ2SEQ_KERNELS_BEAM_SEARCH_OPS_H_
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/tensor_types.h"
#include "tensorflow/core/kernels/eigen_activations.h"
#include "tensorflow/core/platform/types.h"
namespace tensorflow {
class OpKernelContext;
namespace functor {
template <typename Device, typename T>
struct GatherTree {
void operator()(OpKernelContext* ctx, const Device& d,
typename TTypes<T, 3>::ConstTensor step_ids,
typename TTypes<T, 3>::ConstTensor parent_ids,
typename TTypes<T>::ConstVec sequence_length,
typename TTypes<T, 3>::Tensor beams);
};
} // namespace functor
} // namespace tensorflow
#endif // THIRD_PARTY_TENSORFLOW_CONTRIB_SEQ2SEQ_KERNELS_BEAM_SEARCH_OPS_H_
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/robomaker/RoboMaker_EXPORTS.h>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace RoboMaker
{
namespace Model
{
class AWS_ROBOMAKER_API DeleteSimulationApplicationResult
{
public:
DeleteSimulationApplicationResult();
DeleteSimulationApplicationResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
DeleteSimulationApplicationResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
};
} // namespace Model
} // namespace RoboMaker
} // namespace Aws
|
/*
Copyright 2016 Vanderbilt 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.
*/
//***********************************************************************
// Routines for loading the varios drivvers - segment, layout, and views
//***********************************************************************
#define _log_module_index 152
#include "service_manager.h"
#include "exnode.h"
#include <tbx/list.h>
#include <tbx/type_malloc.h>
#include <tbx/random.h>
service_manager_t *exnode_service_set = NULL;
//***********************************************************************
// exnode_service_set_create - Creates a default ESS
//***********************************************************************
service_manager_t *exnode_service_set_create()
{
service_manager_t *ess;
ess = create_service_manager();
//** Install the drivers
add_service(ess, SEG_SM_LOAD, SEGMENT_TYPE_LINEAR, segment_linear_load);
add_service(ess, SEG_SM_CREATE, SEGMENT_TYPE_LINEAR, segment_linear_create);
add_service(ess, SEG_SM_LOAD, SEGMENT_TYPE_FILE, segment_file_load);
add_service(ess, SEG_SM_CREATE, SEGMENT_TYPE_FILE, segment_file_create);
add_service(ess, SEG_SM_LOAD, SEGMENT_TYPE_CACHE, segment_cache_load);
add_service(ess, SEG_SM_CREATE, SEGMENT_TYPE_CACHE, segment_cache_create);
add_service(ess, SEG_SM_LOAD, SEGMENT_TYPE_LUN, segment_lun_load);
add_service(ess, SEG_SM_CREATE, SEGMENT_TYPE_LUN, segment_lun_create);
add_service(ess, SEG_SM_LOAD, SEGMENT_TYPE_JERASURE, segment_jerasure_load);
add_service(ess, SEG_SM_CREATE, SEGMENT_TYPE_JERASURE, segment_jerasure_create);
add_service(ess, SEG_SM_LOAD, SEGMENT_TYPE_LOG, segment_log_load);
add_service(ess, SEG_SM_CREATE, SEGMENT_TYPE_LOG, segment_log_create);
add_service(ess, RS_SM_AVAILABLE, RS_TYPE_SIMPLE, rs_simple_create);
add_service(ess, RS_SM_AVAILABLE, RS_TYPE_REMOTE_CLIENT, rs_remote_client_create);
add_service(ess, RS_SM_AVAILABLE, RS_TYPE_REMOTE_SERVER, rs_remote_server_create);
add_service(ess, DS_SM_AVAILABLE, DS_TYPE_IBP, ds_ibp_create);
add_service(ess, OS_AVAILABLE, OS_TYPE_FILE, object_service_file_create);
add_service(ess, OS_AVAILABLE, OS_TYPE_REMOTE_CLIENT, object_service_remote_client_create);
add_service(ess, OS_AVAILABLE, OS_TYPE_REMOTE_SERVER, object_service_remote_server_create);
add_service(ess, OS_AVAILABLE, OS_TYPE_TIMECACHE, object_service_timecache_create);
add_service(ess, AUTHN_AVAILABLE, AUTHN_TYPE_FAKE, authn_fake_create);
add_service(ess, OSAZ_AVAILABLE, OSAZ_TYPE_FAKE, osaz_fake_create);
//***UNDOME add_service(ess, CACHE_LOAD_AVAILABLE, CACHE_TYPE_LRU, lru_cache_load); add_service(ess, CACHE_CREATE_AVAILABLE, CACHE_TYPE_LRU, lru_cache_create);
add_service(ess, CACHE_LOAD_AVAILABLE, CACHE_TYPE_AMP, amp_cache_load);
add_service(ess, CACHE_CREATE_AVAILABLE, CACHE_TYPE_AMP, amp_cache_create);
add_service(ess, CACHE_LOAD_AVAILABLE, CACHE_TYPE_ROUND_ROBIN, round_robin_cache_load);
add_service(ess, CACHE_CREATE_AVAILABLE, CACHE_TYPE_ROUND_ROBIN, round_robin_cache_create);
return(ess);
}
//***********************************************************************
// exnode_service_set_destroy - Destroys an ESS
//***********************************************************************
void exnode_service_set_destroy(service_manager_t *ess)
{
destroy_service_manager(ess);
}
//***********************************************************************
// exnode_system_init - Initializes the exnode system for use
//***********************************************************************
int exnode_system_init()
{
tbx_random_startup();
exnode_service_set = exnode_service_set_create();
return(0);
}
//***********************************************************************
// exnode_system_config - Configures the exnode system for use
//***********************************************************************
int exnode_system_config(service_manager_t *ess, data_service_fn_t *ds, resource_service_fn_t *rs, object_service_fn_t *os, thread_pool_context_t *tpc_unlimited, cache_t *cache)
{
add_service(ess, ESS_RUNNING, ESS_DS, ds);
add_service(ess, ESS_RUNNING, ESS_RS, rs);
add_service(ess, ESS_RUNNING, ESS_OS, os);
add_service(ess, ESS_RUNNING, ESS_TPC_UNLIMITED, tpc_unlimited);
add_service(ess, ESS_RUNNING, ESS_CACHE, cache);
return(0);
}
//***********************************************************************
void exnode_system_destroy()
{
tbx_random_shutdown();
exnode_service_set_destroy(exnode_service_set);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.