text stringlengths 4 6.14k |
|---|
//{{NO_DEPENDENCIES}}
// Âêëþ÷àåìûé ôàéë, ñîçäàííûé â Microsoft Visual C++.
// Èñïîëüçóåòñÿ DrawApp.rc
//
#define IDD_ABOUTBOX 100
#define IDP_OLE_INIT_FAILED 100
#define IDR_POPUP_EDIT 119
#define ID_STATUSBAR_PANE1 120
#define ID_STATUSBAR_PANE2 121
#define IDS_STATUS_PANE1 122
#define IDS_STATUS_PANE2 123
#define IDS_TOOLBAR_STANDARD 124
#define IDS_TOOLBAR_CUSTOMIZE 125
#define ID_VIEW_CUSTOMIZE 126
#define IDR_MAINFRAME 128
#define IDR_MAINFRAME_256 129
#define IDR_DrawAppTYPE 130
#define ID_WINDOW_MANAGER 131
#define ID_VIEW_FILEVIEW 133
#define ID_VIEW_CLASSVIEW 134
#define ID_PROPERTIES 135
#define ID_OPEN 136
#define ID_OPEN_WITH 137
#define ID_DUMMY_COMPILE 138
#define ID_CLASS_ADD_MEMBER_FUNCTION 139
#define ID_CLASS_ADD_MEMBER_VARIABLE 140
#define ID_CLASS_DEFINITION 141
#define ID_CLASS_PROPERTIES 142
#define ID_NEW_FOLDER 143
#define ID_SORT_MENU 144
#define ID_SORTING_GROUPBYTYPE 145
#define ID_SORTING_SORTALPHABETIC 146
#define ID_SORTING_SORTBYTYPE 147
#define ID_SORTING_SORTBYACCESS 148
#define ID_VIEW_OUTPUTWND 149
#define ID_VIEW_PROPERTIESWND 150
#define ID_SORTPROPERTIES 151
#define ID_PROPERTIES1 152
#define ID_PROPERTIES2 153
#define ID_EXPAND_ALL 154
#define IDS_FILE_VIEW 155
#define IDS_CLASS_VIEW 156
#define IDS_OUTPUT_WND 157
#define IDS_PROPERTIES_WND 158
#define IDI_FILE_VIEW 161
#define IDI_FILE_VIEW_HC 162
#define IDI_CLASS_VIEW 163
#define IDI_CLASS_VIEW_HC 164
#define IDI_OUTPUT_WND 165
#define IDI_OUTPUT_WND_HC 166
#define IDI_PROPERTIES_WND 167
#define IDI_PROPERTIES_WND_HC 168
#define IDR_EXPLORER 169
#define IDB_EXPLORER_24 170
#define IDR_SORT 171
#define IDB_SORT_24 172
#define IDR_POPUP_SORT 173
#define IDR_POPUP_EXPLORER 174
#define IDB_FILE_VIEW 175
#define IDB_FILE_VIEW_24 176
#define IDB_CLASS_VIEW 177
#define IDB_CLASS_VIEW_24 178
#define IDR_MENU_IMAGES 179
#define IDB_MENU_IMAGES_24 180
#define ID_TOOLS_MACRO 181
#define IDR_OUTPUT_POPUP 182
#define IDR_PROPERTIES 183
#define IDB_PROPERTIES_HC 184
#define IDR_THEME_MENU 200
#define ID_SET_STYLE 201
#define ID_VIEW_APPLOOK_WIN_2000 205
#define ID_VIEW_APPLOOK_OFF_XP 206
#define ID_VIEW_APPLOOK_WIN_XP 207
#define ID_VIEW_APPLOOK_OFF_2003 208
#define ID_VIEW_APPLOOK_VS_2005 209
#define ID_VIEW_APPLOOK_VS_2008 210
#define ID_VIEW_APPLOOK_OFF_2007_BLUE 215
#define ID_VIEW_APPLOOK_OFF_2007_BLACK 216
#define ID_VIEW_APPLOOK_OFF_2007_SILVER 217
#define ID_VIEW_APPLOOK_OFF_2007_AQUA 218
#define ID_VIEW_APPLOOK_WINDOWS_7 219
#define IDS_BUILD_TAB 300
#define IDS_DEBUG_TAB 301
#define IDS_FIND_TAB 302
#define IDS_EXPLORER 305
#define IDS_EDIT_MENU 306
#define ID_EELEMENT_LINE 32771
#define ID_EELEMENT_RECTANGLE 32772
#define ID_EELEMENT_CIRCLE 32773
#define ID_EELEMENT_CURVE 32774
#define ID_COLOR_BLACK 32775
#define ID_COLOR_RED 32776
#define ID_COLOR_GREEN 32777
#define ID_COLOR_BLUE 32778
#define ID_EELEMENT_RECTANGLE32779 32779
#define ID_32788 32788
#define ID_32789 32789
#define ID_32790 32790
#define ID_32791 32791
#define ID_32792 32792
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 310
#define _APS_NEXT_COMMAND_VALUE 32793
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 310
#endif
#endif
|
// MIT License
// Copyright (c) 2017 Zhuhao Wang
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#ifndef NEKIT_TCP_SOCKET_READ_SIZE
#define NEKIT_TCP_SOCKET_READ_SIZE 8192
#endif
// There is no good choice there, the server defaults (e.g., Apache, nginx) are
// usually quite large and only define the maximum length of each line instead
// of the whole header. In Node.js it is defined as 80 * 1024. Enlarge it if the
// default is too small.
#ifndef NEKIT_HTTP_HEADER_MAX_LENGTH
#define NEKIT_HTTP_HEADER_MAX_LENGTH 8192
#endif
#ifndef NEKIT_HTTP_HEADER_MAX_FIELD
#define NEKIT_HTTP_HEADER_MAX_FIELD 100
#endif
#ifndef NEKIT_HTTP_STREAM_REWRITER_MAX_BUFFER_SIZE
#define NEKIT_HTTP_STREAM_REWRITER_MAX_BUFFER_SIZE 8192
#endif
#ifndef NEKIT_SOCKS5_SERVER_BUFFER_SIZE
#define NEKIT_SOCKS5_SERVER_BUFFER_SIZE 128
#endif
#ifndef NEKIT_TLS_READ_SIZE
#define NEKIT_TLS_READ_SIZE 8192
#endif
#ifndef NEKIT_BOOST_LOG_TRACK_ID_ATTR_NAME
#define NEKIT_BOOST_LOG_TRACK_ID_ATTR_NAME "TrackId"
#endif
#ifndef NEKIT_BOOST_LOG_INSTANCE_ATTR_NAME
#define NEKIT_BOOST_LOG_INSTANCE_ATTR_NAME "Instance"
#endif
|
#ifndef HIERARCHICALDETERMINISTICWALLETS_HDWALLET_H
#define HIERARCHICALDETERMINISTICWALLETS_HDWALLET_H
#define SERIALIZED_KEY_BUFFER_LEN 112
#define VERSION_IDENTIFIER_LEN 4
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <openssl/ripemd.h>
#include <openssl/sha.h>
#ifdef __cplusplus
extern "C" {
#endif
// BIP32 Extended Key
typedef struct {
uint8_t version[VERSION_IDENTIFIER_LEN];
uint8_t depth;
uint8_t parent_fingerprint[4];
uint8_t child_number[4];
uint8_t chain_code[32];
uint8_t key_data[33];
} __attribute__ ((packed)) HDW_xkey_t;
typedef enum {
HDW_XKEY_TYPE_PUBLIC = 0,
HDW_XKEY_TYPE_PRIVATE = 1
} HDW_XKEY_TYPE;
typedef enum {
HDW_XKEY_NET_MAINNET = 0,
HDW_XKEY_NET_TESTNET = 2
} HDW_XKEY_NET;
/*
* Contains the values of xkey version prefixes
*/
extern const uint8_t KEY_VERSIONS_VALUES[4][VERSION_IDENTIFIER_LEN];
/*
* Generates the Master Node from a `seed` and puts it into `xkey`
*/
int HDW_generate_master_node(uint8_t *seed,
size_t seed_len,
HDW_XKEY_NET net,
HDW_xkey_t *key);
/*
* Takes the `key` and turns it into a BIP32 compliant Base58 representation.
* Outputs the string in a buffer of size `SERIALIZED_KEY_BUFFER_LEN`
*/
int HDW_serialize_key(HDW_xkey_t *key,
uint8_t *destination,
size_t *destination_len);
/*
* Generates the extended public key from an extended private key
* If provided private key is in fact public, the content pointed by `private_key` is copied to `public key`
* Returns: 0 on failure
* 1 on success
*/
int HDW_derive_public(HDW_xkey_t *private_key, HDW_xkey_t *public_key);
/*
* Derives a private child xkey
* Returns: 0 on failure
* 1 on success
*/
int HDW_derive_private_child(HDW_xkey_t *parent_key, HDW_xkey_t *child_key, uint32_t index);
/*
* Derives a public child xkey
* Returns: 0 on failure
* 1 on success
*/
int HDW_derive_public_child(HDW_xkey_t *parent_key, HDW_xkey_t *child_key, uint32_t index);
/*
* RIPEMD160 o SHA256
* Returns: 0 on failure
* 1 on success
*/
int HDW_hash160(uint8_t *input,
uint32_t input_len,
uint8_t output[RIPEMD160_DIGEST_LENGTH]);
bool HDW_is_xkey_hardened(HDW_xkey_t *key);
int HDW_double_SHA256(uint8_t *input,
uint32_t input_len,
uint8_t output[SHA256_DIGEST_LENGTH]);
int HDW_hash160(uint8_t *input,
uint32_t input_len,
uint8_t output[RIPEMD160_DIGEST_LENGTH]);
#ifdef __cplusplus
} // extern "C"
#endif
#endif //HIERARCHICALDETERMINISTICWALLETS_HDWALLET_H
|
//
// SignalController.h
// FRP_OC
//
// Created by ST on 16/12/7.
// Copyright © 2016年 ST. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SignalController : UIViewController
@end
|
/* This file is part of https://github.com/borneq/IniParser
The MIT License (MIT), see file LICENSE */
#pragma once
#include <iostream>
#include <vector>
#include <unordered_map>
#include "IniException.h"
class IniParser
{
private:
struct Trio
{
std::vector<std::string> comments;
std::string key;
std::string val;
};
struct Sect
{
std::vector<std::string> commentsBefore;
std::string sectHeader;
std::vector<Trio> keysval;
std::unordered_map<std::string, size_t> keysMap;
};
std::string filename;
std::vector<Sect*> sections;
std::unordered_map<std::string, size_t> sectMap;
bool dirty;
void flush();
void changed();
void freeStructs();
size_t updateCnt;
IniParser::Sect* getSectPtr(const std::string §Str);
public:
IniParser(const std::string &filename, bool mustExist);
~IniParser();
void beginUpdate();
void endUpdate();
void reload(bool mustExist);
void clearAll();
bool sectionExists(const std::string §Str);
bool keyExists(const std::string §Str, const std::string &keyStr);
std::vector<std::string> readSections();
std::vector<std::string> readSectionKeys(const std::string §Str);
std::vector<std::pair<std::string, std::string>> readSectionPairs(const std::string §Str);
std::unordered_map<std::string, std::string> readSectionMap(const std::string §Str);
static std::string mapValue(std::unordered_map<std::string, std::string> map, const std::string &key);
static std::string mapValueDef(std::unordered_map<std::string, std::string> map, const std::string &key,
const std::string &def);
void eraseSection(const std::string §Str);
void deleteSection(const std::string §Str);
void deleteKey(const std::string §Str, const std::string &keyStr);
bool tryReadString(std::string &result, const std::string §Str, const std::string &keyStr);
std::string readString(const std::string §Str, const std::string &keyStr);
std::string readStringDef(const std::string §Str, const std::string &keyStr, const std::string &def);
int readInt32(const std::string §Str, const std::string &keyStr);
int readInt32Def(const std::string §Str, const std::string &keyStr, const long long def);
long long readInt64(const std::string §Str, const std::string &keyStr);
long long readInt64Def(const std::string §Str, const std::string &keyStr, const long long def);
double readDouble(const std::string §Str, const std::string &keyStr);
double readDoubleDef(const std::string §Str, const std::string &keyStr, const double def);
bool readBool(const std::string §Str, const std::string &keyStr);
bool readBoolDef(const std::string §Str, const std::string &keyStr, const bool def);
void writeString(const std::string §Str, const std::string &keyStr, const std::string &valueStr);
void writeLong(const std::string §Str, const std::string &keyStr, const long long value);
void writeDouble(const std::string §Str, const std::string &keyStr, const double value);
void writeBool(const std::string §Str, const std::string &keyStr, const bool value);
};
|
//
// DRMasterViewController.h
// WolfpackSample
//
// Created by Justin Williams on 11/16/12.
// Copyright (c) 2012 Second Gear. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface DRMasterViewController : UITableViewController
@end
|
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#ifndef _MACH_MACHINE_THREAD_STATUS_H_
#define _MACH_MACHINE_THREAD_STATUS_H_
#if defined (__arm__) || defined (__arm64__)
#include "mach/arm/thread_status.h"
#else
#error architecture not supported
#endif
#endif /* _MACH_MACHINE_THREAD_STATUS_H_ */
|
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_BijectiveDictionary_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_BijectiveDictionary_ExampleVersionString[];
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef __cplusplus
# error This header can only be compiled as C++.
#endif
#ifndef __INCLUDED_PROTOCOL_H__
#define __INCLUDED_PROTOCOL_H__
#include "serialize.h"
#include "netbase.h"
#include <string>
#include "uint256.h"
extern bool fTestNet;
static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
{
return testnet ? 55887 : 55884;
}
extern unsigned char pchMessageStart[4];
/** Message header.
* (4) message start.
* (12) command.
* (4) size.
* (4) checksum.
*/
class CMessageHeader
{
public:
CMessageHeader();
CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn);
std::string GetCommand() const;
bool IsValid() const;
IMPLEMENT_SERIALIZE
(
READWRITE(FLATDATA(pchMessageStart));
READWRITE(FLATDATA(pchCommand));
READWRITE(nMessageSize);
READWRITE(nChecksum);
)
// TODO: make private (improves encapsulation)
public:
enum {
MESSAGE_START_SIZE=sizeof(::pchMessageStart),
COMMAND_SIZE=12,
MESSAGE_SIZE_SIZE=sizeof(int),
CHECKSUM_SIZE=sizeof(int),
MESSAGE_SIZE_OFFSET=MESSAGE_START_SIZE+COMMAND_SIZE,
CHECKSUM_OFFSET=MESSAGE_SIZE_OFFSET+MESSAGE_SIZE_SIZE,
HEADER_SIZE=MESSAGE_START_SIZE+COMMAND_SIZE+MESSAGE_SIZE_SIZE+CHECKSUM_SIZE
};
char pchMessageStart[MESSAGE_START_SIZE];
char pchCommand[COMMAND_SIZE];
unsigned int nMessageSize;
unsigned int nChecksum;
};
/** nServices flags */
enum
{
NODE_NETWORK = (1 << 0),
};
/** A CService with information about it as peer */
class CAddress : public CService
{
public:
CAddress();
explicit CAddress(CService ipIn, uint64 nServicesIn=NODE_NETWORK);
void Init();
IMPLEMENT_SERIALIZE
(
CAddress* pthis = const_cast<CAddress*>(this);
CService* pip = (CService*)pthis;
if (fRead)
pthis->Init();
if (nType & SER_DISK)
READWRITE(nVersion);
if ((nType & SER_DISK) ||
(nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH)))
READWRITE(nTime);
READWRITE(nServices);
READWRITE(*pip);
)
void print() const;
// TODO: make private (improves encapsulation)
public:
uint64 nServices;
// disk and network only
unsigned int nTime;
// memory only
int64 nLastTry;
};
/** inv message data */
class CInv
{
public:
CInv();
CInv(int typeIn, const uint256& hashIn);
CInv(const std::string& strType, const uint256& hashIn);
IMPLEMENT_SERIALIZE
(
READWRITE(type);
READWRITE(hash);
)
friend bool operator<(const CInv& a, const CInv& b);
bool IsKnownType() const;
const char* GetCommand() const;
std::string ToString() const;
void print() const;
// TODO: make private (improves encapsulation)
public:
int type;
uint256 hash;
};
enum
{
MSG_TX = 1,
MSG_BLOCK,
// Nodes may always request a MSG_FILTERED_BLOCK in a getdata, however,
// MSG_FILTERED_BLOCK should not appear in any invs except as a part of getdata.
MSG_FILTERED_BLOCK,
};
#endif // __INCLUDED_PROTOCOL_H__
|
/*
For more information, please see: http://software.sci.utah.edu
The MIT License
Copyright (c) 2020 Scientific Computing and Imaging Institute,
University of Utah.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#ifndef MODULES_MATH_ConvertComplexToRealMatrix_H
#define MODULES_MATH_ConvertComplexToRealMatrix_H
#include <Dataflow/Network/Module.h>
#include <Modules/Math/share.h>
namespace SCIRun {
namespace Modules {
namespace Math {
class SCISHARE ConvertComplexToRealMatrix : public Dataflow::Networks::Module,
public Has1InputPort<ComplexMatrixPortTag>,
public Has4OutputPorts<MatrixPortTag, MatrixPortTag, MatrixPortTag, MatrixPortTag>
{
public:
ConvertComplexToRealMatrix();
void execute() override;
void setStateDefaults() override {}
INPUT_PORT(0, InputComplexMatrix, ComplexMatrix);
OUTPUT_PORT(0, OutputRealPartMatrix, Matrix);
OUTPUT_PORT(1, OutputComplexPartMatrix, Matrix);
OUTPUT_PORT(2, Magnitude, Matrix);
OUTPUT_PORT(3, Phase, Matrix);
MODULE_TRAITS_AND_INFO(NoAlgoOrUI)
NEW_HELP_WEBPAGE_ONLY
};
}}}
#endif
|
//
// AppDelegate.h
// GFScrollView
//
// Created by 高飞 on 16/12/6.
// Copyright © 2016年 高飞. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
//
// XBCameraTargetView.h
// XBImageFilters
//
// Created by xiss burg on 4/13/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface XBCameraTargetView : UIView
@property (assign, nonatomic) BOOL visible;
- (void)setVisible:(BOOL)visible animated:(BOOL)animated;
@end
|
//
// PLCrashReporter+AppBlade.h
// AppBlade
//
// Created by AndrewTremblay on 2/6/14.
// Copyright (c) 2014 Raizlabs Corporation. All rights reserved.
//
#import "PLCrashReporter.h"
// these once-public, now-private methods are required by AppBlade for backwards compatibility
@interface PLCrashReporter ()
- (NSString *) queuedCrashReportDirectory;
-(NSString *)crashReportDirectory;
-(NSString *)crashReportPath;
@end
|
/*
*
* TrustIndicator
* ledger-core
*
* Created by Pierre Pollastri on 08/06/2017.
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ledger
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
#ifndef LEDGER_CORE_TRUSTINDICATOR_H
#define LEDGER_CORE_TRUSTINDICATOR_H
#include <string>
#include <rapidjson/document.h>
#include <api/TrustIndicator.hpp>
#include <api/TrustLevel.hpp>
#include <cereal/cereal.hpp>
#include <api/enum_from_string.hpp>
#include <cereal/types/string.hpp>
#include <cereal/types/vector.hpp>
namespace ledger {
namespace core {
class TrustIndicator : public api::TrustIndicator {
public:
TrustIndicator();
TrustIndicator(const TrustIndicator& ind) = delete;
template <class Archive>
void serialize(Archive& ar, std::uint32_t const version) {
std::string level = api::to_string(_level);
ar(CEREAL_NVP(level), CEREAL_NVP(_origin), CEREAL_NVP(_weight), CEREAL_NVP(_conflicts));
_level = api::from_string<api::TrustLevel>(level);
}
int32_t getTrustWeight() override;
api::TrustLevel getTrustLevel() override;
std::vector<std::string> getConflictingOperationUids() override;
std::string getOrigin() override;
TrustIndicator& setTrustWeight(int32_t weight);
TrustIndicator& setTrustLevel(api::TrustLevel level);
TrustIndicator& setOrigin(const std::string& origin);
TrustIndicator& addConflictingOperationUid(const std::string& uid);
TrustIndicator& removeConflictingOperationUid(const std::string& uid);
private:
int32_t _weight;
api::TrustLevel _level;
std::vector<std::string> _conflicts;
std::string _origin;
};
}
}
CEREAL_CLASS_VERSION(ledger::core::TrustIndicator, 0);
#endif //LEDGER_CORE_TRUSTINDICATOR_H
|
#pragma once
#include <memory>
#include <string>
#include <netinet/in.h>
#include <boost/circular_buffer.hpp>
#define TIMEOUT 1000
class TCPConnection {
public:
TCPConnection();
~TCPConnection();
std::string address();
void accept(int sockd);
// nonblocking, will read a max of len bytes to buffer.
// returns amount written
// throws on error
size_t nonblockingRead(char* buf, size_t len);
// nonblocking, will read a max of 1 byte to buffer.
// much faster than reading a single byte from the socket
// returns amount written
// throws on error
size_t nonblockingReadByte(char* buf);
size_t readByte(char* buf);
// blocking, reads until either len bytes have been read or until delim is found
// delim is discarded from stream
// returns amount written
// throws on error
size_t readUntil(char* buf, size_t len, char delim);
void write(const char* buf, size_t len);
void close();
private:
sockaddr _addr = {};
socklen_t _addrlen = sizeof(_addr);
int _sockd = 0;
boost::circular_buffer<char> _buffer;
// will clear buffer and read until full or until timeout occurs.
// returns amount read
size_t _doTcpRead();
}; |
/*
* IStock.h
*
* Created on: Aug 4, 2015
* Author: ejieysh
*/
#ifndef ISTOCK_H_
#define ISTOCK_H_
#include "IUser.h"
#include "Price.h"
#include <vector>
#include <string>
class IUser;
class IStock
{
public:
typedef std::vector<IUser*> IUsers;
IStock(const std::string& name);
virtual ~IStock();
virtual void recvSubscription(IUser* user) =0;
virtual void recvUnsubscription(const IUser* user) =0;
virtual void setCurrentPrice(const float current) =0;
virtual void notifySubscribers() =0;
protected:
Price price;
IUsers users;
};
#endif /* ISTOCK_H_ */
|
/**
* @file handler.h
* Prototypes of handling and utility functions.
*
* Part of the core tbaMUD source code distribution, which is a derivative
* of, and continuation of, CircleMUD.
*
* All rights reserved. See license for complete information.
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.
*/
#ifndef _HANDLER_H_
#define _HANDLER_H_
/* handling the affected-structures */
void affect_total(struct char_data *ch);
void affect_to_char(struct char_data *ch, struct affected_type *af);
void affect_remove(struct char_data *ch, struct affected_type *af);
void affect_from_char(struct char_data *ch, int type);
bool affected_by_spell(struct char_data *ch, int type);
void affect_join(struct char_data *ch, struct affected_type *af,
bool add_dur, bool avg_dur, bool add_mod, bool avg_mod);
/* utility */
const char *money_desc(int amount);
struct obj_data *create_money(int amount);
int isname(const char *str, const char *namelist);
int is_name(const char *str, const char *namelist);
char *fname(const char *namelist);
int get_number(char **name);
/* objects */
void obj_to_char(struct obj_data *object, struct char_data *ch);
void obj_from_char(struct obj_data *object);
void equip_char(struct char_data *ch, struct obj_data *obj, int pos);
struct obj_data *unequip_char(struct char_data *ch, int pos);
int invalid_align(struct char_data *ch, struct obj_data *obj);
void obj_to_room(struct obj_data *object, room_rnum room);
void obj_from_room(struct obj_data *object);
void obj_to_obj(struct obj_data *obj, struct obj_data *obj_to);
void obj_from_obj(struct obj_data *obj);
void object_list_new_owner(struct obj_data *list, struct char_data *ch);
void extract_obj(struct obj_data *obj);
void update_char_objects(struct char_data *ch);
/* characters*/
struct char_data *get_char_room(char *name, int *num, room_rnum room);
struct char_data *get_char_num(mob_rnum nr);
void char_from_room(struct char_data *ch);
void char_to_room(struct char_data *ch, room_rnum room);
void extract_char(struct char_data *ch);
void extract_char_final(struct char_data *ch);
void extract_pending_chars(void);
/* find if character can see */
struct char_data *get_player_vis(struct char_data *ch, char *name, int *number, int inroom);
struct char_data *get_char_vis(struct char_data *ch, char *name, int *number, int where);
struct char_data *get_char_room_vis(struct char_data *ch, char *name, int *number);
struct char_data *get_char_world_vis(struct char_data *ch, char *name, int *number);
struct obj_data *get_obj_in_list_num(int num, struct obj_data *list);
struct obj_data *get_obj_num(obj_rnum nr);
struct obj_data *get_obj_in_list_vis(struct char_data *ch, char *name, int *number, struct obj_data *list);
struct obj_data *get_obj_vis(struct char_data *ch, char *name, int *num);
struct obj_data *get_obj_in_equip_vis(struct char_data *ch, char *arg, int *number, struct obj_data *equipment[]);
int get_obj_pos_in_equip_vis(struct char_data *ch, char *arg, int *num, struct obj_data *equipment[]);
/* find all dots */
int find_all_dots(char *arg);
#define FIND_INDIV 0
#define FIND_ALL 1
#define FIND_ALLDOT 2
/* group */
struct group_data * create_group(struct char_data * leader);
void free_group(struct group_data * group);
void leave_group(struct char_data *ch);
void join_group(struct char_data *ch, struct group_data *group);
/* Generic Find */
int generic_find(char *arg, bitvector_t bitvector, struct char_data *ch,
struct char_data **tar_ch, struct obj_data **tar_obj);
#define FIND_CHAR_ROOM (1 << 0)
#define FIND_CHAR_WORLD (1 << 1)
#define FIND_OBJ_INV (1 << 2)
#define FIND_OBJ_ROOM (1 << 3)
#define FIND_OBJ_WORLD (1 << 4)
#define FIND_OBJ_EQUIP (1 << 5)
/* prototypes from mobact.c */
void forget(struct char_data *ch, struct char_data *victim);
void remember(struct char_data *ch, struct char_data *victim);
void mobile_activity(void);
void clearMemory(struct char_data *ch);
/* For new last command: */
#define LAST_FILE LIB_ETC "last"
#define LAST_CONNECT 0
#define LAST_ENTER_GAME 1
#define LAST_RECONNECT 2
#define LAST_TAKEOVER 3
#define LAST_QUIT 4
#define LAST_IDLEOUT 5
#define LAST_DISCONNECT 6
#define LAST_SHUTDOWN 7
#define LAST_REBOOT 8
#define LAST_CRASH 9
#define LAST_PLAYING 10
struct last_entry {
int close_type;
char hostname[256];
char username[16];
time_t time;
time_t close_time;
int idnum;
int punique;
};
void add_llog_entry(struct char_data *ch, int type);
struct last_entry *find_llog_entry(int punique, long idnum);
#endif /* _HANDLER_H_ */
|
//
// RKLIBDef.h
// Pods
//
// Created by Ronny Meissner on 14/08/14.
//
//
#ifndef Pods_RKLIBDef_h
#define Pods_RKLIBDef_h
static NSString *const kTypes = @"types";
static NSString *const kGeocode = @"geocode";
static NSString *const kInput = @"input";
static NSString *const kEstablishment = @"establishment";
static NSString *const kLanguage = @"language";
// no errors occurred
static NSString *const kStatusCodeOK = @"OK";
// successful but returned no results
static NSString *const kStatusCodeZeroResults = @"ZERO_RESULTS";
// you are over your quota.
static NSString *const kStatusCodeOverQueryLimit = @"OVER_QUERY_LIMIT";
// request was denied.
static NSString *const kStatusCodeRequestDenied = @"REQUEST_DENIED";
// a query parameter is missing
static NSString *const kStatusCodeInvalidRequest = @"INVALID_REQUEST";
// unknown server error. try again.
static NSString *const kStatusCodeUnknownError = @"UNKNOWN_ERROR";
static NSString *const kJson = @"json";
static NSString *const kXml = @"xml";
static NSString *const kAddress = @"address";
static NSString *const kComponents = @"components";
static NSString *const kSensor = @"sensor";
static NSString *const kOffset = @"offset";
static NSString *const kRadius = @"radius";
static NSString *const kLocation = @"location";
static NSString *const kBounds = @"bounds";
static NSString *const kKey = @"key";
static NSString *const kRegion = @"region";
static NSString *const kTrue = @"true";
static NSString *const kFalse = @"false";
static NSString *const kLongTitleKey = @"long_title_key";
static NSString *const kURLKey = @"url_title_key";
static NSString *const kActionKey = @"action_key";
static NSString *const kObjectManager = @"object_manager_key";
#endif
|
//
// Image.h
//
// Created by Adrien David.
//
//
#ifndef Component_Image_h
#define Component_Image_h
#include "../Vec2.h"
#include <Polycode.h>
#include <aunteater/Component.h>
#include <memory>
namespace TeaParty { namespace Component {
struct Image : public aunteater::Component
{
Image(const std::string &aFile) :
polyImage(std::make_shared<Polycode::SceneImage>(aFile))
{}
std::shared_ptr<Polycode::SceneImage> polyImage;
private:
COMP_CLONE(Image)
};
}} // namespace TeaParty::Component
#endif |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSScreen.h"
@interface NSScreen (IBScreenAdditions)
- (struct CGRect)layoutFrame;
@end
|
#ifndef CAMERA_H
#define CAMERA_H
#define CAMERA_ZN 0.1f
#define CAMERA_ZF 1000.0f
#include "SpeckEngineDefinitions.h"
#include "EngineUser.h"
namespace Speck
{
class Camera : public EngineUser
{
friend class CameraController;
friend struct CubeCameraSet;
public:
DLL_EXPORT Camera(EngineCore &engineCore);
DLL_EXPORT ~Camera();
DLL_EXPORT void Update(float dt, CameraController *cc);
// Get world camera position.
DirectX::XMVECTOR GetPositionVector() const { return XMLoadFloat3(&mPosition); }
DirectX::XMFLOAT3 GetPosition() const { return mPosition; }
//Get camera basis vectors.
DirectX::XMVECTOR GetRightVector() const { return XMLoadFloat3(&mRight); }
DirectX::XMFLOAT3 GetRightFloat3() const { return mRight; }
DirectX::XMVECTOR GetUpVector() const { return XMLoadFloat3(&mUp); }
DirectX::XMFLOAT3 GetUpFloat3() const { return mUp; }
DirectX::XMVECTOR GetLookVector() const{ return XMLoadFloat3(&mLook); }
DirectX::XMFLOAT3 GetLookFloat3() const { return mLook; }
// Get frustum properties.
float GetNearZ() const { return mNearZ; }
float GetFarZ() const { return mFarZ; }
float GetFovY() const { return mFovY; }
DLL_EXPORT float GetFovX() const;
// Get near and far plane dimensions in view space coordinates.
DLL_EXPORT float GetNearWindowWidth() const;
float GetNearWindowHeight() const { return mNearWindowHeight; }
DLL_EXPORT float GetFarWindowWidth() const;
float GetFarWindowHeight() const { return mFarWindowHeight; }
// Get View / Proj matrices.
DirectX::XMMATRIX GetView() const { return XMLoadFloat4x4(&mView); }
DirectX::XMMATRIX GetProj() const { return XMLoadFloat4x4(&mProj); }
DirectX::XMMATRIX GetViewProj() const { return XMLoadFloat4x4(&mView) * XMLoadFloat4x4(&mProj); }
// Set frustum.
DLL_EXPORT void SetLens(float fovY, float aspect, float zn, float zf);
// Define camera space via LookAt parameters.
DLL_EXPORT void LookAt(DirectX::FXMVECTOR pos, DirectX::FXMVECTOR target, DirectX::FXMVECTOR worldUp);
DLL_EXPORT void LookAt(const DirectX::XMFLOAT3 &pos, const DirectX::XMFLOAT3 &target, const DirectX::XMFLOAT3 &worldUp);
// Get the frustum volume of this camera
DirectX::BoundingFrustum const &GetFrustum() const { return mFrustum; }
private:
// After modifying camera position/orientation, call to rebuild the view matrix once per frame.
DLL_EXPORT void UpdateViewMatrix();
private:
//Camera coordinate system with coordinates relative to world space.
DirectX::XMFLOAT3 mPosition; // view space origin
DirectX::XMFLOAT3 mRight; // view space x-axis
DirectX::XMFLOAT3 mUp; // view space y-axis
DirectX::XMFLOAT3 mLook; // view space z-axis
// Cache frustum properties.
float mNearZ;
float mFarZ;
float mFovY;
float mNearWindowHeight;
float mFarWindowHeight;
DirectX::BoundingFrustum mFrustum;
// Cache View/Proj matrices.
DirectX::XMFLOAT4X4 mView;
DirectX::XMFLOAT4X4 mProj;
};
}
#endif
|
/*
* Copyright (c) 2014 ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
* If you do not find this file, copies can be found by writing to:
* ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group.
*/
#ifndef LIB_XOMP_H_
#define LIB_XOMP_H_
/// arguments passed to worker domains
#define XOMP_WORKER_ARG "--xompworker"
/* XOMP channel settings */
/// size of the messaging channel between master and remote workers
#define XOMP_MSG_CHAN_SIZE 4096
/// size of the thread local storage frame
#define XOMP_TLS_SIZE 4096
/// size of the messaging frame (2x channel size)
#define XOMP_MSG_FRAME_SIZE (2* XOMP_MSG_CHAN_SIZE)
/// total size of the frame to allocate
#define XOMP_FRAME_SIZE (XOMP_MSG_FRAME_SIZE + XOMP_TLS_SIZE)
/* Typedefs */
/// XOMP worker ID
typedef uint64_t xomp_wid_t;
/// XOMP task ID
typedef uint32_t xomp_task_id_t;
/// possible frame types when adding a new shared frame
typedef enum xomp_frame_type {
XOMP_FRAME_TYPE_SHARED_RW,
XOMP_FRAME_TYPE_SHARED_RO,
XOMP_FRAME_TYPE_MSG
} xomp_frame_type_t;
/// XOMP worker function
typedef void (*xomp_worker_fn_t) (void *);
/**
* XOMP task structure
*/
struct xomp_task
{
xomp_task_id_t id; ///< id of the task
uint32_t total_threads; ///< total workers used in this task
uint32_t done; ///< number of workers that have completed
void *barrier; ///< the barrier to enter upon completion
void *arg; ///< argument of the worker function
xomp_worker_fn_t fn; ///< worker function to be called
};
/**
* \brief sets the thread local storage for the master / worker domains
*
* \oparam xdata Pointer to the thread local data struct
*/
void xomp_set_tls(void *xdata);
/* include the master and worker */
#include <xomp/xomp_master.h>
#include <xomp/xomp_worker.h>
#endif // LIB_XOMP_H_
|
#ifndef SHRINKSAM_H
#define SHRINKSAM_H
#endif
|
#ifndef NX_FOUNDATION_NX9F32
#define NX_FOUNDATION_NX9F32
/*----------------------------------------------------------------------------*\
|
| Public Interface to Ageia PhysX Technology
|
| www.ageia.com
|
\*----------------------------------------------------------------------------*/
/** \addtogroup foundation
@{
*/
//Exclude file from docs
/** \cond */
#include "Nxf.h"
//the file name of this header is legacy due to pain of renaming file in repository.
class Nx9Real
{
public:
struct S
{
#ifndef TRANSPOSED_MAT33
NxReal _11, _12, _13;
NxReal _21, _22, _23;
NxReal _31, _32, _33;
#else
NxReal _11, _21, _31;
NxReal _12, _22, _32;
NxReal _13, _23, _33;
#endif
};
union
{
S s;
NxReal m[3][3];
};
};
/** \endcond */
/** @} */
#endif
//AGCOPYRIGHTBEGIN
///////////////////////////////////////////////////////////////////////////
// Copyright (c) 2005 AGEIA Technologies.
// All rights reserved. www.ageia.com
///////////////////////////////////////////////////////////////////////////
//AGCOPYRIGHTEND
|
// Copyright (c) 2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_VERSION_H
#define BITCOIN_VERSION_H
#include "clientversion.h"
#include <string>
//
// client versioning
//
static const int CLIENT_VERSION =
1000000 * CLIENT_VERSION_MAJOR
+ 10000 * CLIENT_VERSION_MINOR
+ 100 * CLIENT_VERSION_REVISION
+ 1 * CLIENT_VERSION_BUILD;
extern const std::string CLIENT_NAME;
extern const std::string CLIENT_BUILD;
extern const std::string CLIENT_DATE;
//
// network protocol versioning
//
static const int PROTOCOL_VERSION = 90001;
// earlier versions not supported as of Feb 2012, and are disconnected
static const int MIN_PROTO_VERSION = 209;
// nTime field added to CAddress, starting with this version;
// if possible, avoid requesting addresses nodes older than this
static const int CADDR_TIME_VERSION = 31402;
// only request blocks from nodes outside this range of versions
static const int NOBLKS_VERSION_START = 60002;
static const int NOBLKS_VERSION_END = 60004;
// From Thu Jan 30 05:40:00 MSK 2014, disallow blocks from older versions.
static const int NOBLKS2014_VERSION_END = 70000;
static const int NOBLKS2014_2_VERSION_END = 80000;
static const int NOBLKS2014_3_VERSION_END = 90000;
// BIP 0031, pong message, is enabled for all versions AFTER this one
static const int BIP0031_VERSION = 60000;
// "mempool" command, enhanced "getdata" behavior starts with this version:
static const int MEMPOOL_GD_VERSION = 60002;
#define DISPLAY_VERSION_MAJOR 5
#define DISPLAY_VERSION_MINOR 4
#define DISPLAY_VERSION_REVISION 1
#define DISPLAY_VERSION_BUILD 0
#endif
|
#include <stdio.h>
int main(int argc, char *argv[])
{
for(int i = 0; i < argc; i++) {
printf("%s ",argv[i]);
}
return 0;
}
|
#pragma once
#include <cassert>
#include <atomic>
#include <condition_variable>
#include <mutex>
#include <thread>
namespace caprica {
struct CapricaJob abstract
{
CapricaJob() = default;
CapricaJob(const CapricaJob& other) = delete;
CapricaJob(CapricaJob&& other) = delete;
CapricaJob& operator =(const CapricaJob&) = delete;
CapricaJob& operator =(CapricaJob&&) = delete;
~CapricaJob() = default;
void await();
protected:
virtual void run() = 0;
private:
std::atomic<bool> hasRan{ false };
std::atomic<bool> runningLock{ false };
std::condition_variable ranCondition;
std::mutex ranMutex;
friend struct CapricaJobManager;
std::atomic<CapricaJob*> next{ nullptr };
bool tryRun();
};
struct CapricaJobManager final
{
void startup(size_t workerCount);
bool tryDeque(CapricaJob** retJob);
void queueJob(CapricaJob* job);
void setQueueInitialized() { queueInitialized.store(true, std::memory_order_relaxed); }
// Run the currently executing thread as
// a worker.
void enjoin();
private:
struct DefaultJob final : public CapricaJob {
virtual void run() override { }
} defaultJob;
std::atomic<CapricaJob*> front{ &defaultJob };
std::atomic<CapricaJob*> back{ &defaultJob };
std::mutex queueAvailabilityMutex;
std::condition_variable queueCondition;
std::atomic<size_t> queuedItemCount{ 0 };
std::atomic<size_t> waiterCount{ 0 };
std::atomic<size_t> workerCount{ 0 };
std::atomic<bool> stopWorkers{ false };
std::atomic<bool> queueInitialized{ false };
void workerMain();
};
}
|
/*****************************************************************
NSView+M3ExtensionsTests.h
M3AppKit
Created by Martin Pilkington on 12/02/2013.
Please read the LICENCE.txt for licensing information
*****************************************************************/
#import <SenTestingKit/SenTestingKit.h>
@interface NSView_M3ExtensionsTests : SenTestCase
@end
|
int main()
{
int a = 0;
}
|
#ifndef LINALG_UTIL_H
#define LINALG_UTIL_H
#include <cmath>
#include <array>
#include <algorithm>
#include "vector.h"
const float PI = 3.14159;
const float TAU = 6.28318;
const float INV_PI = 1.f / PI;
const float INV_TAU = 1.f / TAU;
/*
* Enum for storing x/y/z axis ids
*/
enum AXIS { X, Y, Z };
/*
* Some basic math/geometric utility functions
*/
template<typename T>
constexpr T lerp(float t, const T &a, const T &b){
return (1.f - t) * a + t * b;
}
template<typename T>
constexpr inline T clamp(T x, T l, T h){
return x < l ? l : x > h ? h : x;
}
//Version of mod that handles negatives cleaner, % is undefined in this case
inline int mod(int a, int m){
int n = int{a / m};
a -= n * m;
return a < 0 ? a + m : a;
}
constexpr inline float radians(float deg){
return PI / 180.f * deg;
}
constexpr inline float degrees(float rad){
return 180.f / PI * rad;
}
inline float log_2(float x){
static float inv_log2 = 1.f / std::log(2);
return std::log(x) * inv_log2;
}
template<typename T>
constexpr int sign(T x){
return (T{0} < x) - (x < T{0});
}
inline Vector spherical_dir(float sin_theta, float cos_theta, float phi){
return Vector{sin_theta * std::cos(phi), sin_theta * std::sin(phi), cos_theta};
}
constexpr inline float spherical_theta(const Vector &v){
return std::acos(clamp(v.z, -1.f, 1.f));
}
inline float spherical_phi(const Vector &v){
float p = std::atan2(v.y, v.x);
return p < 0.f ? p + TAU : p;
}
/*
* Round x up to the nearest power of 2
* Based off Stephan Brumme's method
* http://bits.stephan-brumme.com/roundUpToNextPowerOfTwo.html
*/
inline uint32_t round_up_pow2(uint32_t x){
x--;
x |= x >> 1;
x |= x >> 2;
x |= x >> 4;
x |= x >> 8;
x |= x >> 16;
return x + 1;
}
/*
* Solve a quadratic equation a*t^2 + b*2 + c = 0 and return real roots
* in t0, t1. Returns false if no real roots exist
*/
inline bool solve_quadratic(float a, float b, float c, float &t0, float &t1){
float discrim = b * b - 4 * a * c;
if (discrim <= 0){
return false;
}
discrim = std::sqrt(discrim);
float q = b < 0 ? -0.5f * (b - discrim) : -0.5f * (b + discrim);
t0 = q / a;
t1 = c / q;
if (t0 > t1){
std::swap(t0, t1);
}
return true;
}
/*
* Solve a 2x2 linear system of equations, mat is the 2x2 matrix in row-major order
* rhs is the right side vector to solve for. Solutions are returned through a and b
* returns true if the system was solved successfully
*/
inline bool solve_linear2x2(const std::array<float, 4> &mat, const std::array<float, 2> &rhs, float &a, float &b){
float det = mat[0] * mat[3] - mat[1] * mat[2];
if (std::abs(det) < 1e-10){
return false;
}
a = (mat[3] * rhs[0] - mat[1] * rhs[1]) / det;
b = (mat[0] * rhs[1] - mat[2] * rhs[0]) / det;
if (std::isnan(a) || std::isnan(b)){
return false;
}
return true;
}
/*
* Compute a local coordinate system from a single vector
*/
inline void coordinate_system(const Vector &e1, Vector &e2, Vector &e3){
if (std::abs(e1.x) > std::abs(e1.y)){
float inv_len = 1 / std::sqrt(e1.x * e1.x + e1.z * e1.z);
e2 = Vector{-e1.z * inv_len, 0, e1.x * inv_len};
}
else {
float inv_len = 1 / std::sqrt(e1.y * e1.y + e1.z * e1.z);
e2 = Vector{0, e1.z * inv_len, -e1.y * inv_len};
}
e3 = e1.cross(e2);
}
#endif
|
#define _BSD_SOURCE /* To get NI_MAXHOST and NI_MAXSERV
definitions from <netdb.h> */
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "inet_sockets.h"
#include "spcsot.h"
int
inetConnect(const char *host, const char *service, int type)
{
struct addrinfo hints;
struct addrinfo *result, *rp;
int sfd, s;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_canonname = NULL;
hints.ai_addr = NULL;
hints.ai_next = NULL;
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = type;
s = getaddrinfo(host, service, &hints, &result);
if (s != 0) {
errno = ENOSYS;
return -1;
}
/* Walk through returned list until we find an address structure
* that can be used to successfully connect a socket */
for (rp = result; rp != NULL; rp = rp->ai_next) {
sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
if (sfd == -1)
continue; /* On error, try next address */
if (connect(sfd, rp->ai_addr, rp->ai_addrlen) != -1)
break; /* On sucess, quit loop */
close(sfd);
}
freeaddrinfo(result);
return (rp == NULL) ? -1 : sfd;
}
static int /* public interfaces: inetBind() and inetListen() */
inetPassiveSocket(const char *service, int type, socklen_t *addrlen,
Boolean doListen, int backlog)
{
struct addrinfo hints;
struct addrinfo *result, *rp;
int sfd, optval, s;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_canonname = NULL;
hints.ai_addr = NULL;
hints.ai_next = NULL;
hints.ai_socktype = type;
hints.ai_family = AF_UNSPEC;
hints.ai_flags = AI_PASSIVE; /* Use wildcard IP address */
s = getaddrinfo(NULL, service, &hints, &result);
if (s != 0)
return -1;
/* Walk through returned list until we find an address structure
* that can be used to successfully create and bind a socket */
optval = 1;
for (rp = result; rp != NULL; rp = rp->ai_next) {
sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
if (sfd == -1)
continue;
if (doListen) {
if (setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &optval,
sizeof(optval)) == -1) {
close(sfd);
freeaddrinfo(result);
return -1;
}
}
if (bind(sfd, rp->ai_addr, rp->ai_addrlen) == 0)
break; /* Success */
close(sfd);
}
if (rp != NULL && doListen) {
if (listen(sfd, backlog) == -1) {
freeaddrinfo(result);
return -1;
}
}
if (rp != NULL && addrlen != NULL)
*addrlen = rp->ai_addrlen; /* Return address structure size */
freeaddrinfo(result);
return (rp == NULL) ? -1 : sfd;
}
int
inetListen(const char *service, int backlog, socklen_t *addrlen)
{
return inetPassiveSocket(service, SOCK_STREAM, addrlen, TRUE, backlog);
}
int
inetBind(const char *service, int type, socklen_t *addrlen)
{
return inetPassiveSocket(service, type, addrlen, FALSE, 0);
}
char *
inetAddressStr(const struct sockaddr *addr, socklen_t addrlen,
char *addrStr, int addrStrLen)
{
char host[NI_MAXHOST], service[NI_MAXSERV];
if (getnameinfo(addr, addrlen, host, NI_MAXHOST,
service, NI_MAXSERV, NI_NUMERICSERV) == 0)
snprintf(addrStr, addrStrLen, "(%s %s)", host, service);
else
snprintf(addrStr, addrStrLen, "(?UNKNOWN?)");
addrStr[addrStrLen - 1] = '\0'; /* Ensure result is null-terminated */
return addrStr;
}
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
@class EKEventStore, EKEventViewController, EKICSPreviewModel, UIViewController;
@interface EKICSPreviewController : NSObject
{
EKICSPreviewModel *_model;
EKEventStore *_eventStore;
EKEventViewController *_currentImport;
UIViewController *_contentViewController;
_Bool _importing;
_Bool _hasCustomCancelButton;
long long _cancelButtonType;
_Bool _allowsImport;
_Bool _allowsEditing;
_Bool _allowsSubitems;
_Bool _allowsInvalidProperties;
_Bool _allowsToDos;
int _actionsState;
id <EKICSPreviewControllerDelegate> _previewDelegate;
}
@property(nonatomic) _Bool allowsToDos; // @synthesize allowsToDos=_allowsToDos;
@property(nonatomic) _Bool allowsInvalidProperties; // @synthesize allowsInvalidProperties=_allowsInvalidProperties;
@property(nonatomic) int actionsState; // @synthesize actionsState=_actionsState;
@property(nonatomic) _Bool allowsSubitems; // @synthesize allowsSubitems=_allowsSubitems;
@property(nonatomic) _Bool allowsEditing; // @synthesize allowsEditing=_allowsEditing;
@property(nonatomic) _Bool allowsImport; // @synthesize allowsImport=_allowsImport;
@property(nonatomic) __weak id <EKICSPreviewControllerDelegate> previewDelegate; // @synthesize previewDelegate=_previewDelegate;
- (void).cxx_destruct;
- (void)importEventFromController:(id)arg1 intoCalendar:(id)arg2;
- (void)importAllIntoCalendar:(id)arg1;
- (void)calendarChooserDidCancel:(id)arg1;
- (void)calendarChooserDidFinish:(id)arg1;
- (void)importAllRequested:(id)arg1;
- (void)eventViewControllerDidRequestAddToCalendar:(id)arg1;
- (void)presentCalendarChooserForController:(id)arg1;
- (void)icsPreviewListControllerDidRequestImportAll:(id)arg1;
- (void)icsPreviewListController:(id)arg1 didSelectEvent:(id)arg2;
- (void)removeCancelButton;
- (void)setCancelButtonWithTarget:(id)arg1 action:(SEL)arg2;
- (void)_updateCancelButton;
- (void)_createCancelButtonWithType:(long long)arg1 target:(id)arg2 action:(SEL)arg3;
- (id)popoverContentController;
- (id)viewController;
- (id)detailViewForEvent:(id)arg1 eventInRealStore:(_Bool)arg2;
@property(readonly, nonatomic) _Bool isImporting;
@property(readonly, nonatomic) unsigned long long unimportedEventCount;
@property(readonly, nonatomic) unsigned long long totalEventCount;
- (void)_databaseChanged:(id)arg1;
- (void)dealloc;
- (id)initWithData:(id)arg1 eventStore:(id)arg2 options:(unsigned long long)arg3;
- (id)initWithData:(id)arg1 eventStore:(id)arg2;
- (id)initWithURL:(id)arg1 eventStore:(id)arg2 options:(unsigned long long)arg3;
- (id)initWithURL:(id)arg1 eventStore:(id)arg2;
@end
|
/*
* ListView.h
*
*
*/
#ifndef _ListView_H_
#define _ListView_H_
#include <string>
#include "FreeStyleProject.h"
#include <list>
#include "Object.h"
/** \defgroup Models Data Structures for API
* Classes containing all the Data Structures needed for calling/returned by API endpoints
*
*/
namespace Tizen {
namespace ArtikCloud {
/*! \brief
*
* \ingroup Models
*
*/
class ListView : public Object {
public:
/*! \brief Constructor.
*/
ListView();
ListView(char* str);
/*! \brief Destructor.
*/
virtual ~ListView();
/*! \brief Retrieve a string JSON representation of this class.
*/
char* toJson();
/*! \brief Fills in members of this class from JSON string representing it.
*/
void fromJson(char* jsonStr);
/*! \brief Get
*/
std::string getClass();
/*! \brief Set
*/
void setClass(std::string _class);
/*! \brief Get
*/
std::string getDescription();
/*! \brief Set
*/
void setDescription(std::string description);
/*! \brief Get
*/
std::list<FreeStyleProject> getJobs();
/*! \brief Set
*/
void setJobs(std::list <FreeStyleProject> jobs);
/*! \brief Get
*/
std::string getName();
/*! \brief Set
*/
void setName(std::string name);
/*! \brief Get
*/
std::string getUrl();
/*! \brief Set
*/
void setUrl(std::string url);
private:
std::string _class;
std::string description;
std::list <FreeStyleProject>jobs;
std::string name;
std::string url;
void __init();
void __cleanup();
};
}
}
#endif /* _ListView_H_ */
|
class GameEngine {
private:
int random_hit;
int damage;
int rTurn;
bool rollOn;
int whoWin;
int winner;
public:
int doDamage(int accuracy);
int battle(int playeraccu, int cpuaccu);
int placeBets();
int checkBets();
}; |
#pragma once
/*
Various utility functions
Copyright (c) 2016 Roman Miroshnychenko <romanvm@yandex.ua>
License: MIT, see License.txt
*/
#include "constants.h"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <boost/algorithm/string.hpp>
#include <boost/regex.hpp>
#include <string>
#include <sstream>
#include <ctime>
#include <iomanip>
#include <cctype>
#include <iostream>
namespace wsgi_boost
{
#pragma region functions
// Converts POSIX time to HTTP header format
inline std::string time_to_header(time_t posix_time)
{
char buffer[40];
std::locale::global(std::locale("C"));
std::strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S GMT", std::gmtime(&posix_time));
return std::string{ buffer };
}
// Parses HTTP "time" headers to POSIX time
inline time_t header_to_time(const std::string& time_string)
{
tm t;
#ifdef _WIN32
std::istringstream ss{ time_string };
ss.imbue(std::locale("C"));
ss >> std::get_time(&t, "%a, %d %b %Y %H:%M:%S GMT");
if (ss.fail())
return std::time(nullptr); // Return current time on a malformed date/time string
return _mkgmtime(&t);
#else
std::locale::global(std::locale("C"));
char* res = strptime(time_string.c_str(), "%a, %d %b %Y %H:%M:%S GMT", &t);
if (!res)
return std::time(nullptr);
return timegm(&t);
#endif
}
// Get current GMT time in HTTP header format
inline std::string get_current_gmt_time()
{
return time_to_header(std::time(nullptr));
}
// Splits a full path into a path proper and a query string
inline std::pair<std::string, std::string> split_path(const std::string& path)
{
size_t pos = path.find("?");
if (pos != std::string::npos)
return std::pair<std::string, std::string>{ path.substr(0, pos), path.substr(pos + 1) };
return std::pair<std::string, std::string>{ path, "" };
}
// Transform a HTTP header to WSGI environ format HTTP_
inline void transform_header(std::string& header)
{
for (auto& ch : header)
{
ch = std::toupper(ch);
if (ch == '-')
ch = '_';
}
header = "HTTP_" + header;
}
// Parse Range header
inline std::pair<std::string, std::string> parse_range(std::string& requested_range)
{
std::pair<std::string, std::string> range;
boost::regex range_regex{ "^bytes=(\\d*)-(\\d*)$" };
boost::smatch range_match;
boost::regex_search(requested_range, range_match, range_regex);
if (!range_match.empty())
{
if (range_match[1].first != requested_range.end())
range.first = std::string{ range_match[1].first, range_match[1].second };
if (range_match[2].first != requested_range.end())
range.second = std::string{ range_match[2].first, range_match[2].second };
}
return range;
}
// Get hexadecimal representation of an unisigned int number
inline std::string hex(size_t u_int)
{
if (u_int == 0)
return "0";
std::string hex_repr;
while (u_int > 0)
{
hex_repr = std::string(1, hex_chars[u_int % 16]) + hex_repr;
u_int /= 16;
}
return hex_repr;
}
// Check if a file can be compressed by gzip
inline bool is_compressable(const std::string& ext)
{
return std::find(compressables.begin(), compressables.end(), boost::to_lower_copy(ext)) != compressables.end();
}
// Determine mime type by file extension
inline std::string get_mime(const std::string& ext)
{
auto it = mime_types.find(boost::to_lower_copy(ext));
if (it == mime_types.end())
return "application/octet-stream";
return it->second;
}
#pragma endregion
#pragma region classes
// RAII implementation for auto-closing an iteraterable object passed from a WSGI application
class Iterable
{
public:
explicit Iterable(pybind11::object it) : m_iterable{ it } {}
~Iterable()
{
if (pybind11::hasattr(m_iterable, "close"))
m_iterable.attr("close")();
}
pybind11::object attr(const std::string& at) const
{
return m_iterable.attr(at.c_str());
}
private:
pybind11::object m_iterable;
};
// wsgi.errors stream implementation
struct ErrorStream
{
void write(std::string& msg) { std::cerr << msg; }
void writelines(std::vector<std::string>& lines)
{
for (const auto& line : lines)
std::cerr << line;
}
void flush() { std::cerr.flush(); }
};
// wsgi.file_wrapper implementation
class FileWrapper
{
private:
pybind11::object m_file;
int m_block_size;
public:
FileWrapper() : m_file{ pybind11::none() } {}
FileWrapper* call(pybind11::object file, int block_size = 8192)
{
m_file = file;
m_block_size = block_size;
return this;
}
pybind11::bytes read(int size = -1)
{
if (size == -1)
size = m_block_size;
return m_file.attr("read")(size);
}
FileWrapper* iter() { return this; }
pybind11::bytes next()
{
pybind11::bytes chunk = read();
if ((std::string{ chunk }).empty())
throw pybind11::stop_iteration();
return chunk;
}
void close()
{
if (pybind11::hasattr(m_file, "close"))
m_file.attr("close")();
}
};
}
#pragma endregion
|
/****************************************************************************
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CCRENDERCOMMAND_H_
#define __CCRENDERCOMMAND_H_
#include "base/CCPlatformMacros.h"
#include <stdint.h>
#include "2d/ccTypes.h"
NS_CC_BEGIN
/** Base class of the `RenderCommand` hierarchy.
*
The `Renderer` knows how to render `RenderCommands` objects.
*/
class RenderCommand
{
public:
enum class Type
{
UNKNOWN_COMMAND,
QUAD_COMMAND,
CUSTOM_COMMAND,
BATCH_COMMAND,
GROUP_COMMAND,
};
/** Get Render Command Id */
inline float getGlobalOrder() const { return _globalOrder; }
/** Returns the Command type */
inline Type getType() const { return _type; }
protected:
RenderCommand();
virtual ~RenderCommand();
void printID();
// Type used in order to avoid dynamic cast, faster
Type _type;
// commands are sort by depth
float _globalOrder;
};
NS_CC_END
#endif //__CCRENDERCOMMAND_H_
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UIView.h"
@class NSString, UIImage;
@interface PLCameraFlashLabelView : UIView
{
NSString *_text;
UIImage *_image;
_Bool _labelIsVisible;
struct CGImage *_labelVisibleContents;
struct CGImage *_labelHiddenContents;
struct CGSize _contentsSize;
double backgroundAlpha;
}
@property(nonatomic) double backgroundAlpha; // @synthesize backgroundAlpha;
- (_Bool)_shouldAnimatePropertyWithKey:(id)arg1;
- (void)updateLabelContents;
- (struct CGImage *)_newLabelImage:(_Bool)arg1;
- (void)sizeToFit;
@property(nonatomic) struct CGSize contentsSize;
@property(nonatomic) _Bool labelIsVisible;
@property(retain, nonatomic) UIImage *image;
@property(retain, nonatomic) NSString *text;
- (void)_reloadLabelContents;
- (void)dealloc;
- (id)initWithFrame:(struct CGRect)arg1;
@end
|
//
// ViewController.h
// HZCountDownBtn
//
// Created by 邢现庆 on 16/1/11.
// Copyright © 2016年 XianQing Xing. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
/**
* Connected Vision - https://github.com/ConnectedVision
* MIT License
*/
// auto-generated header by CodeFromTemplate - Connected Vision - https://github.com/ConnectedVision
// CodeFromTemplate Version: 0.3 alpha
// OutputPin_SyntheticVideo_output_VideoMetadata.h
// This file implements the IStore interface for REST access.
// It is generated once and will NOT be OVERWRITTEN by CodeFromTemplate.
#ifndef OutputPin_SyntheticVideo_output_VideoMetadata_def
#define OutputPin_SyntheticVideo_output_VideoMetadata_def
#include "stubs/OutputPin_Stub_SyntheticVideo_output_VideoMetadata.h"
namespace ConnectedVision {
namespace Module {
namespace SyntheticVideo {
// if you want to extend the auto-generated class, enable the line below
//#define OutputPin_SyntheticVideo_output_VideoMetadata_extended
#ifdef OutputPin_SyntheticVideo_output_VideoMetadata_extended
/**
* SyntheticVideo_output_VideoMetadata
*
* module: SyntheticVideo
* description: synthetic video meta data
*/
class OutputPin_SyntheticVideo_output_VideoMetadata : public OutputPin_Stub_SyntheticVideo_output_VideoMetadata {
public:
OutputPin_SyntheticVideo_output_VideoMetadata(boost::shared_ptr< Store::IStoreCV< boost::shared_ptr<Class_SyntheticVideo_output_VideoMetadata> > > dataStore) :
OutputPin_Stub_SyntheticVideo_output_VideoMetadata(dataStore) {};
virtual ~OutputPin_SyntheticVideo_output_VideoMetadata() {}
};
#endif // OutputPin_SyntheticVideo_output_VideoMetadata_extended
} // namespace SyntheticVideo
} // namespace Module
} // namespace ConnectedVision
#include "stubs/OutputPin_SyntheticVideo_output_VideoMetadata_Default.h"
#endif // OutputPin_SyntheticVideo_output_VideoMetadata_def |
// -*- C++ -*-
// $Id: ACE_export.h 74299 2006-08-28 23:13:14Z ossama $
// Definition for Win32 Export directives.
// This file is generated automatically by
// generate_export_file.pl
// ------------------------------
#ifndef ACE_EXPORT_H
#define ACE_EXPORT_H
#include "ace/config-lite.h"
#if defined (ACE_AS_STATIC_LIBS)
# if !defined (ACE_HAS_DLL)
# define ACE_HAS_DLL 0
# endif /* ! ACE_HAS_DLL */
#else
# if !defined (ACE_HAS_DLL)
# define ACE_HAS_DLL 1
# endif /* ! ACE_HAS_DLL */
#endif /* ACE_AS_STATIC_LIB */
#if defined (ACE_HAS_DLL)
# if (ACE_HAS_DLL == 1)
# if defined (ACE_BUILD_DLL)
# define ACE_Export ACE_Proper_Export_Flag
# define ACE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
# define ACE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
# else
# define ACE_Export ACE_Proper_Import_Flag
# define ACE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
# define ACE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
# endif /* ACE_BUILD_DLL */
# else
# define ACE_Export
# define ACE_SINGLETON_DECLARATION(T)
# define ACE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
# endif /* ! ACE_HAS_DLL == 1 */
#else
# define ACE_Export
# define ACE_SINGLETON_DECLARATION(T)
# define ACE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
#endif /* ACE_HAS_DLL */
// Added by hand to help with ACE_OS namespace
#if defined (__TANDEM) && defined (USE_EXPLICIT_EXPORT)
#define ACE_NAMESPACE_STORAGE_CLASS ACE_EXPORT_MACRO extern
#else
#define ACE_NAMESPACE_STORAGE_CLASS extern ACE_EXPORT_MACRO
#endif
#if defined (__ACE_INLINE__)
# if defined (_MSC_VER) || defined (__MINGW32__) || defined (CYGWIN32) || \
(defined (__SUNPRO_CC) && __SUNPRO_CC >= 0x560) || \
(defined (__HP_aCC) && (__HP_aCC >= 60500)) || \
(defined (__sgi) && \
defined (_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
# define ACE_NAMESPACE_INLINE_FUNCTION inline
# else
# define ACE_NAMESPACE_INLINE_FUNCTION ACE_NAMESPACE_STORAGE_CLASS inline
# endif
# define ACE_INLINE_TEMPLATE_FUNCTION inline
#else
# define ACE_NAMESPACE_INLINE_FUNCTION ACE_NAMESPACE_STORAGE_CLASS
// Microsoft Visual C++ will accept 'extern'; others refuse.
# if defined (_MSC_VER) || defined (__BORLANDC__)
# define ACE_INLINE_TEMPLATE_FUNCTION ACE_Export
# else
# define ACE_INLINE_TEMPLATE_FUNCTION
# endif
#endif
#endif /* ACE_EXPORT_H */
// End of auto generated file.
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "WXPBGeneratedMessage.h"
@class NSString;
@interface EmotionBannerImg : WXPBGeneratedMessage
{
}
+ (void)initialize;
// Remaining properties
@property(nonatomic) unsigned int height; // @dynamic height;
@property(retain, nonatomic) NSString *imgUrl; // @dynamic imgUrl;
@property(retain, nonatomic) NSString *stripUrl; // @dynamic stripUrl;
@property(nonatomic) unsigned int width; // @dynamic width;
@end
|
/*
* kaddr.h, part of "knet" project.
*
* Created on: 20.05.2015, 01:15
* Author: Vsevolod Lutovinov <klopp@yandex.ru>
*/
#ifndef KADDR_H_
#define KADDR_H_
#include "../klib/plist.h"
#define A_EMAIL( pair ) (pair)->second
#define A_NAME( pair ) (pair)->first
Pair addr_Create( const char * src );
#endif /* KADDR_H_ */
|
#ifndef _XML_RPC_SERVER
#define _XML_RPC_SERVER
#include <iostream>
#include <cstdlib>
#include <string>
#include <boost/bind.hpp>
#include <xmlrpc_server/xmlrpc_server.hpp>
#include <xmlrpc_server/xmlrpc_utility.hpp>
#include <http_server/http_server.hpp>
#include <http_server/http_request_dispatcher.hpp>
#include <http_server/notify_request_handler.hpp>
class SensorFactory;
class RPCSvr
{
public:
RPCSvr(SensorFactory*, const int&);
~RPCSvr();
// RPC function
void GetSensorStatus(const FBi::XMLRPC_Value_List& calldata, FBi::MethodResponse& resp);
void SetSensorStatus(const FBi::XMLRPC_Value_List& calldata, FBi::MethodResponse& resp);
void callback1(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void callback2(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void TestInt(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void TestBool(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void TestString(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void TestDouble(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void TestStruct(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void TestTwoParams(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void UnPublicIntrospectionFunc(const FBi::XMLRPC_Value_List& /*vector*/, FBi::MethodResponse& resp);
void TestArray(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void StopServer(const FBi::XMLRPC_Value_List& /*vector*/, FBi::MethodResponse& resp);
void TestThrowFault(const FBi::XMLRPC_Value_List& /*vector*/, FBi::MethodResponse& resp);
void TestEmptyStruct(const FBi::XMLRPC_Value_List& /*vector*/, FBi::MethodResponse& resp);
void TestEmptydArray(const FBi::XMLRPC_Value_List& /*vector*/, FBi::MethodResponse& resp);
void TestComplicatedStruct(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void TestComplicatedArray(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void TestAddValue(const FBi::XMLRPC_Value_List& /*vector*/, FBi::MethodResponse& resp);
void TestXMLRPCDateTime(const FBi::XMLRPC_Value_List& vector, FBi::MethodResponse& resp);
void TestGetConnectionInfo(const FBi::XMLRPC_Value_List& /*vector*/, FBi::MethodResponse& resp, const FBi::HttpConnectionInfo& info);
private:
FBi::XMLRPC_Server* server_;
int rpc_port_;
SensorFactory* sensor_factory_; // weak reference
};
#endif // _XML_RPC_SERVER |
#import <UIKit/UIKit.h>
#import "IIViewDeckController.h"
@interface InitialViewController : IIViewDeckController
@end
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@interface XCiPhoneOSPlatformPlugin : NSObject
{
}
+ (void)validate:(id)arg1 withMacroExpansionScope:(id)arg2;
@end
|
//
// GJAssetsPickerViewControllerDelegate.h
// GJAssetsPickerViewController
//
// Created by ZYVincent on 14-9-8.
// Copyright (c) 2014年 ZYProSoft. All rights reserved.
//
#import "GJCFAssetsPickerStyle.h"
#import "GJCFAssetsPickerConstans.h"
@class GJCFAssetsPickerViewController;
/* GJAssetsPickerViewController 可响应的一些代理方法 */
@protocol GJCFAssetsPickerViewControllerDelegate <NSObject>
/* It is recommended to enforce these proxy methods to monitor abnormal behavior in order to avoid forgetting to implement the agent, and feel the picture can not continue to click on the selected confusion */
@required
/*
* Executes when the image selection view reaches the limit of multiple selections
*
* @prama limitCount Returns the maximum number of multi-select quantities
*/
- (void)pickerViewController:(GJCFAssetsPickerViewController*)pickerViewController didReachLimitSelectedCount:(NSInteger)limitCount;
/*
* When the picture selection wants to preview but not selected when the implementation of the picture
*
*/
- (void)pickerViewControllerRequirePreviewButNoSelectedImage:(GJCFAssetsPickerViewController*)pickerViewController;
/*
* Executed when the image selection has no access authorization
*
*/
- (void)pickerViewControllerPhotoLibraryAccessDidNotAuthorized:(GJCFAssetsPickerViewController*)pickerViewController;
@optional
/*
* Picture selection view need to pickerStyle through the definition of some UI when you can call this agent to achieve, otherwise all call [GJAssetsPickerStyle defaultStyle]
*
*/
- (GJCFAssetsPickerStyle*)pickerViewShouldUseCustomStyle:(GJCFAssetsPickerViewController*)pickerViewController;
/*
* When the picture selection view will disappear when the implementation
*/
- (void)pickerViewControllerWillCancel:(GJCFAssetsPickerViewController*)pickerViewController;
/*
* When the image selection is completed after the implementation of this proxy method, the selected picture back to the caller
*
* @param resultArray Returns the selected image content as an array of GJAsset objects
*/
- (void)pickerViewController:(GJCFAssetsPickerViewController*)pickerViewController didFinishChooseMedia:(NSArray *)resultArray;
/*
* Execute this method when an image selection error occurs
*
* @param errorMsg occurred error message content errorType occurred in the wrong type
*/
- (void)pickerViewController:(GJCFAssetsPickerViewController*)pickerViewController didFaildWithErrorMsg:(NSString*)errorMsg withErrorType:(GJAssetsPickerErrorType)errorType;
@end
|
#ifndef __WN8OS_FS_H__
#define __WN8OS_FS_H__
#include "fs_definition.h"
s8 * read_sector(u64 sector_id);
void write_sector(s8 *buffer);
void read_sector_by_address(u64 address, u8 *dist, u64 size);
s32 initialize_fs();
WN8FileSystem * fsInstance = NULL;
u64 * fsInodeBitmap = NULL;
u64 * fsBlockBitmap = NULL;
u64 fsInodeBitmapLen = 0;
u64 fsBlockBitmapLen = 0;
#endif
|
//
// CoordinatedTime.h
// CoordinatedTime
//
// Created by Andrey Toropchin on 11.11.15.
// Copyright © 2015 aipmedia. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
`CoordinatedTime` is a class for coordinating device local time with servers's time.
All dates that are visible to user should be "device coordinated" dates (`dateForDevice`).
All dates that are sent to server should be "server coordinated" dates (`dateForServer`).
*/
@interface CoordinatedTime : NSObject
/** Calculates and saves time difference between device and server */
+ (void)coordinateDeviceTime:(NSDate*)deviceDate withServerTime:(NSDate*)serverDate;
/** Convinience method to calculate and save time difference between device and server's response */
+ (void)coordinateDeviceTime:(NSDate*)deviceDate withServerResponse:(NSHTTPURLResponse*)response;
/** Initializer with device origin date */
- (instancetype)initWithDeviceTime:(NSDate*)date;
/** Initializer with server origin date */
- (instancetype)initWithServerTime:(NSDate*)date;
/** Date to be used on device (UI) */
- (NSDate*)dateForDevice;
/** Date to be used on server (requests) */
- (NSDate*)dateForServer;
@end
|
/* Example of a C submodule for Tarantool */
#include <tarantool/module.h>
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
/* internal function */
static int
{{__name__}}_func(struct lua_State *L)
{
if (lua_gettop(L) < 2)
luaL_error(L, "Usage: {{__name__}}_func(a: number, b: number)");
int a = lua_tointeger(L, 1);
int b = lua_tointeger(L, 2);
lua_pushinteger(L, a + b);
return 1; /* one return value */
}
/* exported function */
LUA_API int
luaopen_{{__name__}}_lib(lua_State *L)
{
/* result returned from require('{{__name__}}.lib') */
lua_newtable(L);
static const struct luaL_Reg meta [] = {
{"func", {{__name__}}_func},
{NULL, NULL}
};
luaL_register(L, NULL, meta);
return 1;
}
/* vim: syntax=c ts=8 sts=8 sw=8 noet */
|
/*
* @file
* @brief
*
* @date 11.01.13
* @author Anton Bondarev
* @author Ilia Vaprol
*/
#ifndef LOCALE_H_
#define LOCALE_H_
#include <genos/defines/null.h>
#include <genos/defines/size_t.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
/* These are the possibilities for the first argument to setlocale.
The code assumes that the lowest LC_* symbol has the value zero. */
#define LC_CTYPE 0
#define LC_NUMERIC 1
#define LC_TIME 2
#define LC_COLLATE 3
#define LC_MONETARY 4
#define LC_MESSAGES 5
#define LC_ALL 6
#define LC_PAPER 7
#define LC_NAME 8
#define LC_ADDRESS 9
#define LC_TELEPHONE 10
#define LC_MEASUREMENT 11
#define LC_IDENTIFICATION 12
static inline char * setlocale(int category, const char *locale) {
(void)category; (void)locale;
return NULL;
}
__END_DECLS
#endif /* LOCALE_H_ */
|
//
// RYImage.h
// Ryuk
//
// Created by RongqingWang on 2017/4/26.
// Copyright © 2017年 RyukieSama. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface RYImage : NSObject
@property (nonatomic, copy) NSString *thumbnail_pic; //thumbnail
@property (nonatomic, copy) NSString *original_pic; //large
@property (nonatomic, copy) NSString *bmiddle_pic; //bmiddle
@end
|
#ifndef BOOTHSERVER_H
#define BOOTHSERVER_H
#include <QObject>
#include <QVector>
#include <QHash>
#include <QTimer>
class Booth;
class Packet;
class QIODevice;
class ServiceCategory;
class BoothServer : public QObject
{
Q_OBJECT
public:
explicit BoothServer(QIODevice *ioDev, QObject *parent = 0);
~BoothServer();
private:
QIODevice *ioDev;
bool isWaiting;
int curBoothNum;
QVector<Booth*> availBooths;
QTimer waitTimer;
Booth* currentBooth();
void incrementCurrentBooth();
void pingNextBooth();
void pingCurrentBooth();
void sendPacket(Packet packet);
void processIncomingData(QByteArray data);
signals:
public slots:
void onDeviceTimeout();
void onReadyRead();
};
#endif // BOOTHSERVER_H
|
// MIT License
//
// Copyright (c) 2017-2018 Artur Wyszyński, aljen at hitomi dot pl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#ifndef SPAGHETTI_ELEMENTS_VALUES_CLAMP_FLOAT_H
#define SPAGHETTI_ELEMENTS_VALUES_CLAMP_FLOAT_H
#include <spaghetti/element.h>
namespace spaghetti::elements::values {
class ClampFloat final : public Element {
public:
static constexpr char const *const TYPE{ "values/clamp_float" };
static constexpr string::hash_t const HASH{ string::hash(TYPE) };
ClampFloat();
char const *type() const noexcept override { return TYPE; }
string::hash_t hash() const noexcept override { return HASH; }
void calculate() override;
};
} // namespace spaghetti::elements::values
#endif // SPAGHETTI_ELEMENTS_VALUES_CLAMP_FLOAT_H
|
#ifndef N_CLIPPINGCAMERANODE_H
#define N_CLIPPINGCAMERANODE_H
//------------------------------------------------------------------------------
/**
@class nClippingCameraNode
@ingroup Camera
@brief Extends nCameraNode. Special camera, which computes a clipping
plane in the Projectionmatrix.
author: matthias
(C) 2004 RadonLabs GmbH
*/
#include "scene/nabstractcameranode.h"
//------------------------------------------------------------------------------
class nClippingCameraNode : public nAbstractCameraNode
{
public:
/// constructor
nClippingCameraNode();
/// destructor
virtual ~nClippingCameraNode();
/// function witch updates the camera
virtual bool RenderCamera(const matrix44& modelWorldMatrix, const matrix44& viewMatrix, const matrix44& projectionMatrix);
protected:
/// compute a reflection projection matrix with clipping
matrix44 ComputeProjectionMatrix(const matrix44& viewMatrix, const matrix44& projectionMatrix, const vector3& clipPlaneNormal, const vector3& clipPlanePoint);
private:
/// help function
float sgn(float a);
};
//------------------------------------------------------------------------------
#endif
|
/*
* Generated by class-dump 3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard.
*/
#import "Assistant.h"
#import "MFLibraryUpgraderDelegate.h"
#import "NSOpenSavePanelDelegate.h"
@class MFLibraryUpgrader, NSButton, NSTextField, NSView;
@interface LibraryUpgradeAssistant : Assistant <MFLibraryUpgraderDelegate, NSOpenSavePanelDelegate>
{
MFLibraryUpgrader *_libraryUpgrader;
NSView *_currentView;
int _state;
BOOL _accountsRequireStoragePolicyChange;
NSView *_accountsRequireCachePolicyChangeView;
NSView *_unresolvedAccountsView;
NSView *_complexMigrationView;
NSView *_patienceView;
NSView *_epilogueView;
NSView *_errorView;
NSButton *_showNewFeaturesButton;
NSTextField *_migrationDestinationTextField;
NSTextField *_errorText;
}
@property(nonatomic) BOOL accountsRequireStoragePolicyChange; // @synthesize accountsRequireStoragePolicyChange=_accountsRequireStoragePolicyChange;
@property(nonatomic) NSTextField *errorText; // @synthesize errorText=_errorText;
@property(nonatomic) NSTextField *migrationDestinationTextField; // @synthesize migrationDestinationTextField=_migrationDestinationTextField;
@property(nonatomic) NSButton *showNewFeaturesButton; // @synthesize showNewFeaturesButton=_showNewFeaturesButton;
@property(retain, nonatomic) NSView *errorView; // @synthesize errorView=_errorView;
@property(retain, nonatomic) NSView *epilogueView; // @synthesize epilogueView=_epilogueView;
@property(retain, nonatomic) NSView *patienceView; // @synthesize patienceView=_patienceView;
@property(retain, nonatomic) NSView *complexMigrationView; // @synthesize complexMigrationView=_complexMigrationView;
@property(retain, nonatomic) NSView *unresolvedAccountsView; // @synthesize unresolvedAccountsView=_unresolvedAccountsView;
@property(retain, nonatomic) NSView *accountsRequireCachePolicyChangeView; // @synthesize accountsRequireCachePolicyChangeView=_accountsRequireCachePolicyChangeView;
- (void)chooseMigrationDestination:(id)arg1;
- (BOOL)panel:(id)arg1 validateURL:(id)arg2 error:(id *)arg3;
- (void)showNewFeatures:(id)arg1;
- (void)upgrader:(id)arg1 didFailWithError:(id)arg2;
- (void)upgraderDidFinish:(id)arg1;
- (void)requestUserAttentionWithRequestType:(unsigned long long)arg1;
- (void)goForward;
- (void)stop;
- (void)start;
- (void)setCurrentView:(id)arg1;
- (id)currentView;
- (void)setState:(int)arg1;
- (int)state;
- (id)windowTitle;
- (void)setLibraryUpgrader:(id)arg1;
- (id)libraryUpgrader;
- (void)dealloc;
- (id)initWithAssistentManager:(id)arg1;
@end
|
#ifndef __INDEXEDFACESET_H3D
#define __INDEXEDFACESET_H3D
//-------------------------------------------------------------------------
// Copyright (c) 1997-1998 Great Hill Corporation
// All Rights Reserved.
//-------------------------------------------------------------------------
// WARNING: THIS FILE WAS CREATED AUTOMATICALLY
//-------------------------------------------------------------------------
#include "DataSet.h"
/*----------------------------------------------------------------------
CLASS
vrIndexedFaceSet
This class corresponds to the IndexedFaceSet node in VRML.
<A href="../spec/part1/nodesRef.html#IndexedFaceSet">Further information</a>
about this class is available in any VRML related documentation.
DESCRIPTION
<ul>This node corresponds to the IndexedFaceSet node as defined in the VRML97
specification. Like all Node Classes this class is better described in the
<A href="../spec/index.html">VRML97 Specification</a>. In particular, at this
<A href="../spec/part1/nodesRef.html#IndexedFaceSet">link</a>.</ul>
NOTES
<ul>
<li>All node classes share certain aspects which are described <a href="../nodespec.htm">here</a>.</li>
</ul>
EXAMPLE CODE
<pre>
// None.
</pre>
MEMBERS
----------------------------------------------------------------------*/
class LIBInterface vrIndexedFaceSet : public vrDataSet
{
protected:
public:
//<doc>------------------------------------------------------------
// <dd>Default constructor.
//
vrIndexedFaceSet(void);
//<doc>------------------------------------------------------------
// <dd>Copy constructor.
//
vrIndexedFaceSet(const vrIndexedFaceSet& v);
//<doc>------------------------------------------------------------
// <dd>Destructor.
//
virtual ~vrIndexedFaceSet(void);
//<doc>------------------------------------------------------------
// <dd>Equals operator.
//
vrIndexedFaceSet& operator=(const vrIndexedFaceSet& v);
//<doc>------------------------------------------------------------
// <dd>Returns an exact copy of the given node.
//
virtual SFNode Clone(void) const;
//<nodoc>------------------------------------------------------------
// <dd>Set the value of a field given the field's name and a value.
// <dd>Note: Error checking is done on 'fieldName' but cannot be done on 'val',
// <dd> so make sure you send the correct type of data to this method.
//
// [in] fieldName: The name of the field to set (as specified in the VRML97 specification).
// [in] val: Void pointer to a field of the type corresponding to fieldName.
//
virtual SFBool SetFieldValue(const SFString& fieldName, void *val);
//<doc>------------------------------------------------------------
// <dd>Respond to a traversal by an arbitrary traverser. Note: Normally, nodes just call t->Traverse(this)
// <dd>to have the traverser handle the traversal. you may override this method in your derived class to
// <dd>handle traversals of node types.
//
// [in] trav: The vrTraverser requesting the traversal.
//
virtual void Traverse(vrTraverser *trav) const;
//<doc>------------------------------------------------------------
// <dd>Returns TRUE if the node (or a particular field) is in it's default state.
//
// [in] fieldName: The field to check for default value. NULL implies check all fields of this node.
// [out] field: If non-NULL the value of the field will be returned in field.
//
virtual SFBool IsDefault(const SFString& fieldName=nullString, vrField *field=NULL) const;
//<doc>------------------------------------------------------------
// <dd>Declare that this node may be runtime typed and dynamically created. [ DECLARE_NODE ]
//
DECLARE_NODE(vrIndexedFaceSet);
//------------------------------------------------------------
// hand coded functions
virtual void BuildMesh(void);
virtual void BuildColors(void);
virtual void BuildNormals(void);
virtual void BuildTexCoords(void);
vrTraverser *tempHack;
};
//----------------------------------------------------------------------
inline void vrIndexedFaceSet::Traverse(vrTraverser *t) const
{
t->Traverse(this);
}
#endif
|
//
// This source file is part of appleseed.
// Visit http://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited
// Copyright (c) 2014-2016 Francois Beaune, The appleseedhq Organization
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#ifndef APPLESEED_RENDERER_KERNEL_SHADING_SHADINGRESULT_H
#define APPLESEED_RENDERER_KERNEL_SHADING_SHADINGRESULT_H
// appleseed.renderer headers.
#include "renderer/global/globaltypes.h"
#include "renderer/kernel/aov/shadingfragmentstack.h"
#include "renderer/kernel/shading/shadingfragment.h"
#include "renderer/modeling/entity/entity.h"
// appleseed.foundation headers.
#include "foundation/core/concepts/noncopyable.h"
#include "foundation/image/color.h"
#include "foundation/image/colorspace.h"
namespace renderer
{
//
// Shading result.
//
class ShadingResult
: public foundation::NonCopyable
{
public:
// Public members.
foundation::ColorSpace m_color_space;
ShadingFragment m_main;
ShadingFragmentStack m_aovs;
double m_depth;
// Constructor.
explicit ShadingResult(const size_t aov_count = 0);
// Return true if this shading result contains valid linear RGB values;
// false if the color, alpha or any AOV contain NaN or negative values.
bool is_valid_linear_rgb() const;
// Set the main color to a given linear RGB value. Leaves the alpha channel intact.
void set_main_to_linear_rgb(const foundation::Color3f& linear_rgb);
// Set the main color and alpha channel to a given linear RGBA value.
void set_main_to_linear_rgba(const foundation::Color4f& linear_rgba);
// Set the main color and alpha channel to transparent black in linear RGB.
void set_main_to_transparent_black_linear_rgba();
// Set the main color and alpha channel to opaque pink in linear RGB (useful for debugging).
void set_main_to_opaque_pink_linear_rgba();
// Set all AOV colors and alpha channels to transparent black in linear RGB.
void set_aovs_to_transparent_black_linear_rgba();
// Copy the main output to the AOV of a given entity.
void set_entity_aov(const Entity& entity);
// Store a shading fragment to the AOV of a given entity.
void set_entity_aov(
const Entity& entity,
const ShadingFragment& fragment);
// Transform main and AOV colors to the linear RGB color space.
void transform_to_linear_rgb(const foundation::LightingConditions& lighting);
// Composite this shading result over 'background'.
// Both shading results must be expressed in linear RGB.
void composite_over_linear_rgb(const ShadingResult& background);
// Multiply main and AOV colors by their respective alpha channels.
void apply_alpha_premult_linear_rgb();
private:
// Set all values to NaN.
void poison();
};
//
// ShadingResult class implementation.
//
inline ShadingResult::ShadingResult(const size_t aov_count)
: m_aovs(aov_count)
{
#ifdef DEBUG
poison();
#endif
}
inline void ShadingResult::set_main_to_linear_rgb(const foundation::Color3f& linear_rgb)
{
m_color_space = foundation::ColorSpaceLinearRGB;
m_main.m_color[0] = linear_rgb[0];
m_main.m_color[1] = linear_rgb[1];
m_main.m_color[2] = linear_rgb[2];
}
inline void ShadingResult::set_main_to_linear_rgba(const foundation::Color4f& linear_rgba)
{
set_main_to_linear_rgb(linear_rgba.rgb());
m_main.m_alpha.set(linear_rgba[3]);
}
inline void ShadingResult::set_main_to_transparent_black_linear_rgba()
{
set_main_to_linear_rgba(foundation::Color4f(0.0f));
}
inline void ShadingResult::set_main_to_opaque_pink_linear_rgba()
{
set_main_to_linear_rgba(foundation::Color4f(1.0f, 0.0f, 1.0f, 1.0f));
}
inline void ShadingResult::set_entity_aov(const Entity& entity)
{
m_aovs.set(entity.get_render_layer_index(), m_main);
}
inline void ShadingResult::set_entity_aov(
const Entity& entity,
const ShadingFragment& fragment)
{
m_aovs.set(entity.get_render_layer_index(), fragment);
}
} // namespace renderer
#endif // !APPLESEED_RENDERER_KERNEL_SHADING_SHADINGRESULT_H
|
#ifndef TZW_MAINMENU_H
#define TZW_MAINMENU_H
#include "2D/GUISystem.h"
#include "Game/DebugInfoPanel.h"
#include "Event/Event.h"
#include "Engine/EngineDef.h"
#include "GameNodeEditor.h"
#include "2D/Sprite.h"
#include "2D/GUIFileBrowser.h"
#include "2D/LabelNew.h"
#include "Utility/file/Data.h"
#include "OptionPanel.h"
namespace tzw {
class PainterUI;
class VehicleBroswer;
class NewWorldSettingUI;
class LoadWorldUI;
enum class WindowType
{
INVENTORY,
NODE_EDITOR,
VEHICLE_FILE_BROWSER,
RESUME_MENU,
HELP_PAGE,
ATTRIBUTE_WINDOW,
PAINTER,
MainMenu,
OPTION_MENU,
QUICK_DEBUG,
WORLD_SETTING,
PLAYER_INFO,
ABOUT,
Console,
NEW_WORLD_SETTING,
LOAD_WORLD,
};
class GameUISystem : public Singleton<GameUISystem>, public IMGUIObject, public EventListener
{
public:
GameUISystem();
void init();
void show();
void hide();
void toggle();
void drawIMGUI() override;
bool onKeyPress(int keyCode) override;
bool isVisible() const;
void setVisible(bool val);
void initInGame();
void openNodeEditor(GamePart * part);
void setIsShowNodeEditor(bool isShow);
void setIsShowAssetEditor(bool isShow);
void popFloatTips(std::string floatString);
void closeAllOpenedWindow();
bool isNeedShowWindow();
bool isAnyShow();
void setIsFileBroswerOpen(bool isOpen);
bool isOpenAssetEditor() const;
void closeCurrentWindow();
void setWindowShow(WindowType type, bool isShow);
bool getWindowIsShow(WindowType type) const;
void openInspectWindow(GamePart * part);
void setPainterShow(bool isShow);
void drawEntryInterFace();
void openMainMenu();
void setIsNeedShowCrossHair(bool isNeedShow);
private:
bool m_isVisible = true;
void drawToolsMenu();
void ShowExampleAppLog(bool* p_open);
void ShowExampleAppConsole(bool* p_open);
void drawInventory();
bool m_isShowProfiler;
bool m_isShowConsole;
bool m_isOpenTerrain;
bool m_isOpenRenderEditor;
bool m_preIsNeedShow;
bool m_isOpenPlayerOverLay;
bool m_isNeedShowCrossHair {true};
DebugInfoPanel m_debugInfoPanel;
VehicleBroswer * m_fileBrowser;
NewWorldSettingUI * m_NewWorldSettingUI;
LoadWorldUI * m_loadWorldUI;
PainterUI * m_painterUI;
Sprite * m_crossHair;
LabelNew * m_crossHairTipsInfo;
GamePart * m_curInspectPart;
Data m_helperData;
OptionPanel m_option;
GamePart* m_currControlPart;
public:
LabelNew* getCrossHairTipsInfo() const;
};
} // namespace tzw
#endif // TZW_MAINMENU_H
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#pragma mark Named Structures
struct CTServerState;
struct __CTServerConnection {
struct __CFRuntimeBase {
unsigned long long _field1;
unsigned char _field2[4];
unsigned int _field3;
} _field1;
struct dispatch_queue_s *_field2;
struct CTServerState *_field3;
unsigned char _field4;
unsigned int _field5;
struct _xpc_connection_s *_field6;
};
struct block<void (^)(NSDictionary *)>;
struct dispatch_object_s;
struct dispatch_queue_s;
struct queue {
struct dispatch_object_s *fObj;
};
struct vector<dispatch::block<void (^)(NSDictionary *)>, std::__1::allocator<dispatch::block<void (^)(NSDictionary *)>>> {
struct block<void (^)(NSDictionary *)> *__begin_;
struct block<void (^)(NSDictionary *)> *__end_;
struct __compressed_pair<dispatch::block<void (^)(NSDictionary *)>*, std::__1::allocator<dispatch::block<void (^)(NSDictionary *)>>> {
struct block<void (^)(NSDictionary *)> *__first_;
} __end_cap_;
};
#pragma mark Typedef'd Structures
typedef struct {
int _field1;
int _field2;
} CDStruct_1ef3fb1f;
|
#ifndef _EASYEDITOR_ALPHA_SETTING_DLG_H_
#define _EASYEDITOR_ALPHA_SETTING_DLG_H_
#include "ColorMonitor.h"
#include "Sprite.h"
#include <wx/wx.h>
namespace ee
{
class ColorSlider;
class AlphaSettingDlg : public wxDialog, public ColorMonitor
{
public:
AlphaSettingDlg(wxWindow* parent, const SprPtr& spr,
const wxPoint& pos = wxDefaultPosition);
//
// interface ColorMonitor
//
virtual pt2::Color GetColor() const override;
virtual void OnColorChanged() override;
virtual void OnColorChanged(const pt2::Color& color) override;
private:
void InitLayout();
void SetColor(const pt2::Color& color);
private:
SprPtr m_spr;
ColorSlider* m_alpha;
}; // AlphaSettingDlg
}
#endif // _EASYEDITOR_ALPHA_SETTING_DLG_H_ |
#ifndef ICAL_TESTS_DURATIONPARSERTESTS_H
#define ICAL_TESTS_DURATIONPARSERTESTS_H
#include "tests/testreporter.h"
namespace ical {
namespace tests {
struct DurationParserTests
{
static void runTests(TestReporter &tr);
};
} // namespace tests
} // namespace ical
#endif // ICAL_TESTS_DURATIONPARSERTESTS_H
|
//*********************************************************************************
// Button Debouncer Example
//
// Description:
// Waits for a button press on port 1, pin 2 or port 1, pin 3 to toggle an LED.
// Port 1, pin 2 has a pullup resistor while port 1, pin 3 does not.
//
// This example cannot be compiled and used unless additional work
// is done to to so (coding wise). This example exists to show the general
// operation of the library it happens to utilize. It only displays one
// general use case although more use cases may exist.
//
// Copyright (C) 2014 Trent Cleghorn <trentoncleghorn@gmail.com>
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//*********************************************************************************
#include "button_debounce.h"
...
Debouncer port1;
int
main()
{
uint32_t currentTime;
uint32_t initialTime;
// Setup timer to generate an interrupt on a regular interval.
// In this case, it will be every 1 millisecond.
...
// Initialize the button debouncer. Tell the debouncer that
// pin 2 has a pullup.
ButtonDebounceInit(&port1, BUTTON_PIN_2);
...
while(1)
{
...
// Check when 1 millisecond has passed
if(currentTime - initialTime >= 1)
{
// Save the current time for the next go around
initialTime = currentTime;
// Port1ReadBits is a fictitious function that reads
// the bits off the port 1 register.
ButtonProcess(&port1, Port1ReadBits());
if(ButtonPressed(&port1, BUTTON_PIN_2 | BUTTON_PIN_3))
{
// Toggle the LED on or off
...
}
}
}
}
|
//
// AppDelegate.h
// Fresh_water_daily
//
// Created by lanou3g on 15/11/16.
// Copyright © 2015年 yangkenneg.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
#include "def.h"
#include "c8_sys.h"
#ifndef IO_H
#define IO_H
char *get_rompath();
/* determines whether the program should continue normally,
* halt or restart (load new rom etc)
* 0 = continue normally
* 1 = restart
* 2 = exit
*/
int cont(void);
u8 wkeypress(u8 *accepted);
bool ispressed(u8 key);
int screen_init(void);
int screen_update(u64 screen[32]);
int screen_close(void);
#endif
|
#include <stdio.h>
#include <stdlib.h>
#define isLowerCase(c) ( ((c)<='z' && (c)>='a') ? 1 : 0 )
void lowerToUpper(char *c) { *c = *c + 'A' - 'a'; }
void capitalize(char *str) {
if (!str) { return; }
// first char
if (isLowerCase(*str)) { lowerToUpper(str); }
for (++str; *str; ++str) {
if (*(str-1)==' ' && isLowerCase(*str)) { lowerToUpper(str); }
}
return;
}
void main(void) {
char str[81] = {0};
char *buf = str;
for (; (*buf=getchar()) != '\n'; ++buf) ;
*buf = 0;
capitalize(str);
printf("%s\n", str);
FILE *fp;
#ifdef __WIN32__
fp = fopen(".\\test", "w+");
#elif linux
fp = fopen("./test", "w+");
#else
puts("OS type not recognized!");
exit(-1);
#endif
fputs(str, fp);
fclose(fp);
}
|
// Generated by Apple Swift version 1.2 (swiftlang-602.0.53.1 clang-602.0.53)
#pragma clang diagnostic push
#if defined(__has_include) && __has_include(<swift/objc-prologue.h>)
# include <swift/objc-prologue.h>
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <objc/NSObject.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#if defined(__has_include) && __has_include(<uchar.h>)
# include <uchar.h>
#elif !defined(__cplusplus) || __cplusplus < 201103L
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
#endif
typedef struct _NSZone NSZone;
#if !defined(SWIFT_PASTE)
# define SWIFT_PASTE_HELPER(x, y) x##y
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
#endif
#if !defined(SWIFT_METATYPE)
# define SWIFT_METATYPE(X) Class
#endif
#if defined(__has_attribute) && __has_attribute(objc_runtime_name)
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
#else
# define SWIFT_RUNTIME_NAME(X)
#endif
#if !defined(SWIFT_CLASS_EXTRA)
# define SWIFT_CLASS_EXTRA
#endif
#if !defined(SWIFT_PROTOCOL_EXTRA)
# define SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_ENUM_EXTRA)
# define SWIFT_ENUM_EXTRA
#endif
#if !defined(SWIFT_CLASS)
# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted)
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
# else
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# endif
#endif
#if !defined(SWIFT_PROTOCOL)
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_EXTENSION)
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
#endif
#if !defined(OBJC_DESIGNATED_INITIALIZER)
# if defined(__has_attribute) && __has_attribute(objc_designated_initializer)
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
# else
# define OBJC_DESIGNATED_INITIALIZER
# endif
#endif
#if !defined(SWIFT_ENUM)
# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type
#endif
#if __has_feature(nullability)
# define SWIFT_NULLABILITY(X) X
#else
# if !defined(__nonnull)
# define __nonnull
# endif
# if !defined(__nullable)
# define __nullable
# endif
# if !defined(__null_unspecified)
# define __null_unspecified
# endif
# define SWIFT_NULLABILITY(X)
#endif
#if defined(__has_feature) && __has_feature(modules)
@import Foundation;
#endif
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
@interface NSNumber (SWIFT_EXTENSION(SwiftyJSON))
@property (nonatomic, readonly) BOOL isBool;
@end
#pragma clang diagnostic pop
|
//
// JVStringArrayMatrix.h
// ObjCAlgorithms
//
// Created by József Vesza on 28/12/14.
// Copyright (c) 2014 Jozsef Vesza. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface JVStringArrayMatrix : NSObject
+ (int)calculateValue:(NSArray *)inputFiles;
+ (NSString *)findLongestPalindromicSubstring:(NSString *)inputString;
+ (NSArray *)twoSumInArray:(NSArray *)numbers withTarget:(int)target;
+ (int)countSumsInArray:(NSArray *)numbers withTarget:(int)target;
+ (NSArray *)threeSumInArray:(NSArray *)numbers;
+ (BOOL)findSumsInArray:(NSArray *)numbers withTarget:(int)targetSum;
+ (NSArray *)mergeArray:(NSArray *)input1 intoArray:(NSArray *)input2;
+ (int)maximumSubarray:(NSArray *)input;
+ (NSString *)reverseStringWordByWord:(NSString *)input;
+ (NSString *)reverseString:(NSString *)input;
@end
|
//
// THiOSVersionMacros.h
// THHeaders
//
// Created by Thomas Heß on 15.7.13.
// Copyright (c) 2013 Thomas Heß. All rights reserved.
//
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (! defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0))
#define TH_DEPLOYMENT_TARGET_PRE_IOS6(...) \
if ([[[UIDevice currentDevice] systemVersion] integerValue] >= 6) \
{ \
__VA_ARGS__ \
}
#else
#define TH_DEPLOYMENT_TARGET_PRE_IOS6(...)
#endif
|
/* This file is part of the Pangolin Project.
* http://github.com/stevenlovegrove/Pangolin
*
* Copyright (c) 2014 Steven Lovegrove
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef PANGOLIN_PANGO_VIDEO_H
#define PANGOLIN_PANGO_VIDEO_H
#include <pangolin/video/video.h>
#include <pangolin/log/packetstream.h>
namespace pangolin
{
class PANGOLIN_EXPORT PangoVideo
: public VideoInterface, public VideoPropertiesInterface, public VideoPlaybackInterface
{
public:
PangoVideo(const std::string& filename, bool realtime = true);
~PangoVideo();
// Implement VideoInterface
size_t SizeBytes() const PANGOLIN_OVERRIDE;
const std::vector<StreamInfo>& Streams() const PANGOLIN_OVERRIDE;
void Start() PANGOLIN_OVERRIDE;
void Stop() PANGOLIN_OVERRIDE;
bool GrabNext( unsigned char* image, bool wait = true ) PANGOLIN_OVERRIDE;
bool GrabNewest( unsigned char* image, bool wait = true ) PANGOLIN_OVERRIDE;
// Implement VideoPropertiesInterface
const json::value& DeviceProperties() const PANGOLIN_OVERRIDE;
const json::value& FrameProperties() const PANGOLIN_OVERRIDE;
// Implement VideoPlaybackInterface
int GetCurrentFrameId() const PANGOLIN_OVERRIDE;
int GetTotalFrames() const PANGOLIN_OVERRIDE;
int Seek(int frameid) PANGOLIN_OVERRIDE;
protected:
int FindSource();
PacketStreamReader reader;
size_t size_bytes;
std::vector<StreamInfo> streams;
json::value device_properties;
json::value frame_properties;
int src_id;
int frame_id;
const std::string filename;
bool is_pipe;
};
}
#endif // PANGOLIN_PANGO_VIDEO_H
|
#import "MOBProjection.h"
@interface MOBProjectionEPSG20028 : MOBProjection
@end
|
#pragma once
// Simple cross platform mutex implementation.
// Similar to the new C++11 api.
// Windows and pthreads implementations in one.
// TODO: Need to clean up these primitives and put them in a reasonable namespace.
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#ifndef _XBOX
#include <windows.h>
#else
#include <xtl.h>
#endif
// Zap stupid windows defines
// Should move these somewhere clever.
#undef p
#undef DrawText
#undef itoa
#else
#include <pthread.h>
#include <errno.h>
#include <sys/time.h>
#endif
class recursive_mutex {
#ifdef _WIN32
typedef CRITICAL_SECTION mutexType;
#else
typedef pthread_mutex_t mutexType;
#endif
public:
recursive_mutex() {
#ifdef _WIN32
InitializeCriticalSection(&mut_);
#else
// Critical sections are recursive so let's make these recursive too.
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&mut_, &attr);
#endif
}
~recursive_mutex() {
#ifdef _WIN32
DeleteCriticalSection(&mut_);
#else
pthread_mutex_destroy(&mut_);
#endif
}
bool trylock() {
#ifdef _WIN32
return TryEnterCriticalSection(&mut_) == TRUE;
#else
return pthread_mutex_trylock(&mut_) != EBUSY;
#endif
}
void lock() {
#ifdef _WIN32
EnterCriticalSection(&mut_);
#else
pthread_mutex_lock(&mut_);
#endif
}
void unlock() {
#ifdef _WIN32
LeaveCriticalSection(&mut_);
#else
pthread_mutex_unlock(&mut_);
#endif
}
mutexType &native_handle() {
return mut_;
}
private:
mutexType mut_;
recursive_mutex(const recursive_mutex &other);
};
class lock_guard {
public:
lock_guard(recursive_mutex &mtx) : mtx_(mtx) {mtx_.lock();}
~lock_guard() {mtx_.unlock();}
private:
recursive_mutex &mtx_;
};
// Like a Windows event, or a modern condition variable.
class event {
public:
#ifdef _WIN32
#else
#endif
event() {
#ifdef _WIN32
event_ = CreateEvent(0, FALSE, FALSE, 0);
#else
pthread_cond_init(&event_, NULL);
#endif
}
~event() {
#ifdef _WIN32
CloseHandle(event_);
#else
pthread_cond_destroy(&event_);
#endif
}
void notify_one() {
#ifdef _WIN32
SetEvent(event_);
#else
pthread_cond_signal(&event_);
#endif
}
// notify_all is not really possible to implement with win32 events?
void wait(recursive_mutex &mtx) {
// broken
#ifdef _WIN32
// This has to be horribly racy.
mtx.lock();
WaitForSingleObject(event_, INFINITE);
ResetEvent(event_); // necessary?
mtx.unlock();
#else
pthread_mutex_lock(&mtx.native_handle());
pthread_cond_wait(&event_, &mtx.native_handle());
pthread_mutex_unlock(&mtx.native_handle());
#endif
}
void wait_for(recursive_mutex &mtx, int milliseconds) {
#ifdef _WIN32
//mtx.unlock();
WaitForSingleObject(event_, milliseconds);
ResetEvent(event_); // necessary?
// mtx.lock();
#else
timespec timeout;
timeval tv;
gettimeofday(&tv, NULL);
timeout.tv_sec = tv.tv_sec;
timeout.tv_nsec = tv.tv_usec * 1000;
timeout.tv_sec += milliseconds / 1000;
timeout.tv_nsec += milliseconds * 1000000;
pthread_mutex_lock(&mtx.native_handle());
pthread_cond_timedwait(&event_, &mtx.native_handle(), &timeout);
pthread_mutex_unlock(&mtx.native_handle());
#endif
}
void reset() {
#ifdef _WIN32
ResetEvent(event_);
#endif
}
private:
#ifdef _WIN32
HANDLE event_;
#else
pthread_cond_t event_;
#endif
};
class condition_variable {
public:
#ifdef _WIN32
#else
#endif
condition_variable() {
#ifdef _WIN32
event_ = CreateEvent(0, FALSE, FALSE, 0);
#else
pthread_cond_init(&event_, NULL);
#endif
}
~condition_variable() {
#ifdef _WIN32
CloseHandle(event_);
#else
pthread_cond_destroy(&event_);
#endif
}
void notify_one() {
#ifdef _WIN32
SetEvent(event_);
#else
pthread_cond_signal(&event_);
#endif
}
// notify_all is not really possible to implement with win32 events?
void wait(recursive_mutex &mtx) {
// broken
#ifdef _WIN32
// This has to be horribly racy.
mtx.unlock();
WaitForSingleObject(event_, INFINITE);
ResetEvent(event_); // necessary?
mtx.lock();
#else
pthread_cond_wait(&event_, &mtx.native_handle());
#endif
}
void wait_for(recursive_mutex &mtx, int milliseconds) {
#ifdef _WIN32
//mtx.unlock();
WaitForSingleObject(event_, milliseconds);
ResetEvent(event_); // necessary?
// mtx.lock();
#else
timespec timeout;
#ifdef __APPLE__
timeval tv;
gettimeofday(&tv, NULL);
timeout.tv_sec = tv.tv_sec;
timeout.tv_nsec = tv.tv_usec * 1000;
#else
clock_gettime(CLOCK_REALTIME, &timeout);
#endif
timeout.tv_sec += milliseconds / 1000;
timeout.tv_nsec += milliseconds * 1000000;
pthread_cond_timedwait(&event_, &mtx.native_handle(), &timeout);
#endif
}
private:
#ifdef _WIN32
HANDLE event_;
#else
pthread_cond_t event_;
#endif
};
|
#ifndef _WIN_L_LUAHEADERS_
#define _WIN_L_LUAHEADERS_
#include <_type/type.h>
// Lua header files for C++
extern "C"
{
#include <_library/_lua/lua.h>
#include <_library/_lua/lualib.h>
#include <_library/_lua/lauxlib.h>
static unused int lua_typeerror( lua_State* L , int narg , _literal tname ){
const char *msg = lua_pushfstring( L , "%s expected, got %s" , tname , luaL_typename( L , narg ) );
return luaL_argerror( L , narg , msg );
}
static unused int lua_tagerror( lua_State* L , int narg , int tag ){
return lua_typeerror( L , narg , lua_typename( L , tag ) );
}
static unused int lua_notnoneerror( lua_State* L , int narg ){
const char *msg = lua_pushfstring( L , "Expected no parameter, got %s" , luaL_typename( L , narg ) );
return luaL_argerror( L , narg , msg );
}
static unused int constexpr lua_toAbsIndex( lua_State* L , int idx ){
return (idx > 0) ? idx : (idx <= LUA_REGISTRYINDEX) ? idx : (lua_gettop(L) + 1 + idx);
}
static unused int lua_convToAbsIndex( lua_State* L , int& idx ){
return (idx = (idx > 0) ? idx : (idx <= LUA_REGISTRYINDEX) ? idx : (lua_gettop(L) + 1 + idx));
}
#define lua_rawgetfield( L , idx , field ) lua_pushliteral( L , field ); lua_rawget( L , idx )
}
#endif |
/*
* Mach Operating System
* Copyright (c) 1992,1991,1990,1989 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
char *
strcat(s, add)
register char *s, *add;
{
register char *ret = s;
while (*s) s++;
while ((*s++ = *add++) != 0);
return ret;
}
|
//
// qdSdkFw.h
// qdSdkFw
//
// Created by chaos on 15-8-30.
// Copyright (c) 2015年 chaos. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "Qxdelegate.h"
#define QX_AC (@"AC")
#define QX_SEVERNAME (@"SEVER_NAME")
#define QX_SERVERID (@"SEVER_ID")
#define QX_ROLEID (@"ROLE_ID")
#define QX_ROLENAME (@"ROLE_NAME")
#define QX_LEVEL (@"LEVEL")
#define QX_COUNT (@"COUNT")
@protocol QXDelegate;
@interface qdSdkLib : NSObject
{
UIViewController*vc;
}
//-(void) log:(NSString *)msg;//test
@property(nonatomic,assign) id<QXDelegate> Delegate;
+(qdSdkLib *)Instance;
- (void) Login;
-(void)doRoleStatics:(NSDictionary*)dic;
-(void)init:(NSString*)appid GAME_KEY:(NSString*)gameid CHANNELID:(NSString*)channelid
TICKET:(NSString*)tic GAME:(NSString*)Gname LOGINKEY:(NSString*) logkey;
-(void)StartAnimating;
-(void)StopAnimating;
-(void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
-(void)setRegisterWithAccountID:(NSString *)account;
-(void)setLoginWithAccountID:(NSString *)account;
-(void)setPaymentStart:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
-(void)setPayment:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
-(void)SetEvent:(NSString*)eventname;
-(NSString*)getDeviceId;
-(void)setPrintLog:(BOOL)print;
-(void)SetViewcontrol:(UIViewController*)viewc;
-(void)OpenPay:(int)money TITLE:(NSString*)title Item_desc:(NSString*)item_desc Ext:(NSString*)ext RoleName:(NSString*)rolename productId:(NSString*)productId quantity:(int)quantity;
-(void) notifyLoginresult:(NSDictionary *)result;
-(void) notifyPayresult:(NSDictionary *)result;
-(void) notifyRegisterresult:(NSDictionary *)result;
@end
|
#pragma once
#include "stdafx.h"
#include "State.h"
#include <string>
#include <iostream>
#include <msclr\marshal_cppstd.h>
//#include "ConnectionWrap.h"
using namespace System;
namespace FSMWrapper
{
ref class ConnectionWrap;
public ref class StateWrapper
{
public:
FSM::State * _state;
public:
StateWrapper()
{
_state = new FSM::GenericState("Fuffa");
};
~StateWrapper()
{
delete _state;
_state = nullptr;
}
String^ get_name()
{
return msclr::interop::marshal_as<String^>(_state->get_name());
}
void set_name(String^ name)
{
_state->set_name(msclr::interop::marshal_as<std::string>(name));
}
void add_connection(ConnectionWrap^ conn);
int get_connection_count()
{
return (int)_state->get_connection_count();
}
ConnectionWrap^ get_connection_at_index(int index);
};
} |
//
// FSCalendarAnimator.h
// FSCalendar
//
// Created by dingwenchao on 3/13/16.
// Copyright © 2016 wenchaoios. All rights reserved.
//
#import "FSCalendar.h"
#import "FSCalendarCollectionView.h"
#import "FSCalendarFlowLayout.h"
#import "FSCalendarScopeHandle.h"
typedef NS_ENUM(NSUInteger, FSCalendarTransition) {
FSCalendarTransitionNone,
FSCalendarTransitionMonthToWeek,
FSCalendarTransitionWeekToMonth
};
typedef NS_ENUM(NSUInteger, FSCalendarTransitionState) {
FSCalendarTransitionStateIdle,
FSCalendarTransitionStateInProgress
};
@interface FSCalendarAnimator : NSObject <UIGestureRecognizerDelegate>
@property (weak, nonatomic) FSCalendar *calendar;
@property (weak, nonatomic) FSCalendarCollectionView *collectionView;
@property (weak, nonatomic) FSCalendarFlowLayout *collectionViewLayout;
@property (assign, nonatomic) FSCalendarTransition transition;
@property (assign, nonatomic) FSCalendarTransitionState state;
@property (assign, nonatomic) CGSize cachedMonthSize;
- (void)performScopeTransitionFromScope:(FSCalendarScope)fromScope toScope:(FSCalendarScope)toScope animated:(BOOL)animated;
- (void)performBoundingRectTransitionFromMonth:(NSDate *)fromMonth toMonth:(NSDate *)toMonth duration:(CGFloat)duration;
- (void)handlePan:(id)sender;
@end
@interface FSCalendarTransitionAttributes : NSObject
@property (assign, nonatomic) CGRect sourceBounds;
@property (assign, nonatomic) CGRect targetBounds;
@property (strong, nonatomic) NSDate *sourcePage;
@property (strong, nonatomic) NSDate *targetPage;
@property (assign, nonatomic) NSInteger focusedRowNumber;
@property (assign, nonatomic) NSDate *focusedDate;
@property (strong, nonatomic) NSDate *firstDayOfMonth;
@end
|
#include <windows.h>
#include <stdio.h>
int main(void) {
STARTUPINFO si;
PROCESS_INFORMATION pi;
// allocate memory
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));
// create child process
if (!CreateProcess(NULL,
"C:\\Windows\\system32\\mspaint.exe",
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi)) {
fprintf(stderr, "Create Process Failed");
return -1;
}
WaitForSingleObject(pi.hProcess, INFINITE);
printf("Child Complete");
// close handles
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
|
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
void comb_sort(int *, unsigned long);
void imprimir_vetor(int *, unsigned long);
int main(int argc, char *argv[])
{
struct timeval timevalA;
struct timeval timevalB;
int *vetor = NULL;
unsigned long tam, i = 0;
if (argc != 2) {
printf("%s elementos\n", argv[0]);
exit(EXIT_FAILURE);
}
tam = atoi(argv[1]);
if (!(vetor = (int *) malloc(sizeof(int) * tam))) {
printf("Erro ao alocar memória\n");
exit(EXIT_FAILURE);
}
srand(time(NULL));
int j;
double sum = 0;
for (j = 0; j < 10; ++j){
for (i = 0; i < tam; i++) {
*(vetor + i) = random() % 10000;
}
gettimeofday(&timevalA, NULL);
comb_sort(vetor, tam);
gettimeofday(&timevalB, NULL);
double t = timevalB.tv_sec - timevalA.tv_sec + (timevalB.tv_usec - timevalA.tv_usec) / (double) 1000000;
sum += t;
// printf("%lf\n", t);
}
printf("comb %lf\n", sum/10.0);
free(vetor);
return EXIT_SUCCESS;
}
void comb_sort(int *vetor, unsigned long tam)
{
unsigned long i, j;
int intervalo, trocado = 1;
int aux;
intervalo = tam;
while (intervalo > 1 || trocado == 1)
{
intervalo = intervalo * 10 / 13;
if (intervalo == 9 || intervalo == 10) {
intervalo = 11;
}
if (intervalo < 1) {
intervalo = 1;
}
trocado = 0;
for (i = 0, j = intervalo; j < tam; i++, j++)
{
if (vetor[i] > vetor[j])
{
aux = vetor[i];
vetor[i] = vetor[j];
vetor[j] = aux;
trocado = 1;
}
}
}
}
void imprimir_vetor(int *vetor, unsigned long tam)
{
unsigned long i;
for (i = 0; i < tam; i++) {
printf("%d\t", vetor[i]);
}
printf("\n");
}
|
//
// YYLViewController.h
// YYLWebViewController
//
// Created by yanyulin on 07/19/2017.
// Copyright (c) 2017 yanyulin. All rights reserved.
//
@import UIKit;
@interface YYLViewController : UIViewController
@end
|
#ifndef DDSPLUGIN_H
#define DDSPLUGIN_H
#include <fstream>
#include <Ims/ImagePlugin.h>
namespace ims {
const unsigned long DDSD_CAPS = 0x00000001;
const unsigned long DDSD_HEIGHT = 0x00000002;
const unsigned long DDSD_WIDTH = 0x00000004;
const unsigned long DDSD_PITCH = 0x00000008;
const unsigned long DDSD_PIXELFORMAT = 0x00001000;
const unsigned long DDSD_MIPMAPCOUNT = 0x00020000;
const unsigned long DDSD_LINEARSIZE = 0x00080000;
const unsigned long DDSD_DEPTH = 0x00800000;
const unsigned long DDS_FOURCC = 0x00000004;
const unsigned long DDS_RGB = 0x00000040;
const unsigned long DDS_RGBA = 0x00000041;
const unsigned long DDS_DEPTH = 0x00800000;
const unsigned long DDS_COMPLEX = 0x00000008;
const unsigned long DDS_TEXTURE = 0x00001000;
const unsigned long DDS_VOLUME = 0x00200000;
const unsigned long DDS_MIPMAP = 0x00400000;
const unsigned long DDS_CUBEMAP = 0x00000200;
const unsigned long DDS_CUBEMAP_POSITIVEX = 0x00000400;
const unsigned long DDS_CUBEMAP_NEGATIVEX = 0x00000800;
const unsigned long DDS_CUBEMAP_POSITIVEY = 0x00001000;
const unsigned long DDS_CUBEMAP_NEGATIVEY = 0x00002000;
const unsigned long DDS_CUBEMAP_POSITIVEZ = 0x00004000;
const unsigned long DDS_CUBEMAP_NEGATIVEZ = 0x00008000;
const unsigned long FOURCC_DXT1 = 0x31545844; //(MAKEFOURCC('D','X','T','1'))
const unsigned long FOURCC_DXT2 = 0x32545844; //(MAKEFOURCC('D','X','T','2'))
const unsigned long FOURCC_DXT3 = 0x33545844; //(MAKEFOURCC('D','X','T','3'))
const unsigned long FOURCC_DXT4 = 0x34545844; //(MAKEFOURCC('D','X','T','4'));
const unsigned long FOURCC_DXT5 = 0x35545844; //(MAKEFOURCC('D','X','T','5'))
class RD_EXPORT DDSPlugin : public ImagePlugin {
struct DDSPixelFormat {
unsigned long Size;
unsigned long Flags;
unsigned long FourCC;
unsigned long RGBBitCount;
unsigned long RBitMask;
unsigned long GBitMask;
unsigned long BBitMask;
unsigned long ABitMask;
public:
DDSPixelFormat() {
Size = 0;
Flags = 0;
FourCC = 0;
RGBBitCount = 0;
RBitMask = 0;
GBitMask = 0;
BBitMask = 0;
ABitMask = 0;
}
};
typedef struct _DXTColBlock {
unsigned short col0;
unsigned short col1;
unsigned char row[4];
public:
_DXTColBlock() {
col0 = 0;
col1 = 0;
row[0] = 0;
row[1] = 0;
row[2] = 0;
row[3] = 0;
}
} DXTColBlock;
typedef struct _DXT3AlphaBlock {
unsigned short row[4];
public:
_DXT3AlphaBlock() {
row[0] = 0;
row[1] = 0;
row[2] = 0;
row[3] = 0;
}
} DXT3AlphaBlock;
typedef struct _DXT5AlphaBlock {
unsigned char alpha0;
unsigned char alpha1;
unsigned char row[6];
public:
_DXT5AlphaBlock() {
alpha0 = 0;
alpha1 = 0;
row[0] = 0;
row[1] = 0;
row[2] = 0;
row[3] = 0;
row[4] = 0;
row[5] = 0;
}
} DXT5AlphaBlock;
struct DDSHeader {
char id[4];
/// Size of the structure. Must be set to 124
unsigned long Size;
/// Flags to indicate valid fields. Always include DDSD_CAPS, DDSD_PIXELFORMAT, DDSD_WIDTH, DDSD_HEIGHT
unsigned long Flags;
/// Height of the main image
unsigned long Height;
/// Width of the main image
unsigned long Width;
/**
For uncompressed formats, this is the number of bytes per scan line (DWORD> aligned) for the
main image. dwFlags should include DDSD_PITCH in this case. For compressed formats, this is
the total number of bytes for the main image. dwFlags should be include DDSD_LINEARSIZE in this case.
*/
unsigned long PitchOrLinearSize;
/// This is the depth of the volume textures. Flags should include DDSD_DEPTH in this case.
unsigned long Depth;
/// For items with mipmap levels, this is the total number of levels in the mipmap chain of the main image. dwFlags should include DDSD_MIPMAPCOUNT in this case.
unsigned long MipMapCount;
unsigned long Reserved1[11];
/// 32-byte value that specifies the pixel format structure.
DDSPixelFormat ddspf;
unsigned long Caps1;
unsigned long Caps2;
unsigned long Reserved2[3];
public:
DDSHeader() {
id[0] = 0;
id[1] = 0;
id[2] = 0;
id[3] = 0;
Size = 0;
Flags = 0;
Height = 0;
Width = 0;
PitchOrLinearSize = 0;
Depth = 0;
MipMapCount = 0;
Reserved1[0] = 0;
Reserved1[1] = 0;
Reserved1[2] = 0;
Reserved1[3] = 0;
Reserved1[4] = 0;
Reserved1[5] = 0;
Reserved1[6] = 0;
Reserved1[7] = 0;
Reserved1[8] = 0;
Reserved1[9] = 0;
Reserved1[10] = 0;
Caps1 = 0;
Caps2 = 0;
Reserved2[0] = 0;
Reserved2[1] = 0;
Reserved2[2] = 0;
}
};
public:
DDSPlugin();
virtual ~DDSPlugin();
virtual ErrorType ReadInfo(const char* pFilename, ImageObject* pImageObject);
virtual ErrorType Load(const char* pFilename, ImageObject* pImageObject);
protected:
ErrorType ReadHeader(std::ifstream& in);
};
} // End of namepace
#endif
|
//
// ViewController.h
// RitoKit
//
// Created by Levi McCallum on 7/7/14.
// Copyright (c) 2014 Levi McCallum. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
//
// SkiathosClient.h
//
//
// Created by Alberto De Bortoli on 15/11/2015.
// Copyright (c) 2015 Alberto De Bortoli. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Skiathos.h"
@interface SkiathosClient : Skiathos
+ (SkiathosClient *)sharedInstance;
@end
|
/* ------------------------------------------------------------------ *\
TempusFugit.h
Program declares for TempusFugit Pebble app.
Author: Peter Deutsch (engineerbill@stemchest.com)
Date Created: 8/8/13
Last Update: 8/8/13
\* ------------------------------------------------------------------ */
#ifndef TEMPUS_FUGIT_H
#define TEMPUS_FUGIT_H
#include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
// ----------------------------------------------
// Public program declares
// ----------------------------------------------
#define PROGRAM_VERSION "- beta 0.5" // used to track version (e.g. on splash page)
// Feature defines used e.g. when calling
// context sensitive help function
#define PROGRAM 0
#define CALCULATOR_ABOUT 1
#define CALCULATOR_HELP 2
#define STOPWATCH_ABOUT 3
#define STOPWATCH_HELP 4
#define TIMER_ABOUT 5
#define TIMER_HELP 6
// Calculator parameter defines
#define PEOPLE 0
#define TIME 1
#define WAGES 2
// Stopwatch & Timer parameter defines
#define COUNT 0
#define ALERT 1
// -----------------------------------
// Track active window
// -----------------------------------
// ***********************************
// TODO: Make this an enum list
// and move to State Manager.
// ***********************************
#define NUMBER_OF_WINDOWS 9
#define NO_WINDOW -1
#define MENU_PROGRAM_WINDOW 0
#define CALC_WINDOW 1
#define TIMER_UP_WINDOW 2
#define TIMER_DOWN_WINDOW 3
#define MENU_MAIN_WINDOW 4
#define MENU_SETTINGS_WINDOW 5
#define SETTINGS_WINDOW 6
#define ABOUT_WINDOW 7
#define HELP_WINDOW 8
//#define DEFAULTS_WINDOW 9 // to come
//#define SETTING_WINDOW 10 // to come
#define NUMBER_OF_IMAGES 4
#define NUMBER_OF_LARGE_IMAGES 7
extern int IMAGE_RESOURCE_IDS[];
extern int IMAGE_RESOURCE_LARGE_IDS[];
#define NUMBER_OF_ICONS 3
extern int IMAGE_RESOURCE_ICONS[];
// -----------------------------------
// Global Logo Animation vars
// -----------------------------------
// Provides logo animation data for each feature window
typedef struct {
Layer animation_layer; // logo slideshow layer
BmpContainer image_container[NUMBER_OF_IMAGES]; // logo container
int current_logo; // tracks which is active aswe cycle
} TempusFugitLogoData;// Provides logo animation data for each feature window
typedef struct {
Layer animation_layer; // logo slideshow layer
BmpContainer image_container[NUMBER_OF_LARGE_IMAGES]; // logo container
int current_logo; // tracks which is active aswe cycle
} TempusFugitLargeLogoData;
typedef struct {
// Window TextLayers
TextLayer title_layer; // Alarm Window title layer
TextLayer count_layer; // displays timer count &
TextLayer alert_layer; // alert labels
TextLayer countbuf_layer; // Stopwatch value buffers
TextLayer alertbuf_layer; // (contains changing data)
// TextLayer msgb_layer; // used to display debug messages
// buffers to hold window labels
char title_label[15]; // "STOPWATCH", "- TIMER -", etc
char alert_label[7]; // "ALERT:"
// Window Value buffers
char count_buffer[10]; // range: 00:00:00 - 23:59:59
char alert_buffer[10]; // range: 00:00 - 23:59
char msgs_buffer[24]; // debug message buffer
int tick_count; // tick event counter
int count_second; // elapsed time display
int count_minute; //
int count_hour; //
int alert_count; // holds vibe alert target
int alert_second; // alert display
int alert_minute; //
int alert_hour; //
bool running; // track whether timer running
char *caller; // name of calling routine
int button_action; // determines button activity (may be COUNT | ALERT)
} TempusFugitAlarmData;
// Logo Animation data structures
extern TempusFugitLogoData calc_logo_data; // small logos (for feature pages)
extern TempusFugitLogoData stop_logo_data; //
extern TempusFugitLogoData timer_logo_data; //
extern TempusFugitLargeLogoData page_start_logo_data; // large logo (for splash page)
extern BmpContainer tf_icon_container[]; // holds Action Bar icons
// -----------------------------------
// Global Program Variables
// -----------------------------------
extern int tf_active_window; // Make public active window flag
extern AppContextRef tf_app_context; // Store global app context
extern bool tf_animating; // controls logo animation throughout program
extern bool tf_debugging; // enables printing messages in header
// -----------------------------------
// Public functions
// -----------------------------------
extern void tf_skip_start_page(); // hitting "Select" on splash page skips
#endif |
//
// NSObject+DBRunTimeSave.h
// GYFMDB
//
// Created by User on 16/5/28.
// Copyright © 2016年 jlc. All rights reserved.
//
#import <Foundation/Foundation.h>
#define SQLTEXT @"TEXT"
#define SQLINTEGER @"INTEGER"
#define SQLREAL @"REAL"
#define SQLBLOB @"BLOB"
#define SQLNULL @"NULL"
#define PrimaryKey @"primary key"
#define primaryId @"pk" //主键字段
@interface NSObject (GYFMDB)
/** 主键 id */
@property (nonatomic, strong) NSNumber * pk;
//@property (nonatomic, strong) NSString * aliasName;//别名
/*链式语法*/
//@property (nonatomic,copy) NSObject*(^select)();
//@property (nonatomic,copy) NSObject*(^where)(NSString*);
//@property (nonatomic,copy) NSObject*(^limit)(NSString*);
//@property (nonatomic,copy) NSObject*(^offSet)(NSString*);
//@property (nonatomic,copy) NSObject*(^orderby)(NSString*);
//
//@property (nonatomic,copy) NSObject*(^groupby)(NSString*);
//@property (nonatomic,copy) NSObject*(^having)(NSString*);
//
//
//@property (nonatomic,copy) NSObject*(^joinWithOn)(NSString*,NSString*);
//
//
//@property (nonatomic,copy) NSMutableArray*(^runSql)();//默认返回数组
//
//@property (nonatomic,copy) NSObject*(^findSql)();//默认返回一个对象
/*链式语法*/
#pragma mark - ORM Method
//动态获取模型属性列表
-(NSArray *)attributePropertyList;
+ (NSDictionary *)getAllProperties;
+ (BOOL)createTable;
+ (BOOL)isExistInTable;
-(BOOL)save;
+ (BOOL)saveDBArray:(NSArray*)dataArray;
- (BOOL)deleteObject;
+ (BOOL)deleteALLObject;
+ (BOOL)deleteObjectsByCondition:(NSString *)condition;
- (BOOL)update;
- (BOOL)updateByCondition:(NSString *)condition;
#pragma mark- 仿MagicalRecord
+ (NSArray *)findAll;
+ (NSArray *)findByCondition:(NSString *)condition;
+ (NSArray *)findOrderBy:(NSString *)condition ascending:(BOOL)flag;
/*
Person *person = [Person MR_findFirstByAttribute:@"FirstName"
withValue:@"Forrest"];
*/
+ (id)findByAttribute:(NSString *)propertyName WithValue:(NSString*)value;
+ (id)findLastInDB;//默认按发送时间排序
+ (NSArray*)findLastGroup;//默认按发送时间排序,显示所有人的消息最后一条
//表中所有数量数量
+(NSInteger)countsOfItemInDB;
//表中某一字段求累加的和
+(NSInteger)sumOfItemInDB:(NSString*)itemName;
//表中某一字段在特定条件下求累加的和
+(NSInteger)sumOfItemInDB:(NSString*)itemName ByCondition:(NSString*)condition;
#pragma mark - PrimaryKey method
-(id)pk;
-(void)setPk:(id)pk;
@end
|
#ifndef TASK_H
#define TASK_H
class Task {
public:
virtual void process() = 0;
};
#endif
|
/*
headers for MMX assembler version of SDL_MixAudio
Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
This code is licensed under the LGPL (see COPYING for details)
Assumes buffer size in bytes is a multiple of 16
Assumes SDL_MIX_MAXVOLUME = 128
*/
#include "SDL_config.h"
#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */
#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES)
void SDL_MixAudio_MMX_S16(char* ,char* ,unsigned int ,int );
void SDL_MixAudio_MMX_S8(char* ,char* ,unsigned int ,int );
#endif
#endif
|
#import <Foundation/Foundation.h>
#import "SWGObject.h"
@protocol SWGUserTokenRequestInnerUserField
@end
@interface SWGUserTokenRequestInnerUserField : SWGObject
/* WordPress user ID [optional]
*/
@property(nonatomic) NSNumber<Optional>* _id;
@end
|
//*****************************************************************************
//
// tiva_guids.h - GUIDs associated with TivaWare USB examples
//
// Copyright (c) 2008-2014 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
//
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 2.1.0.12573 of the Tiva Firmware Development Package.
//
//*****************************************************************************
#ifndef _TIVA_GUIDS_
#define _TIVA_GUIDS_
//
// Vendor and Product IDs for the generic bulk device.
//
#define BULK_VID 0x1cbe
#define BULK_PID 0x0003
//
// Tiva Bulk Device Class GUID
// {F5450C06-EB58-420e-8F98-A76C5D4AFB18}
//
DEFINE_GUID(GUID_DEVCLASS_TIVA_BULK,
0xF5450C06, 0xEB5B, 0x420E, 0x8F, 0x98, 0xA7, 0x6C, 0x5D, 0x4A, 0xFB, 0x18);
//
// Tiva Bulk Device Interface GUID
// {6E45736A-2B1B-4078-B772-B3AF2B6FDE1C}
//
DEFINE_GUID(GUID_DEVINTERFACE_TIVA_BULK,
0x6E45736A, 0x2B1B, 0x4078, 0xB7, 0x72, 0xb3, 0xAF, 0x2B, 0x6F, 0xDE, 0x1C);
#endif
|
//
// TKCoverflowView.h
// Created by Devin Ross on 1/3/10.
//
/*
tapku.com || http://github.com/devinross/tapkulibrary
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
#import <QuartzCore/QuartzCore.h>
#import <UIKit/UIKit.h>
@protocol TKCoverflowViewDelegate,TKCoverflowViewDataSource;
@class TKCoverflowCoverView;
@interface TKCoverflowView : UIScrollView <UIScrollViewDelegate> {
NSMutableArray *coverViews; // sequential covers
NSMutableArray *views; // only covers view (no nulls)
NSMutableArray *yard; // covers ready for reuse (ie. graveyard)
float origin;
BOOL movingRight;
UIView *currentTouch;
NSRange deck;
int margin, coverBuffer, currentIndex, numberOfCovers;
CGSize coverSize,currentSize;
float coverSpacing,coverAngle,spaceFromCurrent;
CATransform3D leftTransform, rightTransform;
// SPEED
int pos;
long velocity;
id <TKCoverflowViewDelegate> delegate;
id <TKCoverflowViewDataSource> dataSource;
}
@property (nonatomic, assign) id <TKCoverflowViewDelegate> delegate;
@property (nonatomic, assign) id <TKCoverflowViewDataSource> dataSource;
@property (nonatomic, assign) CGSize coverSize; // default 224 x 224
@property (nonatomic, assign) int numberOfCovers;
@property (nonatomic, assign) float coverSpacing;
@property (nonatomic, assign) float coverAngle;
- (TKCoverflowCoverView*) dequeueReusableCoverView; // like a tableview
- (TKCoverflowCoverView*) coverAtIndex:(int)index; // returns nil if cover is outside active range
- (int) indexOfFrontCoverView;
- (void) bringCoverAtIndexToFront:(int)index animated:(BOOL)animated;
@end
@protocol TKCoverflowViewDelegate <NSObject>
@required
- (void) coverflowView:(TKCoverflowView*)coverflowView coverAtIndexWasBroughtToFront:(int)index;
@optional
- (void) coverflowView:(TKCoverflowView*)coverflowView coverAtIndexWasDoubleTapped:(int)index;
@end
@protocol TKCoverflowViewDataSource <NSObject>
@required
- (TKCoverflowCoverView*) coverflowView:(TKCoverflowView*)coverflowView coverAtIndex:(int)index;
@end |
#ifndef SINGLETON_H
#define SINGLETON_H
#include <string>
class Singleton
{
public:
virtual ~Singleton() = default;
virtual std::string getSingletonName() = 0;
};
#endif // SINGLETON_H
|
C $Header$
C $Name$
#include "PACKAGES_CONFIG.h"
c ================================================================
c HEADER TAMC
c ================================================================
c
c o Header for the use of the Tangent Linear and Adjoint Model
c Compiler (TAMC).
c
c started: Christian Eckert eckert@mit.edu 04-Feb-1999
c changed: Patrick Heimbach heimbach@mit.edu 06-Jun-2000
c - New parameter nlevchk_0 for dimensionalising
c common blocks in the undef ALLOW_TAMC_CHECKPOINTING case
c - nhreads_chkpt was declared at the wrong place
c - new keys, separate for different packages
c ================================================================
c HEADER TAMC
c ================================================================
c TAMC checkpointing parameters:
c ==============================
c
c The checkpointing parameters have to be consistent with other model
c parameters and variables. This has to be checked before the model is
c run.
c
c nyears_chkpt - Number of calendar years affected by the assimilation
c experiment; nyears_chkpt has to be at least equal to
c the result of cal_IntYears(mythid).
c nmonths_chkpt - Number of months per year; nmonth_chkpt has to be at
c least equal to nmonthyear.
c ndays_chkpt - Number of days per month; nday_chkpt has to be at least
c equal to nmaxdaymonth.
c nsteps_chkpt - Number of steps per day; nsteps_chkpt has to be at
c least equal to cal_nStepDay(mythid)
c ncheck_chkpt - Number of innermost checkpoints.
c
c ngeom_chkpt - Geometry factor.
c nthreads_chkpt - Number of threads to be used; nth_chkpt .eq. nTx*nTy
integer nyears_chkpt
integer nmonths_chkpt
integer ndays_chkpt
integer ngeom_chkpt
integer ncheck_chkpt
integer nthreads_chkpt
parameter (nyears_chkpt = 1 )
parameter (nmonths_chkpt = 12 )
parameter (ndays_chkpt = 31 )
parameter (ngeom_chkpt = nr*nsx*nsy )
parameter (ncheck_chkpt = 6 )
parameter ( nthreads_chkpt = 1 )
#ifdef ALLOW_TAMC_CHECKPOINTING
integer nchklev_1
parameter( nchklev_1 = 2 )
integer nchklev_2
parameter( nchklev_2 = 50 )
integer nchklev_3
parameter( nchklev_3 = 50 )
c-- Note always check for the correct sizes of the common blocks!
#else /* ALLOW_TAMC_CHECKPOINTING undefined */
integer nchklev_0
parameter( nchklev_0 = 64800 )
#endif /* ALLOW_TAMC_CHECKPOINTING */
c TAMC keys:
c ==========
c
c The keys are used for storing and reading data of the reference
c trajectory.
c
c The convention used here is:
c ikey_<name>
c
c which means that this key is used in routine <name> for reading
c and writing data.
common /tamc_keys_i/
& ikey_dynamics,
& ikey_yearly,
& ikey_daily_1,
& ikey_daily_2,
& iloop_daily
integer ikey_dynamics
integer ikey_yearly
integer ikey_daily_1
integer ikey_daily_2
integer iloop_daily
INTEGER isbyte
#ifdef ALLOW_TAMC_SINGLEPREC_COMLEV
PARAMETER( isbyte = 4 )
#else
PARAMETER( isbyte = 8 )
#endif
INTEGER maximpl
PARAMETER( maximpl = 6 )
#ifdef ALLOW_PTRACERS
cph moved this to PTRACERS_SIZE.h
cph INTEGER maxpass
cph PARAMETER( maxpass = PTRACERS_num + 2 )
#else
INTEGER maxpass
PARAMETER( maxpass = 3 )
#endif
INTEGER maxcube
PARAMETER( maxcube = 3 )
INTEGER act0, act1, act2, act3, act4
INTEGER max0, max1, max2, max3
INTEGER iikey, kkey, passkey, igadkey,
& itdkey, idynkey, igmkey
c ================================================================
c END OF HEADER TAMC
c ================================================================
|
#pragma once
#ifndef GUID_6982DB1EB5D04F939E5EFCBA3B0D17EA
#define GUID_6982DB1EB5D04F939E5EFCBA3B0D17EA
/*! @file
iunit_test.h contains definition of
IUnitTest, unit test class interface.
This codes shows how to make unit tests.
@par
@code
// --- Class declaration part
that can be divided to header file --- //
#include "CBase.h"
#include "iunit_test.h"
UNIT_TEST(CDerived)
class CDerived : public CBase
{
public:
bool derived();
};
// -------------- Class definition -------------- //
bool derived();
// -------------- Unit test definition -------------- //
UNIT_TEST_FUNC(CDerived)
{
CDerived obj;
if (obj.derived() != true)
throw 0;
return true;
}
@endcode
Let's see in detail.
@code
#include "CBase.h"
@endcode
If CBase also has a unit test defined in "CBase.h",
CBase will be certainly tested before CDerived tested.
@code
UNIT_TEST(CDerived)
@endcode
CDerived is not even declared yet,
another class, named TEST_CDerived was
defined and created here.<br \>
In the constructor of TEST_CDerived,
it goes to register pointer
to the static list IUnitTest has.<br \>
It will succeed unless a pointer of the same class that
exists within other translation unit had already registered.
@code
UNIT_TEST_FUNC(CDerived) { ... }
@endcode
This is a declaration of TEST_CDerived::test().
One can give it definition in the next.
These created tests are available from anywhere
after reached a entry point of a program.
@code
IUnitTest::PerformUnitTest();
@endcode
This function executes respective test functions regisered.
To be said generally, these gimmicks are...
@li Runtime test
@li Available in anywhere
@li Available with single call
@li Ignored if release build.
@li Not rebuked by CrtDbg, macros to select memory leaks.
@li Capable to be in cpp files so not increase class headers
despite MAKE_PATH macro.
@li Capable to sort tests by relationships of classes.
*/
#ifndef STDAFX_H
#include <vector>
#include <typeinfo>
#endif
#include "ienumlator.h"
/*! Unit test class interface.
See also iunit_test.h to know how to make unit tests.
*/
class IUnitTest {
private:
class Enumlator;
public:
virtual ~IUnitTest() {}
//! Executes the unit test.
virtual bool test() = 0;
//! Executes all registered unit tests.
static void PerformUnitTest() {
#ifdef _DEBUG
int nUnitTest = ncodes(0);
IUnitTest* p = 0;
for (int i = 0; i < nUnitTest; i++) {
p = GetUnitTest(i);
if (p->test() == false)
throw 0;
}
#endif
}
//! Adds a pointer of unit test to the list.
template<class T>
static bool PushUnitTest() {
static T t;
for (int i = ncodes(0); i; i--) {
if (GetUnitTest(i) == &t)
return false;
}
GetUnitTest(ncodes(0)) = &t;
ncodes(1);
return true;
}
static int Size() { return ncodes(0); }
static Enumlator GetEnumlator() {
return Enumlator(&GetUnitTest(0));
}
private:
static IUnitTest*& GetUnitTest(int n) {
static IUnitTest* ar[kUnitTestMax];
return ar[n];
}
static int ncodes(int add) {
static int n = 0;
int ret = n;
n += add;
return ret;
}
static constexpr int kUnitTestMax = 255;
private:class Enumlator : public ::basis::IEnumlator<IUnitTest*>
{
public:
Enumlator(IUnitTest** p) : m_p(p), m_end(0) {}
bool next() override {
if (!m_end)
m_end = m_p + IUnitTest::Size();
if (m_p == m_end)
return false;
++m_p;
return (m_p != m_end);
}
bool empty() const override {
return m_p == m_end;
}
IUnitTest*& get() override {
return *m_p;
}
private:
IUnitTest **m_p;
IUnitTest **m_end;
}; // Enumlator
}; // IUnitTest
#ifdef _DEBUG
/*! Gives a test class definition and its substance.
The object add itself to a list of test codes as it created.
*/
#define UNIT_TEST(hoge) struct TEST_##hoge : public IUnitTest {\
bool test() override; };\
static bool TEST_##hoge##_TRIGGER = IUnitTest::PushUnitTest<TEST_##hoge>();
#else
#define UNIT_TEST(hoge) namespace {\
struct TEST_##hoge { bool test(); }; }
#endif
/*! Defines a test function of hoge class.
See a sample below.
@code
UNIT_TEST_FUNC(hoge) { return true; }
@endcode
This will be expanded to be something like below.
@code
bool TEST_hoge() { return true; }
@endcode
UNIT_TEST and UNIT_TEST_FUNC macros allows one to be
ignorant which classes provide test functions.
*/
#define UNIT_TEST_FUNC(hoge) bool TEST_##hoge##::test()
/*! @class hoge
Dummy name for certain macros.
*/
#endif |
// Copyright (c) 2015 fjz13. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
#pragma once
#include "Resource/Effect/Pass/IRenderPass.h"
#include "Graphics/State/ProgramRenderState.h"
#include "Resource/ResourceNames.h"
#include "Core/Collection/Array.h"
MEDUSA_BEGIN;
class BaseProgramRenderPass :public IRenderPass
{
public:
BaseProgramRenderPass(const FileIdRef& fileId, const Share<IShader>& vertexShader, const Share<IShader>& pixelShader, int index = 0);
virtual ~BaseProgramRenderPass();
virtual void Apply();
virtual void Restore();
virtual bool IsCustom()const { return false; }
virtual bool Initialize();
virtual bool Uninitialize();
uint Program() const { return mProgramState->Program(); }
bool IsLinked() const { return mProgramState->Program() != 0 && mIsLinked; }
ShaderUniform* FindUniform(const StringRef& name)const;
ShaderAttribute* FindAttribute(const StringRef& name)const;
ShaderAttribute* FindAttributeByIndex(ShaderAttributeIndex index)const;
const Share<IShader>& VertexShader() const { return mVertexShader; }
const Share<IShader>& PixelShader() const { return mPixelShader; }
virtual void UpdateShaderUniforms(RenderingStep step);
virtual void Validate();
virtual void Invalidate();
private:
void Link();
bool TryAddToManagedAttributes(const StringRef& name, ShaderAttribute* val);
protected:
Share<IShader> mVertexShader;
Share<IShader> mPixelShader;
//render states
Share<ProgramRenderState> mProgramState;
bool mIsLinked = false;
Dictionary<HeapString, ShaderUniform*> mUniforms;
Dictionary<HeapString, ShaderAttribute*> mAttributes;
Array<ShaderAttribute*, (uint)ShaderAttributeIndex::Count> mManagedAttributes;
};
MEDUSA_END; |
/*Lib terminal.h for Windows and Linux*/
/*Adalberto Amorim Felipe -- License MIT*/
/*use #define _NO_READLINE to not use libreadline (it needs install and links -lreadline)*/
#if defined (_WIN32) || defined (_WIN64) || defined(WIN32)
#define __win
#endif
//it sets the foreground color.
//color can be: tBlack,tBlue,tGreen,tCyan,tRed,tMagenta,tYellow,
//tGray,tLightGray,tLightBlue,tLightGreen,tLightCyan,tLightRed,tLightMagenta,tLightYellow,tWhite
void t_setforeground(int color);
//set title for terminal
void t_settitle(const char* title);
//it reset the colors to default.
void t_setdefault();
//it sets the background color of terminal
void t_setbackground(int color);
//it cleans the screen of terminal
void t_cls();
//the cursor goes at the position x : y in the terminal.
void t_gotoxy(int x, int y);
//this function returns zero if key was pressed otherwise another value...
int t_kbhit();
//it gets the char without RETURN / ENTER press, but do not puts it on terminal.
int t_getch();
//it gets the char (without RETURN / ENTER press) and puts it on terminal.
int t_getche();
//it retrieves the size of terminal lines and cols, ex.: int lines=0, cols=0; t_getsize(&lines, &cols); ...
void t_getsize(int*lines,int*cols);
/* for Linux only (yet)*/
char *t_readline(const char *str);//returns a string prompt and wait for user input...
void t_add_history(const char *str); //adds a string *str into history for key up and key down...
/* END for Linux only (yet)*/
#ifdef __win //both win32 and win64
#include "terminalwin.h"
#else
#include "terminallinux.h"
#endif
|
/*
* Copyright 2017 cyWren Systems, Inc. All Rights Reserved.
* Additions Copyright 2016 Espressif Systems (Shanghai) PTE LTD
*
* 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.
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <unistd.h>
#include <limits.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "esp_event_loop.h"
#include "esp_log.h"
#include <driver/i2c.h>
#include "sdkconfig.h"
#include "si7021.h"
//////////////////////////////////////////////////////////
// I2C port 0 master initialization
static void i2c_master_init() {
ESP_LOGD("i2c_master_init", "entry");
int i2c_master_port = I2C_NUM_0;
i2c_config_t conf;
conf.mode = I2C_MODE_MASTER;
conf.sda_io_num = CONFIG_ADAFRUIT_SDA_PIN;
conf.sda_pullup_en = GPIO_PULLUP_ENABLE;
conf.scl_io_num = CONFIG_ADAFRUIT_SCL_PIN;
conf.scl_pullup_en = GPIO_PULLUP_ENABLE;
conf.master.clk_speed = 100000;
ESP_LOGD("i2c_master_init", "setting param config");
i2c_param_config(i2c_master_port, &conf);
ESP_LOGD("i2c_master_init", "installing driver");
i2c_driver_install(i2c_master_port, conf.mode, 0, 0, 0);
ESP_LOGD("i2c_master_init", "exit");
}
//////////////////////////////////////////////////////////
// Main task - read humidity and fahrenheit temperature
void main_task(void *pvParameter) {
ESP_LOGD("main_task", "entry");
while (true) {
float humidity = si7021_read_humidity();
printf("SI7021 humidity = %5.2f",humidity);
float fahrenheit = si7021_read_temperature(FAHRENHEIT);
printf("\t%5.2f F\n",fahrenheit);
vTaskDelay(5000 / portTICK_RATE_MS);
}
}
//////////////////////////////////////////////////////////
// app main logic
void app_main()
{
ESP_LOGD("app_main", "initialize I2C port 0 master");
i2c_master_init();
ESP_LOGD("app_main", "initialize SI7020 sensor");
si2071_init((i2c_port_t)I2C_NUM_0, (uint8_t)SI7021_DEFAULT_ADDRESS);
ESP_LOGD("app_main", "create and launch main_task");
xTaskCreate(&main_task, "main_task", 2048, NULL, 5, NULL);
}
|
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <React/RCTViewManager.h>
#import <React/RCTUIManager.h>
|
/**************************************************************************/
/*!
@file binary.h
@author hathach (tinyusb.org)
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2013, K. Townsend (microBuilder.eu)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
*/
/**************************************************************************/
/** \ingroup TBD
* \defgroup TBD
* \brief TBD
*
* @{
*/
#ifndef _BINARY_H_
#define _BINARY_H_
#ifdef __cplusplus
extern "C" {
#endif
/// n-th Bit
#define BIT(n) (1 << (n))
/// set n-th bit of x to 1
#define BIT_SET(x, n) ( (x) | BIT(n) )
/// clear n-th bit of x
#define BIT_CLR(x, n) ( (x) & (~BIT(n)) )
/// test n-th bit of x
#define BIT_TEST(x, n) ( (x) & BIT(n) )
#if defined(__GNUC__) && !defined(__CC_ARM) // keil does not support binary format
#define BIN8(x) ((uint8_t) (0b##x))
#define BIN16(b1, b2) ((uint16_t) (0b##b1##b2))
#define BIN32(b1, b2, b3, b4) ((uint32_t) (0b##b1##b2##b3##b4))
#else
// internal macro of B8, B16, B32
#define _B8__(x) (((x&0x0000000FUL)?1:0) \
+((x&0x000000F0UL)?2:0) \
+((x&0x00000F00UL)?4:0) \
+((x&0x0000F000UL)?8:0) \
+((x&0x000F0000UL)?16:0) \
+((x&0x00F00000UL)?32:0) \
+((x&0x0F000000UL)?64:0) \
+((x&0xF0000000UL)?128:0))
#define BIN8(d) ((uint8_t) _B8__(0x##d##UL))
#define BIN16(dmsb,dlsb) (((uint16_t)BIN8(dmsb)<<8) + BIN8(dlsb))
#define BIN32(dmsb,db2,db3,dlsb) \
(((uint32_t)BIN8(dmsb)<<24) \
+ ((uint32_t)BIN8(db2)<<16) \
+ ((uint32_t)BIN8(db3)<<8) \
+ BIN8(dlsb))
#endif
#ifdef __cplusplus
}
#endif
#endif /* _BINARY_H_ */
/** @} */
|
//
// StoryImageInfoViewController.h
// Storyboard
//
// Created by Maria Montserrat Lozano on 12/02/14.
// Copyright (c) 2014 ITESM. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface StoryImageInfoViewController : UIViewController
@property (strong, nonatomic) IBOutlet UILabel *alturaLabel;
@property (strong, nonatomic) IBOutlet UILabel *anchoLabel;
//no es clase por eso no lleva asterisco
@property CGFloat alto;
@property CGFloat ancho;
@end
|
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef HRTFElevation_h
#define HRTFElevation_h
#include "HRTFKernel.h"
#include <memory>
#include <wtf/Noncopyable.h>
#include <wtf/RefPtr.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
// HRTFElevation contains all of the HRTFKernels (one left ear and one right ear per azimuth angle) for a particular elevation.
class HRTFElevation {
WTF_MAKE_NONCOPYABLE(HRTFElevation);
public:
HRTFElevation(std::unique_ptr<HRTFKernelList> kernelListL, std::unique_ptr<HRTFKernelList> kernelListR, int elevation, float sampleRate)
: m_kernelListL(WTFMove(kernelListL))
, m_kernelListR(WTFMove(kernelListR))
, m_elevationAngle(elevation)
, m_sampleRate(sampleRate)
{
}
// Loads and returns an HRTFElevation with the given HRTF database subject name and elevation from browser (or WebKit.framework) resources.
// Normally, there will only be a single HRTF database set, but this API supports the possibility of multiple ones with different names.
// Interpolated azimuths will be generated based on InterpolationFactor.
// Valid values for elevation are -45 -> +90 in 15 degree increments.
static std::unique_ptr<HRTFElevation> createForSubject(const String& subjectName, int elevation, float sampleRate);
// Given two HRTFElevations, and an interpolation factor x: 0 -> 1, returns an interpolated HRTFElevation.
static std::unique_ptr<HRTFElevation> createByInterpolatingSlices(HRTFElevation* hrtfElevation1, HRTFElevation* hrtfElevation2, float x, float sampleRate);
// Returns the list of left or right ear HRTFKernels for all the azimuths going from 0 to 360 degrees.
HRTFKernelList* kernelListL() { return m_kernelListL.get(); }
HRTFKernelList* kernelListR() { return m_kernelListR.get(); }
double elevationAngle() const { return m_elevationAngle; }
unsigned numberOfAzimuths() const { return NumberOfTotalAzimuths; }
float sampleRate() const { return m_sampleRate; }
// Returns the left and right kernels for the given azimuth index.
// The interpolated delays based on azimuthBlend: 0 -> 1 are returned in frameDelayL and frameDelayR.
void getKernelsFromAzimuth(double azimuthBlend, unsigned azimuthIndex, HRTFKernel* &kernelL, HRTFKernel* &kernelR, double& frameDelayL, double& frameDelayR);
// Spacing, in degrees, between every azimuth loaded from resource.
static const unsigned AzimuthSpacing;
// Number of azimuths loaded from resource.
static const unsigned NumberOfRawAzimuths;
// Interpolates by this factor to get the total number of azimuths from every azimuth loaded from resource.
static const unsigned InterpolationFactor;
// Total number of azimuths after interpolation.
static const unsigned NumberOfTotalAzimuths;
// Given a specific azimuth and elevation angle, returns the left and right HRTFKernel.
// Valid values for azimuth are 0 -> 345 in 15 degree increments.
// Valid values for elevation are -45 -> +90 in 15 degree increments.
// Returns true on success.
static bool calculateKernelsForAzimuthElevation(int azimuth, int elevation, float sampleRate, const String& subjectName,
RefPtr<HRTFKernel>& kernelL, RefPtr<HRTFKernel>& kernelR);
// Given a specific azimuth and elevation angle, returns the left and right HRTFKernel in kernelL and kernelR.
// This method averages the measured response using symmetry of azimuth (for example by averaging the -30.0 and +30.0 azimuth responses).
// Returns true on success.
static bool calculateSymmetricKernelsForAzimuthElevation(int azimuth, int elevation, float sampleRate, const String& subjectName,
RefPtr<HRTFKernel>& kernelL, RefPtr<HRTFKernel>& kernelR);
private:
std::unique_ptr<HRTFKernelList> m_kernelListL;
std::unique_ptr<HRTFKernelList> m_kernelListR;
double m_elevationAngle;
float m_sampleRate;
};
} // namespace WebCore
#endif // HRTFElevation_h
|
/*
* Copyright (C) 2016 Ingenic Semiconductor
*
* ZhangTao(Kevin) <tao.zhang@ingenic.com>
*
* Elf/IWDS Project
*/
#import <Foundation/Foundation.h>
#import "IWDSSafeParcelable.h"
/** 天气预报信息类 */
@interface WeatherInfoArray : NSObject <IWDSSafeParcelable>
/** 天气预报数据 */
@property (copy, nonatomic) NSArray *data;
/** 通过天气信息数组初始化天气预报 */
- (instancetype)initWithArray:(NSArray *)weatherArray;
@end
/** 天气信息类 */
@interface WeatherInfo : NSObject <IWDSSafeParcelable>
/** 城市. */
@property (copy, nonatomic) NSString *city;
/** 天气描述(比如:多云). */
@property (copy, nonatomic) NSString *weather;
/** 天气图标代码(引用自雅虎天气). */
@property (copy, nonatomic) NSString *weatherCode;
/** 日期. */
@property (copy, nonatomic) NSString *date;
/** 星期. */
@property (copy, nonatomic) NSString *dayOfWeek;
/** 发布时间. */
@property (copy, nonatomic) NSString *updateTime;
/** 气温单位('c'摄氏度,'f'华氏度). */
@property (copy, nonatomic) NSString *tempUnit;
/** 当前实时气温. */
@property (assign, nonatomic) int currentTemp;
/** 最低气温. */
@property (assign, nonatomic) int minimumTemp;
/** 最高气温. */
@property (assign, nonatomic) int maximumTemp;
/** 日期索引. */
@property (assign, nonatomic) int dayIndex;
@end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.