text stringlengths 4 6.14k |
|---|
#ifndef TUVOK_STACK_TIMER_H
#define TUVOK_STACK_TIMER_H
#include "Basics/PerfCounter.h"
#include "Basics/Timer.h"
#include "Controller.h"
namespace tuvok {
/// Simple mechanism for timing blocks of code. Create a StackTimer on
/// the stack and it will record timing information when it goes out of
/// scope. For example:
///
/// if(doLongComplicatedTask) {
/// StackTimer task_identifier(PERF_DISK_READ);
/// this->Function();
/// }
struct StackTimer {
StackTimer(enum PerfCounter pc) : counter(pc) {
timer.Start();
}
~StackTimer() {
Controller::Instance().IncrementPerfCounter(counter, timer.Elapsed());
}
enum PerfCounter counter;
Timer timer;
};
}
/// For short blocks, it may be easier to use this macro:
///
/// TimedStatement(PERF_DISK_READ, this->Function());
#define TimedStatement(pc, block) \
do { \
tuvok::StackTimer _generic_timer(pc); \
block; \
} while(0)
#endif
/*
For more information, please see: http://software.sci.utah.edu
The MIT License
Copyright (c) 2013 IVDA Group
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 _MESH_
#define _MESH_
/* External Variables */
extern int NNodes,NGEdges,NLoops,NSubBodies,NBodies;
extern int NUMPTS,*N,*LIST,*BIN,*V,*E,NUMTRI,*NT;
extern double hsize;
extern double *X;
extern double *coord;
extern GEdge *GEdges;
extern Loop *Loops;
extern SubBody *SubBodies;
extern Body *Bodies;
extern double *GridX; /* GridX[] is the global coord. array for */
/* nodes inserted inside the boundary. */
extern int GridN; /* GridN = number of pts inserted inside */
/* the boundary. */
/* Funtion Prototypes */
void MeshEdges(void);
int NumNewElmts(GEdge *edge, double h);
void TGridInsert(double h, double base, double x0, double y0);
void PGridInsert(double h, double base, double height, double x0, double y0);
void PrintGrid(void);
int NearBndry(double x, double y);
void InsertNodes(void);
void PrintNodes(void);
void PrintElements(void);
void PrintElements2(void);
void rmTriang(int T);
void rmExtElmts(void);
void connectSBmeshes(void);
extern void deltri_(int *, int *, double *,
int *, int *, int *, int *, int *);
#endif _MESH_
|
#ifndef SMTL_BYTECODE_PARSER_H
#define SMTL_BYTECODE_PARSER_H
#include <string>
using namespace std;
#define SMTL_CPU_VMEM 59
#define SMTL_CPU_MEM 255
#define SMTL_CPU_BIOS 200
class SmtlCpu
{
private:
int pc;
unsigned char a,b,c,d;
signed char s;
char vmem[SMTL_CPU_VMEM];
void processOpcode(char opcode);
public:
void step();
int execute(char opcode[],int num);
char memory[SMTL_CPU_MEM];
char bios[SMTL_CPU_BIOS];
void executeBios(const char* toload);
void executeBiosInstruction(char op);
int doOp(char opcode);
bool isExecuting;
SmtlCpu();
bool isDebugging;
};
#endif
|
/*
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
*/
#ifndef __ARCH_SYS_ARCH_H__
#define __ARCH_SYS_ARCH_H__
#include "SafeRTOS/SafeRTOS_API.h"
/* Find the size of the largest required mbox. */
#define MAX1 ((TCPIP_MBOX_SIZE > DEFAULT_RAW_RECVMBOX_SIZE) ? \
TCPIP_MBOX_SIZE : DEFAULT_RAW_RECVMBOX_SIZE)
#define MAX2 ((MAX1 > DEFAULT_UDP_RECVMBOX_SIZE) ? MAX1 : \
DEFAULT_UDP_RECVMBOX_SIZE)
#define MAX3 ((MAX2 > DEFAULT_TCP_RECVMBOX_SIZE) ? MAX2 : \
DEFAULT_TCP_RECVMBOX_SIZE)
#define MBOX_MAX ((MAX3 > DEFAULT_ACCEPTMBOX_SIZE) ? MAX3 : \
DEFAULT_ACCEPTMBOX_SIZE)
/* A structure to hold the variables for a sys_sem_t. */
typedef struct {
xQueueHandle queue;
signed char buffer[sizeof(void *) + portQUEUE_OVERHEAD_BYTES];
} sem_t;
/* A structure to hold the variables for a sys_mbox_t. */
typedef struct {
xQueueHandle queue;
signed char buffer[(sizeof(void *) * MBOX_MAX) + portQUEUE_OVERHEAD_BYTES];
} mbox_t;
/* Typedefs for the various port-specific types. */
typedef mbox_t *sys_mbox_t;
typedef u8_t sys_prot_t;
typedef sem_t *sys_sem_t;
typedef xTaskHandle sys_thread_t;
/* The value for an unallocated mbox. */
#define SYS_MBOX_NULL 0
#endif /* __ARCH_SYS_ARCH_H__ */
|
/*****************************************************************************
The following code is derived, directly or indirectly, from the SystemC
source code Copyright (c) 1996-2011 by all Contributors.
All Rights reserved.
The contents of this file are subject to the restrictions and limitations
set forth in the SystemC Open Source License Version 3.0 (the "License");
You may not use this file except in compliance with such restrictions and
limitations. You may obtain instructions on how to receive a copy of the
License at http://www.systemc.org/. Software distributed by Contributors
under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
*****************************************************************************/
#ifndef __TLM_GLOBAL_QUANTUM_H__
#define __TLM_GLOBAL_QUANTUM_H__
#include <systemc>
namespace tlm {
//
// tlm_global_quantum class
//
// The global quantum is the maximum time an initiator can run ahead of
// systemC time. All initiators should synchronize on timingpoints that
// are multiples of the global quantum value.
//
// sc_set_time_resolution can only be called before the first
// sc_time object is created. This means that after setting the
// global quantum it will not be possible to call sc_set_time_resolution.
// If sc_set_time_resolution must be called this must be done before
// the global quantum is set.
//
class tlm_global_quantum
{
public:
//
// Returns a reference to the tlm_global_quantum singleton
//
static tlm_global_quantum& instance()
{
static tlm_global_quantum instance_;
return instance_;
}
public:
//
// Setter/getter for the global quantum
//
void set(const sc_core::sc_time& t)
{
m_global_quantum = t;
}
const sc_core::sc_time& get() const
{
return m_global_quantum;
}
//
// This function will calculate the maximum value for the next local
// quantum for an initiator. All initiators should synchronize on
// integer multiples of the global quantum value. The value for the
// local quantum of an initiator can be smaller, but should never be
// greater than the value returned by this method.
//
sc_core::sc_time compute_local_quantum()
{
if (m_global_quantum != sc_core::SC_ZERO_TIME) {
const sc_dt::uint64 current = sc_core::sc_time_stamp().value();
const sc_dt::uint64 g_quant = m_global_quantum.value();
const sc_dt::uint64 tmp = (current/g_quant+sc_dt::uint64(1)) * g_quant;
const sc_core::sc_time remainder = sc_core::sc_time(tmp - current,
false);
return remainder;
} else {
return sc_core::SC_ZERO_TIME;
}
}
protected:
tlm_global_quantum() : m_global_quantum(sc_core::SC_ZERO_TIME)
{
}
protected:
sc_core::sc_time m_global_quantum;
};
} // namespace tlm
#endif
|
/*
* apdu.c
*
* Created on: 30 Mar 2017
* Author: C. TORR, MAOSCO Ltd
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h> // Used for Shared Memory
#include <sys/ipc.h> // Used for Shared Memory
#include <sys/shm.h> // Used for Shared Memory
#include "../multosSerialInterface/multosShared.h"
extern void multosHexToBin(char *hexIn, unsigned char *binOut, int len);
unsigned short multosSendAPDU(unsigned char CLA, unsigned char INS, unsigned char P1, unsigned char P2, unsigned char Lc, unsigned char Le, unsigned char *La, unsigned char case4, unsigned char *data, int dataBuffLen, unsigned long maxWait)
{
DWORD wait = 0;
WORD sw12 = 0;
DWORD myPid = 0;
multosShared_t *sharedMem = NULL;
key_t sharedMemKey;
int sharedMemId;
myPid = getpid();
// Attach to shared memory segment if needed
if(sharedMem == NULL)
{
sharedMemKey = ftok(MULTOS_SHARED_MEM_LOC,'R');
sharedMemId = shmget(sharedMemKey,sizeof(multosShared_t),0);
sharedMem = (multosShared_t*)shmat(sharedMemId,NULL,0);
if((void*)sharedMem == (void*)-1)
{
fprintf(stderr,"Failed to open shared memory\n");
return(0xFFFF);
}
}
// Wait for MULTOS device to be available
while(wait < maxWait && sharedMem->status != AVAILABLE)
{
wait += 10;
usleep(10000);
}
if(sharedMem->status != AVAILABLE)
{
shmdt(sharedMem);
return(0xFFFF);
}
// Request it
sharedMem->requestingPid = myPid;
sharedMem->status = REQUESTED;
// Wait for confirmation
while(wait < maxWait && sharedMem->status != CONNECTED)
{
wait += 10;
usleep(10000);
}
if(sharedMem->status != CONNECTED || sharedMem->connectedPid != myPid)
{
shmdt(sharedMem);
return(0xFFFF);
}
// Prepare message in shared memory
sharedMem->CLA = CLA;
sharedMem->INS = INS;
sharedMem->P1 = P1;
sharedMem->P2 = P2;
sharedMem->Lc = Lc;
sharedMem->Le = Le;
sharedMem->case4 = case4;
sharedMem->timeout = maxWait;
if(Lc > 0 && data)
memcpy(sharedMem->data,data,Lc <= MULTOS_SHARED_MAX_DATA ? Lc : MULTOS_SHARED_MAX_DATA);
// Trigger the processing
sharedMem->status = CMD_READY;
usleep(50000);
// Wait for a reply
wait = 0;
while(wait < maxWait && sharedMem->status != RESULT_AVAILABLE)
{
wait += 10;
usleep(10000);
}
if(sharedMem->status == RESULT_AVAILABLE && sharedMem->connectedPid == myPid)
{
sw12 = sharedMem->SW12;
if(La != NULL)
*La = sharedMem->La;
if(*La > 0 && data != NULL)
memcpy(data,sharedMem->data,*La <= dataBuffLen ? *La : dataBuffLen);
// Tell daemon we're done and wait for confirmation of disconnection
sharedMem->requestingPid = myPid;
sharedMem->status = DISCONNECT;
wait = 0;
while(wait < maxWait && sharedMem->connectedPid != 0)
{
wait += 10;
usleep(10000);
}
if(sharedMem->connectedPid != 0)
sw12 = 0xFFFF;
}
else
{
// Something went wrong.
sw12 = 0xFFFF;
}
shmdt(sharedMem);
return(sw12);
}
int multosSelectApplication (char *hexAid)
{
unsigned char aidLen, La;
unsigned short sw;
unsigned char aid[16];
aidLen = strlen(hexAid) / 2;
if(aidLen > 16)
aidLen = 16;
multosHexToBin(hexAid,aid,aidLen);
sw = multosSendAPDU(0,0xA4,0x04,0x0C,aidLen,0,&La,0,aid,sizeof(aid),1000);
if(sw == 0x9000)
return(1);
return(0);
}
int multosDeselectCurrApplication()
{
unsigned char aid[] = { 0x3F, 0x00 };
unsigned char La;
unsigned short sw;
sw = multosSendAPDU(0,0xA4,0,0,2,0,&La,0,aid,sizeof(aid),100000);
if(sw == 0x9000)
return(1);
return(0);
}
int multosReset(void)
{
BYTE La;
unsigned short sw;
sw = multosSendAPDU(0xBE,0xFF,0,0,0,0,&La,0,NULL,0,20000);
if(sw == 0x9000)
return(1);
return(0);
}
|
//
// ViewController.h
// WJEncryptionTools
//
// Created by Kevin on 15/4/4.
// Copyright (c) 2015年 Kevin. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#ifdef HAVE_CONFIG_H
#include "../../../ext_config.h"
#endif
#include <php.h>
#include "../../../php_ext.h"
#include "../../../ext.h"
#include <Zend/zend_operators.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_interfaces.h>
#include "kernel/main.h"
/*
This file is part of the php-ext-zendframework package.
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
*/
ZEPHIR_INIT_CLASS(ZendFramework_Mvc_Exception_BadMethodCallException) {
ZEPHIR_REGISTER_CLASS_EX(Zend\\Mvc\\Exception, BadMethodCallException, zendframework, mvc_exception_badmethodcallexception, spl_ce_BadMethodCallException, NULL, 0);
zend_class_implements(zendframework_mvc_exception_badmethodcallexception_ce TSRMLS_CC, 1, zendframework_mvc_exception_exceptioninterface_ce);
return SUCCESS;
}
|
//
// CTKeySet.h
// ConfigurableTests
//
// Created by Sergey Mamontov on 3/11/14.
// Copyright (c) 2014 Sergey Mamontov. All rights reserved.
//
#import <Foundation/Foundation.h>
#pragma mark Public interface declaration
@interface CTKeySet : NSObject
#pragma mark - Properties
@property (nonatomic, readonly, copy) NSString *publishKey;
@property (nonatomic, readonly, copy) NSString *subscribeKey;
@property (nonatomic, readonly, copy) NSString *secretKey;
@property (nonatomic, readonly, copy) NSString *keyDescription;
#pragma mark -
@end
|
/**
* 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
*
* What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
*/
#include <stdio.h>
#include "common/eulersolution.h"
struct euler_state_s
{
long answer;
};
static
size_t
memory
()
{
return sizeof(euler_state);
}
static
euler_state *
solve
(void *p_mem)
{
euler_state *p_state = p_mem;
/* Use this to hold LCM(1:20), which we suspect is less than a long */
long answer = 1;
/* We just care about the prime factorisation of all numbers
* from 1:20. If the prime factors that make up a number have
* already been accounted for by another number, i.e.
* n is equally divisible by (n - p)
* n % (n - p) = 0
* then we just use the remaining prime factors. Seemed
* like doing this manually was the most pragmatic way:
*/
answer *= 20; /* 20 = 2 x 2 x 5 */
answer *= 19; /* 19 = 19 */
answer *= 9 ; /* 18 = 2 x 3 x 3 */
answer *= 17; /* 17 = 17 */
answer *= 4 ; /* 16 = 2 x 2 x 2 x 2 */
answer *= 1 ; /* 15 = 3 x 5 */
answer *= 7 ; /* 14 = 2 x 7 */
answer *= 13; /* 13 = 13 */
answer *= 1 ; /* 12 = 2 x 3 x 3 */
answer *= 11; /* 11 = 11 */
answer *= 1 ; /* 10 = 2 x 5 */
answer *= 1 ; /* 9 = 3 x 3 */
answer *= 1 ; /* 8 = 2 x 2 x 2 */
answer *= 1 ; /* 7 = 7 */
answer *= 1 ; /* 6 = 2 x 3 */
answer *= 1 ; /* 5 = 5 */
answer *= 1 ; /* 4 = 2 x 2 */
answer *= 1 ; /* 3 = 3 */
answer *= 1 ; /* 2 = 2 */
p_state->answer = answer;
return p_state;
}
static
void
render
(const euler_state *p_state
, char *p_str
)
{
sprintf(p_str,"%lu", p_state->answer);
}
static const euler_solution problem00005 =
{
/* name */ "Smallest multiple",
/* memory */ &memory,
/* solve */ &solve,
/* render */ &render,
};
const euler_solution *p_problem00005 = &problem00005;
|
//
// DDMIRequestHandle.h
// HMLoginDemo
//
// Created by lilingang on 15/8/3.
// Copyright (c) 2015年 lilingang. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, DDMIErrorType) {
DDMIErrorUnkwon, //**未知错误*/
DDMIErrorNetworkNotConnected, //**网络未连接*/
DDMIErrorTimeOut, //**网络超时*/
DDMIErrorNotReachServer, //**无法连接服务器*/
DDMIErrorOperationFrequent, //**操作频繁*/
DDMIErrorNeedDynamicToken, //**需要动态令牌*/
DDMIErrorAccountOrPassword, //**账号或密码错误*/
DDMIErrorVerificationCode, //**验证码错误*/
};
typedef void (^DDMIRequestBlock) (NSDictionary *responseDict, NSError *connectionError);
@class DDMIRequestHandle;
@protocol DDMIRequestHandleDelegate <NSObject>
- (void)requestHandle:(DDMIRequestHandle *)requestHandle successedNeedDynamicToken:(BOOL)needDynamicToken;
- (void)requestHandle:(DDMIRequestHandle *)requestHandle failedWithType:(DDMIErrorType)errorType errorMessage:(NSString *)errorMessage error:(NSError *)error;
@end
@interface DDMIRequestHandle : NSObject
@property (nonatomic, weak) id<DDMIRequestHandleDelegate> delegate;
@property (nonatomic, copy, readonly) NSString *account;
- (void)loginWithAccount:(NSString *)account
password:(NSString *)passWord
verifyCode:(NSString *)verifyCode;
- (void)checkOTPCode:(NSString *)OTPCode trustDevice:(BOOL)isTrust;
- (BOOL)getProfileWithAccessToken:(NSString *)accessToken
clientId:(NSString *)clientId
completeHandler:(DDMIRequestBlock)completeHandler;
@end
|
//
// DBViewController.h
// DaBanShi
//
// Created by huangluyang on 14-2-19.
// Copyright (c) 2014年 huangluyang. All rights reserved.
//
@interface DBTabController : UITabBarController
{
}
// Create a view controller and setup it's tab bar item with a title and image
-(UIViewController*) viewControllerWithTabTitle:(NSString*)title image:(UIImage*)image;
// Create a custom UIButton and add it to the center of our tab bar
-(void) addCenterButtonWithImage:(UIImage*)buttonImage highlightImage:(UIImage*)highlightImage;
@end
|
#ifndef VALUES_H
#define VALUES_H
#include <memory>
#include "utility.h"
class State;
class Basic;
class ValueWrapper{
public:
ValueWrapper(std::string name_): name{name_} {};
virtual ~ValueWrapper(){};
virtual void serialize(json& j) const = 0;
void deserialize(const json& j, json& response, State& state){
json command = j.value(get_name(), "{}"_json);
if(command != "{}"_json){
deserialize_specific(command, response, state);
}
};
virtual void deserialize_specific(const json& j, json& response, State& state) = 0;
virtual bool check_ack_updated() {return false;};
virtual std::vector<std::shared_ptr<Basic>> get_added_basic_values() {return {};};
virtual std::vector<std::weak_ptr<Basic>> get_removed_basic_values() {return {};};
void set_name(const std::string name_) {name = name_;};
const std::string get_name() const {return name;};
private:
std::string name;
};
template<class T>
class Value: public ValueWrapper{
public:
Value(std::string name): ValueWrapper{name}{};
virtual ~Value(){};
void serialize(json& j) const override;
void deserialize_specific(const json& j, json& response, State& state) override;
void set(T new_value) {value = new_value;};
operator T() const {return value;};
T& operator+=(const T& rhs){
update(value + rhs);
}
Value<T>& operator=(const T& other);
bool check_ack_updated() {
if(updated){
updated = false;
return true;
}
else{
return false;
}
}
private:
void update(T new_value){
value = new_value;
updated = true;
};
bool updated = false;
T value;
};
template<class T>
class BasicValue: public ValueWrapper{
public:
BasicValue(std::string name): ValueWrapper{name}{};
virtual ~BasicValue(){};
void serialize(json& j) const override;
virtual void deserialize_specific(const json& j, json& response, State & state) override;
void set(std::shared_ptr<T> v) {value=v;};
operator const std::shared_ptr<T>() const {return value;};
operator T&() const {return *value;};
operator T&() {return *value;};
std::shared_ptr<T> operator->() {
return value;
}
const std::shared_ptr<T> operator->() const {
return value;
}
private:
std::shared_ptr<T> value;
};
template<class T>
class LocalBasicValue: public BasicValue<T>{
public:
LocalBasicValue(std::string name): BasicValue<T>{name}{};
void deserialize_specific(const json& j, json& response, State & state) override;
};
template<class T>
class VectorValues: public ValueWrapper{
public:
VectorValues(std::string name): ValueWrapper{name}{};
void serialize(json& j) const override;
void deserialize_specific(const json& j, json& response, State& state) override;
std::vector<std::shared_ptr<T>>& get() {return values;};
const std::vector<std::shared_ptr<T>> get_const() const {return values;};
bool check_ack_updated() {
if(!new_values.empty() or !removed_values.empty()){
ack();
return true;
}
else{
return false;
}
}
std::vector<std::shared_ptr<Basic>> get_added_basic_values() override {return new_values;};
std::vector<std::weak_ptr<Basic>> get_removed_basic_values() override {return removed_values;};
void push_back(std::shared_ptr<T> value);
void push_back(std::shared_ptr<Basic> value);
bool empty() {return values.empty();};
void ack() {new_values.clear(); removed_values.clear();};
T& back() {*values.back();}
T& front() {*values.front();}
void remove_front();
private:
std::vector<std::shared_ptr<Basic>> new_values;
std::vector<std::shared_ptr<T>> values;
std::vector<std::weak_ptr<Basic>> removed_values;
};
template<class T>
Value<T>& Value<T>::operator=(const T& other){
value = other;
return *this;
}
template<class T>
void VectorValues<T>::serialize(json& j) const{
j[get_name()] = "[]"_json;
for(auto& value: values){
json partial = {
{"type", value->get_type()},
{"id", value->get_id()}
};
j[get_name()].push_back(partial);
}
}
template<class T>
void VectorValues<T>::push_back(std::shared_ptr<T> value){
new_values.push_back(value);
values.push_back(value);
}
template<class T>
void VectorValues<T>::push_back(std::shared_ptr<Basic> value){
push_back(std::dynamic_pointer_cast<T>(value));
}
template<class T>
void VectorValues<T>::remove_front(){
if(!empty()){
removed_values.push_back(values.front());
values.erase(values.begin());
}
}
template<class T>
bool operator==(const BasicValue<T>& lhs, const BasicValue<T>& rhs){
return lhs.value == rhs.value;
};
template<class T>
bool operator==(const BasicValue<T>& lhs, const std::shared_ptr<T>& rhs){
return lhs.value == rhs;
};
template<class T>
bool operator==(const std::shared_ptr<T>& lhs, const BasicValue<T>& rhs){
return lhs == std::shared_ptr<T>(rhs);
};
template<class T>
void to_json(json& j, const Value<T>& p){
j[p.get_name()] = p.get_const();
}
template<class T>
void from_json(const json& j, Value<T>& p){
p.value = j[p.name];
}
template<class T>
void Value<T>::serialize(json& j) const{
j[get_name()] = value;
}
template<class T>
void BasicValue<T>::serialize(json& j) const{
j[get_name()] = {
{"type", value->get_type()},
{"id", value->get_id()}
};
}
template<class T>
bool operator==(const Value<T>& lhs, const Value<T>& rhs){
return lhs.value == rhs.value;
};
#endif /* VALUES_H */
|
//
// MyAnnotation.h
// Tsker
//
// Created by Donal Hanna on 29/05/2013.
// Copyright (c) 2013 Donal Hanna. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@interface MyAnnotation : NSObject <MKAnnotation>
{
CLLocationCoordinate2D coordinate;
NSString *title;
NSString *subtitle;
//NSString *annoType;
//MKPinAnnotationColor *pinColor;
}
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *subtitle;
//@property (nonatomic, copy) NSString *annoType;
- (id)initWithCoordinate:(CLLocationCoordinate2D)coord;
- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate;
@end |
#ifndef XENON_GPU_DRAWCALL_H
#define XENON_GPU_DRAWCALL_H
#include <Xenon/GPU/GPU.h>
#include <Xenon/GPU/GLInclude.h>
#include <Red/Util/IRefCounted.h>
namespace Xenon
{
namespace GPU
{
class DrawCall : public virtual Red::Util :: IRefCounted
{
public:
typedef GLenum DrawMode;
static const DrawMode kDrawMode_Point = GL_POINTS;
static const DrawMode kDrawMode_Line_Strip = GL_LINE_STRIP;
static const DrawMode kDrawMode_Line_Loop = GL_LINE_LOOP;
static const DrawMode kDrawMode_Line = GL_LINES;
static const DrawMode kDrawMode_Line_Adjecent = GL_LINES_ADJACENCY;
static const DrawMode kDrawMode_Line_Strip_Adjacent = GL_LINE_STRIP_ADJACENCY;
static const DrawMode kDrawMode_Triangle_Strip = GL_TRIANGLE_STRIP;
static const DrawMode kDrawMode_Triangle_Fan = GL_TRIANGLE_FAN;
static const DrawMode kDrawMode_Triangle = GL_TRIANGLES;
static const DrawMode kDrawMode_Triangle_Strip_Adjacent = GL_TRIANGLE_STRIP_ADJACENCY;
static const DrawMode kDrawMode_Triangle_Adjacency = GL_TRIANGLES_ADJACENCY;
static const DrawMode kDrawMode_Patches = GL_PATCHES;
virtual ~DrawCall () {};
virtual void Draw () = 0;
};
}
}
#endif
|
#ifndef MATRIX_H
# define MATRIX_H
# include "engine.h"
typedef enum e_mtype
{
IDENTITY,
SCALE,
TRANSLATION,
ROTATION,
PROJECTION
} t_mtype;
class Matrix
{
public:
double mat[4][4];
t_mtype type;
Matrix(t_mtype type); // Identity Matrix
Matrix(t_mtype type, double scale); // Scale Matrix
Matrix(t_mtype type, double a, double b, double c);
Matrix(t_mtype type, double fov, double near, double far, double ratio);
void make_translation(double xshift, double yshift, double zshift);
void make_rotation(double xrot, double yrot, double zrot);
Matrix* mult(Matrix *other); // Returns new Matrix
Matrix* reflection();
Vector* transform(Vector *vec); // Modifies same Vector
void mod_angles(double th, double ph, double ps);
void mod_location(double xmod, double ymod, double zmod);
~Matrix();
private:
double alpha;
double beta;
double gamma;
};
#endif
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include "structure.h"
#include "utilities.h"
#include "lyrics_io.h"
//Contains functions pertaining to file i/o
void readLinesToStructure(structure *s, char *filename, int numLines){ //reads untagged lines from file into structure object
FILE *fp;
numLines = getNumLines(filename);
fp = fopen(filename,"r");
fprintf(stderr,"Now parsing '%s'\n",filename);
char *inputLine = malloc(sizeof(char)*256);
while(fgets(inputLine,512,fp) != NULL){
char *temp = malloc(sizeof(char)*512);
strcpy(temp,inputLine);
addLine(s,newLine(temp));
}
fclose(fp);
}
void parseLines(structure *s, char *filename, int numLines){ //tags untagged lines in structure object by feeding them into Parsey McParseFace
FILE *fp;
char *inputLine = malloc(sizeof(char)*512);
int currLine = 1;
for(int i = 0;i<s->lineCount;i++){
if(s->lines[i]->words[0] != '\n'){
char *parsed = makeParseable(toLower(s->lines[i]->words));
fprintf(stderr,"Parsing line %d of %d...\n",currLine,numLines);
currLine++;
system(parsed);
fp = fopen("tmp/output.txt","r"); //if you change the location or name in this file, make sure to also change the corresponding
char *temp = malloc(sizeof(char)*512); //entry in models/syntaxnet/syntaxnet/models/parsey_mcparseface/context.pbtxt
fgets(inputLine,512,fp);
strcpy(temp,inputLine);
s->lines[i]->pos = temp;
fclose(fp);
}
}
}
void writeStructToFile(structure *s, char *filename, int numLines, char ***words, char ***rhymes){ //writes structure to .txt file in madlyrics/structs/
char *path = malloc(sizeof(char)*128);
strcpy(path,"structs/");
filename += 8; //removes first 8 chars from filename, which is always "corpora/"
strcat(path,filename);
FILE *outputFile = fopen(path,"w");
char *temp = malloc(sizeof(char)*128);
char *str = malloc(sizeof(char)*128); //holds data for each word that will be printed to outfile
int i = 0;
while(s->lines[i] != NULL){
char **curr = malloc(sizeof(char *)*64);
strToArr(s->lines[i]->pos,curr);
strcpy(str,"");
int j = 0;
while(curr[j] != NULL){
removeNewlines(curr[j]);
if(!ispunct(getPosFromTaggedString(curr[j])[0])){
sprintf(temp,"%s_%d_%s ",getPosFromTaggedString(curr[j]),
isInCharArr(*words,getWordFromTaggedString(curr[j])),
(*rhymes)[isInCharArr(*words,getWordFromTaggedString(curr[j]))]
); // format: POS_WORDID_RHYMEID
strcat(str,temp);
}
else{
strcat(str,(curr[j]));
strcat(str," ");
}
j++;
}
removeNewlines(str);
fprintf(outputFile,"%s\n",str);
i++;
}
fprintf(stderr,"Saved structure to structs/%s.\n",filename);
fclose(outputFile);
}
int updatePosLists(structure *s){ //checks if each word/POS combination is present in POS lists found in madlyrics/lists, updates corresponding list
// if not present. Returns number of new entries added to lists (int).
char *path = malloc(sizeof(char)*128);
char **wordsArr = malloc(sizeof(char *)*64);
char *word = malloc(sizeof(char )*256);
FILE *dest;
int i = 0;
int newEntries = 0;
while(s->lines[i] != NULL){
strToArr(removeUnderscores(s->lines[i]->pos),wordsArr); // evenly sized array with format (word) (pos)
int l = 0;
while(wordsArr[l] != NULL){
strcpy(word,wordsArr[l]);
if(isAlnum(word)){
strcpy(path,"lists/");
strcat(path,cleanStr(wordsArr[l+1]));
strcat(path,".txt");
if(!isInFile(word,path)){
dest = fopen(path,"a");
fprintf(dest,"%s\n",word);
fclose(dest);
newEntries++;
}
}
l+=2;
}
i++;
}
return newEntries;
}
void findRhymeScheme(structure *s, char *filename,int numLines){
char **currentLine = malloc(sizeof(char *)*256);
char **wordsArr = malloc(sizeof(char *)*256);
int size = 0;
int capacity = 256;
int i = 0;
while(s-> lines[i] != NULL){
strToArr(removeUnderscores(s->lines[i]->pos),currentLine);
int j = 0;
while(currentLine[j] != NULL){
if(isInCharArr(wordsArr,currentLine[j]) == -1 && !ispunct(currentLine[j][strlen(currentLine[j])-1])){
wordsArr[size] = malloc(sizeof(char)*256);
strcpy(wordsArr[size],currentLine[j]);
size++;
}
if(size == capacity){
wordsArr = realloc(wordsArr,sizeof(char *)*(capacity *2));
capacity *= 2;
}
j += 2;
}
i++;
}
char **rhymeArr = malloc(sizeof(char *) * 256);
char *curr = malloc(sizeof(char)*256);
int k = 0;
while(wordsArr[k] != NULL){
rhymeArr[k] = malloc(sizeof(char)*256);
strcpy(curr,getRhymeId(wordsArr[k]));
if(strcmp(curr,"?") == 0 || isInCharArr(rhymeArr,curr) == -1 ){
strcpy(rhymeArr[k],curr);
}
else{
sprintf(curr, "%d", isInCharArr(rhymeArr,curr));
strcpy(rhymeArr[k],curr);
}
removeSpaces(wordsArr[k]);
k++;
}
int z = 0;
while(rhymeArr[z] != NULL){
if(!isNumber(rhymeArr[z])){
sprintf(rhymeArr[z],"%d",z); //if it's the first occurence of a rhyme, replace rhyme ID with index
}
removeSpaces(rhymeArr[z]);
z++;
}
writeStructToFile(s,filename,numLines,&wordsArr,&rhymeArr);
}
char *getRhymeId(char *str){ //gets rhyme ID from madlyrics/dicts/editedRhymeDict.csv that corresponds to given word
FILE *fp = fopen("dicts/editedRhymeDict.csv","r");
char **results = malloc(sizeof(char *)*32);
int size = 0;
char *temp = malloc(sizeof(char)*256);
char *curr = malloc(sizeof(char)*256);
while(fgets(temp, 128,fp) != NULL){
if(strstr(temp,toUpper(str)) != NULL){ // if match is found
strcpy(curr,getWordFromDictEntry(temp));
if(strcmp(toUpper(str),curr) == 0){ //if word entry matches str exactly
results[size] = malloc(sizeof(char)*256);
strcpy(results[size],getRhymeIdFromDictEntry(temp));
size++;
}
}
}
fclose(fp);
//printCharArr(results);
if(results[0] != NULL){
return results[rand() % (sizeof(results) / sizeof(results[0]))]; //returns random entry in array
}
else{
return "?";
}
}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#include <windows.h>
#else
#include <sys/time.h>
#endif
#include "match_tree.h"
unsigned int current_millisecond()
{
unsigned long long now = 0;
#ifdef WIN32
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
now = ft.dwHighDateTime;
now <<= 32;
now |= ft.dwLowDateTime;
now /= 10;
now -= 11644473600000000ULL;
now /= 1000;
#else
struct timeval tm;
gettimeofday(&tm, NULL);
now = tm.tv_sec * 1000;
now += tm.tv_usec/1000;
#endif
return (unsigned int)now;
}
#define TEST_COUNT 10*1000
int main(int argc, char* argv[])
{
unsigned int begin = 0;
int matching_count = 0;
struct match_tree_head * head = NULL;
const char * filename = "filter.txt";
// const char * filename = "filterworlds.txt";
FILE * fp = NULL;
char * file_content1 = NULL;
unsigned int file_content1_len = 0;
char * file_content2 = NULL;
unsigned int file_content2_len = 0;
unsigned int i = 0;
unsigned int j = 0;
#ifdef WIN32
if (fopen_s(&fp, filename, "rb") != 0)
{
return -1;
}
#else
fp = fopen(filename, "rb");
if (!fp)
{
return -1;
}
#endif
fseek(fp, 0, SEEK_END);
file_content1_len = ftell(fp);
if (file_content1_len == 0)
{
return -1;
}
file_content1 = (char*)malloc(file_content1_len + 1);
file_content2 = (char*)malloc(file_content1_len + 1);
file_content1[file_content1_len] = '\0';
fseek(fp, 0, SEEK_SET);
file_content1_len = (unsigned int)fread(file_content1, 1, file_content1_len, fp);
fclose(fp);
fp = NULL;
memcpy(file_content2, file_content1, file_content1_len);
file_content2_len = file_content1_len;
head = match_tree_init_from_file(filename, ".....", 5);
begin = current_millisecond();
for (i = 0; i < TEST_COUNT; i++)
{
for (j = 0; j < file_content1_len; j++)
{
if (match_tree_matching(head, file_content1 + j, file_content1_len - j, 0) > 0)
{
matching_count++;
}
}
}
printf("matching tree used time = %d, matching count=%d\n", current_millisecond() - begin, matching_count);
printf("string will translate with greedy[%s]\n\n", file_content1);
match_tree_translate(head, file_content1, file_content1_len, 1, '*');
printf("string is already translate with greedy[%s]\n\n", file_content1);
printf("string will translate without greedy[%s]\n\n", file_content2);
match_tree_translate(head, file_content2, file_content2_len, 0, '*');
printf("string is already translate without greedy[%s]\n\n", file_content2);
match_tree_free(head);
head = NULL;
return 0;
}
|
#pragma once
namespace OSGeo
{
namespace Ogr
{
/// <summary>The data source capabilities.</summary>
[System::Flags]
public enum class DataSourceCapabilities : int
{
/// <summary>The data source has no specific capabilities.</summary>
None = 0,
/// <summary>The data source can create new layers.</summary>
CreateLayer = 1,
/// <summary>The data source can delete layers.</summary>
DeleteLayer = 2
};
}
} |
//
// GLBinding.h
// jstest
//
// Created by jie on 13-7-25.
// Copyright (c) 2013年 jie. All rights reserved.
//
#ifndef __js11__GLBinding__
#define __js11__GLBinding__
#include <v8.h>
#include "../app/node.h"
#include "../core/Module.h"
using namespace v8;
#define DEFINE_GL(name) static void name##Callback(const v8::FunctionCallbackInfo<Value>& args)
class GLBinding :public Module {
public:
DEFINE_GL(getAttachedShaders);
DEFINE_GL(getSupportedExtensions);
DEFINE_GL(getExtension);
DEFINE_GL(activeTexture);
DEFINE_GL(attachShader);
DEFINE_GL(bindAttribLocation);
DEFINE_GL(bindBuffer);
DEFINE_GL(bindFramebuffer);
DEFINE_GL(bindRenderbuffer);
DEFINE_GL(bindTexture);
DEFINE_GL(blendColor);
DEFINE_GL(blendEquation);
DEFINE_GL(blendEquationSeparate);
DEFINE_GL(blendFunc);
DEFINE_GL(blendFuncSeparate);
DEFINE_GL(bufferData);
DEFINE_GL(bufferSubData);
DEFINE_GL(checkFramebufferStatus);
DEFINE_GL(clear);
DEFINE_GL(clearColor);
DEFINE_GL(clearDepth);
DEFINE_GL(clearStencil);
DEFINE_GL(colorMask);
DEFINE_GL(compileShader);
DEFINE_GL(copyTexImage2D);
DEFINE_GL(copyTexSubImage2D);
DEFINE_GL(createBuffer);
DEFINE_GL(createFramebuffer);
DEFINE_GL(createProgram);
DEFINE_GL(createRenderbuffer);
DEFINE_GL(createShader);
DEFINE_GL(createTexture);
DEFINE_GL(cullFace);
DEFINE_GL(deleteBuffer);
DEFINE_GL(deleteFramebuffer);
DEFINE_GL(deleteProgram);
DEFINE_GL(deleteRenderbuffer);
DEFINE_GL(deleteShader);
DEFINE_GL(deleteTexture);
DEFINE_GL(depthFunc);
DEFINE_GL(depthMask);
DEFINE_GL(depthRange);
DEFINE_GL(detachShader);
DEFINE_GL(disable);
DEFINE_GL(disableVertexAttribArray);
DEFINE_GL(drawArrays);
DEFINE_GL(drawElements);
DEFINE_GL(enable);
DEFINE_GL(enableVertexAttribArray);
DEFINE_GL(finish);
DEFINE_GL(flush);
DEFINE_GL(framebufferRenderbuffer);
DEFINE_GL(framebufferTexture2D);
DEFINE_GL(frontFace);
DEFINE_GL(generateMipmap);
DEFINE_GL(getActiveAttrib);
DEFINE_GL(getActiveUniform);
DEFINE_GL(getAttribLocation);
DEFINE_GL(getParameter);
DEFINE_GL(getBufferParameter);
DEFINE_GL(getError);
DEFINE_GL(getFramebufferAttachmentParameter);
DEFINE_GL(getProgramParameter);
DEFINE_GL(getProgramInfoLog);
DEFINE_GL(getRenderbufferParameter);
DEFINE_GL(getShaderParameter);
DEFINE_GL(getShaderInfoLog);
DEFINE_GL(getShaderSource);
DEFINE_GL(getTexParameter);
DEFINE_GL(getUniform);
DEFINE_GL(getUniformLocation);
DEFINE_GL(getVertexAttrib);
DEFINE_GL(getVertexAttribOffset);
DEFINE_GL(hint);
DEFINE_GL(isBuffer);
DEFINE_GL(isEnabled);
DEFINE_GL(isFramebuffer);
DEFINE_GL(isProgram);
DEFINE_GL(isRenderbuffer);
DEFINE_GL(isShader);
DEFINE_GL(isTexture);
DEFINE_GL(lineWidth);
DEFINE_GL(linkProgram);
DEFINE_GL(pixelStorei);
DEFINE_GL(polygonOffset);
DEFINE_GL(readPixels);
DEFINE_GL(renderbufferStorage);
DEFINE_GL(sampleCoverage);
DEFINE_GL(scissor);
DEFINE_GL(shaderSource);
DEFINE_GL(stencilFunc);
DEFINE_GL(stencilFuncSeparate);
DEFINE_GL(stencilMask);
DEFINE_GL(stencilMaskSeparate);
DEFINE_GL(stencilOp);
DEFINE_GL(stencilOpSeparate);
DEFINE_GL(texImage2D);
DEFINE_GL(internalTexImage2D);
DEFINE_GL(texParameterf);
DEFINE_GL(texParameteri);
DEFINE_GL(texSubImage2D);
DEFINE_GL(internalTexSubImage2D);
DEFINE_GL(uniform1f);
DEFINE_GL(uniform1fv);
DEFINE_GL(uniform1i);
DEFINE_GL(uniform1iv);
DEFINE_GL(uniform2f);
DEFINE_GL(uniform2fv);
DEFINE_GL(uniform2i);
DEFINE_GL(uniform2iv);
DEFINE_GL(uniform3f);
DEFINE_GL(uniform3fv);
DEFINE_GL(uniform3i);
DEFINE_GL(uniform3iv);
DEFINE_GL(uniform4f);
DEFINE_GL(uniform4fv);
DEFINE_GL(uniform4i);
DEFINE_GL(uniform4iv);
DEFINE_GL(uniformMatrix2fv);
DEFINE_GL(uniformMatrix3fv);
DEFINE_GL(uniformMatrix4fv);
DEFINE_GL(useProgram);
DEFINE_GL(validateProgram);
DEFINE_GL(vertexAttrib1f);
DEFINE_GL(vertexAttrib1fv);
DEFINE_GL(vertexAttrib2f);
DEFINE_GL(vertexAttrib2fv);
DEFINE_GL(vertexAttrib3f);
DEFINE_GL(vertexAttrib3fv);
DEFINE_GL(vertexAttrib4f);
DEFINE_GL(vertexAttrib4fv);
DEFINE_GL(vertexAttribPointer);
DEFINE_GL(viewport);
static node::node_module_struct* getModule(node::node_module_struct* t);
};
#undef DEFINE_GL
#endif /* defined(__jstest__GLBinding__) */
|
//
// MyFavListInteractorImpl.h
// TianJiCloud
//
// Created by 朱鹏 on 2017/8/8.
// Copyright © 2017年 TianJiMoney. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MyFavListConfigurateProtocol.h"
#import "MyFavListPrivateProtocol.h"
@interface MyFavListInteractorImpl : NSObject<MyFavListInteractor,MyFavListLayoutDelegate>
@property(nonatomic,weak) id<MyFavListInteractorDelegate> delegate;
@property(nonatomic,strong) id<MyFavListDataSource> dataSource;
@property(nonatomic,strong) id<MyFavListLayout> layout;
@end
|
#ifndef __ZIP_PIC_VIEW_APP_H__
#define __ZIP_PIC_VIEW_APP_H__
#include <wx/wx.h>
#include <wx/log.h>
class ZipPicViewApp : public wxApp {
public:
virtual bool OnInit();
virtual int OnExit();
private:
wxLog *log;
};
#endif
|
// 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 ? 17980 : 7980;
}
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
};
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;
};
#endif // __INCLUDED_PROTOCOL_H__
|
#ifndef SERVER_H_
#define SERVER_H_
struct Server_arg {
int listen;
};
void *
server_start(void *);
#endif
|
/*
* throw.h
*
* Created on: 23 Oct 2009
* Author: David
*/
#ifndef THROW_H_
#define THROW_H_
#include <stdbool.h>
#include "data_structures/vector.h"
struct mouse_state;
struct disc;
/*
* THROW
*
* Represents a throw in the game, there will only be one of these at a time
* and it will be stored in the game state object. We use this object to
* calculate the initial trajectory and power etc for the disc.
*
* start_state - A mouse_state object which describes where the mouse was and
* which button was pressed at what time when the throw started.
* end_state - A mouse state object which describes all the above for when the
* throw was released.
* in_progress - Set to true while a throw is being created. Used so that we
* only ever create a single copy of this alongside a match
* object.
*/
typedef struct disc_throw
{
struct mouse_state *start_state;
struct mouse_state *end_state;
bool in_progress;
} DISC_THROW;
DISC_THROW *create_throw();
void destroy_throw(DISC_THROW *);
VECTOR3 convert_throw_to_velocity(struct disc *, DISC_THROW *);
#endif /* THROW_H_ */
|
#ifndef VIX_PRIMITIVE_CONE_H
#define VIX_PRIMITIVE_CONE_H
#include <vix_platform.h>
#include <vix_gl.h>
#include <vix_glbuffers.h>
#include <vix_glcamera3d.h>
#include <vix_glshaderprogram.h>
#include <vix_vertex_defs.h>
#include <vix_color.h>
#include <vector>
namespace Vixen {
class VIX_API PrimitiveCone
{
public:
PrimitiveCone(void);
PrimitiveCone(float radius, float height, float subdivisions, Color c);
~PrimitiveCone();
void RotateX(float dt);
void RotateY(float dt);
void RotateZ(float dt);
void SetPosition(float x, float y, float z);
void SetSubdivisions(size_t sub);
size_t GetSubdivisions();
size_t GetMaxSubdivisions();
void Render(GLCamera3D* camera);
private:
Vec3 m_position;
GLShaderProgram* m_program;
VertPosColBuffer* m_vBuffer;
GLIndexBuffer* m_iBuffer;
float m_rotationX;
float m_rotationY;
float m_rotationZ;
float m_radius;
size_t m_subdivisions;
float m_height;
Color m_color;
size_t m_vertCnt;
std::vector<VertexPositionColor> m_topVerts;
std::vector<VertexPositionColor> m_botVerts;
std::vector<VertexPositionColor> m_bodyVerts;
/*UTILITY FUNCTIONS*/
void init_shader_program();
void init_color_vi_buffers();
/*apply shader transform*/
void applyTransform(GLCamera3D* camera);
/*STATIC CONSTANTS*/
static const size_t SUBDIVISIONS = 12;
static const size_t SPHERE_INDEX_COUNT = 60;
static const size_t SPHERE_VERTEX_COUNT = 12;
};
}
#endif |
#ifndef RABIT_LEARN_IO_IO_INL_H_
#define RABIT_LEARN_IO_IO_INL_H_
/*!
* \file io-inl.h
* \brief Input/Output utils that handles read/write
* of files in distrubuted enviroment
* \author Tianqi Chen
*/
#include <cstring>
#include "./io.h"
#if RABIT_USE_HDFS
#include "./hdfs-inl.h"
#endif
#include "./file-inl.h"
namespace rabit {
namespace io {
/*!
* \brief create input split given a uri
* \param uri the uri of the input, can contain hdfs prefix
* \param part the part id of current input
* \param nsplit total number of splits
*/
inline InputSplit *CreateInputSplit(const char *uri,
unsigned part,
unsigned nsplit) {
using namespace std;
if (!strcmp(uri, "stdin")) {
return new SingleFileSplit(uri);
}
if (!strncmp(uri, "file://", 7)) {
return new LineSplitter(new FileProvider(uri), part, nsplit);
}
if (!strncmp(uri, "hdfs://", 7)) {
#if RABIT_USE_HDFS
return new LineSplitter(new HDFSProvider(uri), part, nsplit);
#else
utils::Error("Please compile with RABIT_USE_HDFS=1");
#endif
}
return new LineSplitter(new FileProvider(uri), part, nsplit);
}
/*!
* \brief create an stream, the stream must be able to close
* the underlying resources(files) when deleted
*
* \param uri the uri of the input, can contain hdfs prefix
* \param mode can be 'w' or 'r' for read or write
*/
inline IStream *CreateStream(const char *uri, const char *mode) {
using namespace std;
if (!strncmp(uri, "file://", 7)) {
return new FileStream(uri + 7, mode);
}
if (!strncmp(uri, "hdfs://", 7)) {
#if RABIT_USE_HDFS
return new HDFSStream(hdfsConnect(HDFSStream::GetNameNode().c_str(), 0),
uri, mode, true);
#else
utils::Error("Please compile with RABIT_USE_HDFS=1");
#endif
}
return new FileStream(uri, mode);
}
} // namespace io
} // namespace rabit
#endif // RABIT_LEARN_IO_IO_INL_H_
|
//
// RecordViewController.h
// EZAudioRecordExample
//
// Created by Syed Haris Ali on 12/1/13.
// Copyright (c) 2013 Syed Haris Ali. All rights reserved.
//
// 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 <Cocoa/Cocoa.h>
// Import EZAudio header
#import "EZAudio.h"
// Import AVFoundation to play the file (will save EZAudioFile and EZOutput for separate example)
#import <AVFoundation/AVFoundation.h>
// By default this will record a file to /Users/YOUR_USERNAME/Documents/test.caf
#define kAudioFilePath [NSString stringWithFormat:@"%@%@",NSHomeDirectory(),@"/Documents/test.caf"]
/**
We will allow this view controller to act as an EZMicrophoneDelegate. This is how we listen for the microphone callback.
*/
@interface RecordViewController : NSViewController <EZMicrophoneDelegate,AVAudioPlayerDelegate>
/**
Use a OpenGL based plot to visualize the data coming in
*/
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlot;
/**
A flag indicating whether we are recording or not
*/
@property (nonatomic,assign) BOOL isRecording;
/**
The microphone component
*/
@property (nonatomic,strong) EZMicrophone *microphone;
/**
The recorder component
*/
@property (nonatomic,strong) EZRecorder *recorder;
#pragma mark - Actions
/**
Stops the recorder and starts playing whatever has been recorded.
*/
-(IBAction)playFile:(id)sender;
/**
Toggles the microphone on and off. When the microphone is on it will send its delegate (aka this view controller) the audio data in various ways (check out the EZMicrophoneDelegate documentation for more details);
*/
-(IBAction)toggleMicrophone:(id)sender;
/**
Toggles the microphone on and off. When the microphone is on it will send its delegate (aka this view controller) the audio data in various ways (check out the EZMicrophoneDelegate documentation for more details);
*/
-(IBAction)toggleRecording:(id)sender;
@end
|
//
// MTFValueTransformerErrorHandling.h
// Motif
//
// Created by Eric Horacek on 12/24/15.
// Copyright © 2015 Eric Horacek. All rights reserved.
//
@import Foundation;
NS_ASSUME_NONNULL_BEGIN
@protocol MTFValueTransformerErrorHandling <NSObject>
/// Transforms a value, returning any error that occurred during transformation.
///
/// @param value The value to transform.
///
/// @param error If not NULL, should be set to an error that occurred during
/// transformation if it was unsuccessful.
///
/// @return The transformed value, or nil if transformation was unsuccessful.
- (nullable id)transformedValue:(id)value error:(NSError **)error;
@end
NS_ASSUME_NONNULL_END
|
//
// DJTableViewVMTextFieldCell.h
// DJComponentTableViewVM
//
// Created by Dokay on 2017/2/16.
// Copyright © 2017年 dj226. All rights reserved.
//
@import Foundation;
#import "DJTableViewVMCell.h"
#import "DJTableViewVMTextFieldRow.h"
NS_ASSUME_NONNULL_BEGIN
@interface DJTableViewVMTextFieldCell : DJTableViewVMCell<UITextFieldDelegate>
@property (nonatomic, strong) DJTableViewVMTextFieldRow *rowVM;
@property (nonatomic, readonly) UITextField *textField;
- (void)textFieldDidChange:(UITextField *)textField;
@end
NS_ASSUME_NONNULL_END
|
//
// AVAssetExportSession+Extension.h
// CocoaBloc
//
// Created by Mark Glagola on 12/15/14.
// Copyright (c) 2014 StageBloc. All rights reserved.
//
#import <AVFoundation/AVFoundation.h>
@class RACSignal;
@interface AVAssetExportSession (Extension)
+ (instancetype) exportSessionWithAsset:(AVAsset *)asset presetName:(NSString *)presetName outputURL:(NSURL*)outputURL;
- (RACSignal*) exportAsynchronously;
@end
|
//
// PlayRTCFactory.h
// PlayRTC
//
// Created by ds3grk on 2014. 7. 17..
// Copyright (c) 2014년 playrtc. All rights reserved.
//
#ifndef __PlayRTCFactory_h__
#define __PlayRTCFactory_h__
#import <Foundation/Foundation.h>
#import "PlayRTCDefine.h"
#import "PlayRTCObserver.h"
#import "PlayRTCSettings.h"
#import "PlayRTCConfig.h"
#import "PlayRTC.h"
@interface PlayRTCFactory : NSObject
/**
* PlayRTCConfig 인터페이스를 구현한 PlayRTC Implement를 반환한다
* @return PlayRTCConfig
*/
+ (PlayRTCConfig*)createConfig;
/**
* PlayRTC 인터페이스를 구현한 PlayRTC Implement를 반환한다
* @param settings PlayRTCSettings, PlayRTC Configureation
* @param observer PlayRTCObserver, PlayRTC Event 리스너
* @return PlayRTC
*/
+ (PlayRTC*)newInstance:(PlayRTCSettings*)settings observer:(id<PlayRTCObserver>)observer;
/**
* PlayRTC 인터페이스를 구현한 PlayRTC Implement를 반환한다
* @param config PlayRTCConfig, PlayRTC Configureation
* @param observer PlayRTCObserver, PlayRTC Event 리스너
* @return PlayRTC
*/
+ (PlayRTC*)createPlayRTC:(PlayRTCConfig*)config observer:(id<PlayRTCObserver>)observer;
@end
#endif
|
/*-------------------------------------------------------------------------*/
/**
@file l_splash_renderer.h
@author P. Batty
@brief The renderer
This module implements the renderer lua bindings
*/
/*--------------------------------------------------------------------------*/
#ifndef L_SPLASH_RENDERER_H_
#define L_SPLASH_RENDERER_H_
/*---------------------------------------------------------------------------
Includes
---------------------------------------------------------------------------*/
#include "splash/Splash_renderer.h"
/* Set up for C definitions */
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------
New types
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
Function prototypes
---------------------------------------------------------------------------*/
/*!--------------------------------------------------------------------------
@brief registers the renderer functions to lua
@param the state to register to
@return Void
Registers the renderer functions to lua
\-----------------------------------------------------------------------------*/
extern void l_splash_renderer_register(lua_State *l);
/* end C definitions */
#ifdef __cplusplus
}
#endif
#endif
|
extern int foo;
void print_foo();
void print(int); |
/*
* Copyright (C) 2007-2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if defined(_WIN32)
#include <unistd.h>
#include <log/uio.h>
#include "log_portability.h"
LIBLOG_ABI_PUBLIC int readv(int fd, struct iovec* vecs, int count) {
int total = 0;
for (; count > 0; count--, vecs++) {
char* buf = vecs->iov_base;
int len = vecs->iov_len;
while (len > 0) {
int ret = read(fd, buf, len);
if (ret < 0) {
if (total == 0) total = -1;
goto Exit;
}
if (ret == 0) goto Exit;
total += ret;
buf += ret;
len -= ret;
}
}
Exit:
return total;
}
LIBLOG_ABI_PUBLIC int writev(int fd, const struct iovec* vecs, int count) {
int total = 0;
for (; count > 0; count--, vecs++) {
const char* buf = vecs->iov_base;
int len = vecs->iov_len;
while (len > 0) {
int ret = write(fd, buf, len);
if (ret < 0) {
if (total == 0) total = -1;
goto Exit;
}
if (ret == 0) goto Exit;
total += ret;
buf += ret;
len -= ret;
}
}
Exit:
return total;
}
#endif
|
//
// MXUtils.h
// Pods
//
// Created by 吴星煜 on 15/4/26.
//
//
#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonDigest.h>
#import <UIKit/UIKit.h>
#import "OpenUDID.h"
static inline NSString* randomString() {
int NUMBER_OF_CHARS = 10;
char data[NUMBER_OF_CHARS];
for (int x=0;x<NUMBER_OF_CHARS;data[x++] = (char)('A' + (arc4random_uniform(26))));
return [[NSString alloc] initWithBytes:data length:NUMBER_OF_CHARS encoding:NSUTF8StringEncoding];
}
static inline NSString* md5String(NSString *strOrigin){
const char *original_str = [strOrigin UTF8String];
unsigned char result[CC_MD5_DIGEST_LENGTH];
CC_MD5(original_str, strlen(original_str), result);
NSMutableString *hash = [NSMutableString string];
for (int i = 0; i < 16; i++)
{
[hash appendFormat:@"%02X", result[i]];
}
NSString *mdfiveString = [hash lowercaseString];
return mdfiveString;
}
static inline NSString* appName() {
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
return appName;
}
static inline NSString* appPkgName() {
NSString *appPkgName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"];
return appPkgName;
}
static inline NSString* appVersion() {
NSString *appVerShort = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
NSString *appVer = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
NSString *ret = [NSString stringWithFormat:@"%@(%@)", appVerShort, appVer];
return ret;
}
static inline NSString* deviceName() {
return [[UIDevice currentDevice] name];
}
static inline NSString* deviceOSName() {
return [[UIDevice currentDevice] systemName];
}
static inline NSString* deviceOSVersion() {
return [[UIDevice currentDevice] systemVersion];
}
static inline NSString* deviceID() {
return [OpenUDID value];
}
static inline NSString* deviceRes() {
NSString *ret = [NSString stringWithFormat:@"%dx%d", (int)[UIScreen mainScreen].bounds.size.width, (int)[UIScreen mainScreen].bounds.size.height];
return ret;
}
@interface MXUtils : NSObject
@end
|
#ifndef MGSORT_H
#define MGSORT_H
int mgsort(void *data, int size, int esize, int i, int k, int (*compare)(const void *key1, const void *key2));
#endif
|
// -*- mode: ObjC -*-
// This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files.
// Copyright (C) 1997-1998, 2000-2001, 2004-2013 Steve Nygard.
#import "CDOCProtocol.h"
#import "CDTopologicalSortProtocol.h"
@interface CDOCClass : CDOCProtocol <CDTopologicalSort>
@property (strong) NSString *superClassName;
@property (strong) NSArray *instanceVariables;
@property (assign) BOOL isExported;
@end
|
#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_memmap.h"
#include "driverlib/adc.h"
#include "driverlib/aes.h"
#include "driverlib/can.h"
#include "driverlib/comp.h"
#include "driverlib/cpu.h"
#include "driverlib/crc.h"
#include "driverlib/debug.h"
#include "driverlib/des.h"
#include "driverlib/eeprom.h"
#include "driverlib/emac.h"
#include "driverlib/epi.h"
#include "driverlib/flash.h"
#include "driverlib/fpu.h"
#include "driverlib/gpio.h"
#include "driverlib/hibernate.h"
#include "driverlib/i2c.h"
#include "driverlib/interrupt.h"
#include "driverlib/lcd.h"
#include "driverlib/mpu.h"
#include "driverlib/onewire.h"
#include "driverlib/pin_map.h"
#include "driverlib/pwm.h"
#include "driverlib/qei.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/rtos_bindings.h"
#include "driverlib/shamd5.h"
#include "driverlib/ssi.h"
#include "driverlib/sw_crc.h"
#include "driverlib/sysctl.h"
#include "driverlib/sysexc.h"
#include "driverlib/systick.h"
#include "driverlib/timer.h"
#include "driverlib/uart.h"
#include "driverlib/udma.h"
#include "driverlib/usb.h"
#include "driverlib/watchdog.h"
#include "tm4c123gh6pm.h"
#include "src/Uart_helper.h"
#include <stdbool.h>
#include <stdint.h>
#include "sysctl.h"
#include "hw_memmap.h"
#include "gpio.h"
#include "uart.h"
#include "../inc/tm4c123gh6pm.h"
#include "hw_gpio.h"
#include "hw_types.h"
#include "src/Uart_helper.h"
#include "LED.h"
#include "myGPIO.h"
//#include "Systick_helper.h"
#include "HAL_Systick.h"
#include "HAL_ADC.h"
#include "myPWM.h"
|
// -*- C++ -*-
// ===================================================================
/**
* @file HTIOP_Transport.h
*
* $Id: HTIOP_Transport.h 2179 2013-05-28 22:16:51Z mesnierp $
*
* @author Originally by Fred Kuhns <fredk@cs.wustl.edu>
* @author Modified by Balachandran Natarajan <bala@cs.wustl.edu>
*/
// ===================================================================
#ifndef TAO_HTIOP_TRANSPORT_H
#define TAO_HTIOP_TRANSPORT_H
#include /**/ "ace/pre.h"
#include "orbsvcs/HTIOP/HTIOP_Export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "orbsvcs/HTIOPC.h"
#include "ace/HTBP/HTBP_Stream.h"
#include "tao/Transport.h"
#include "ace/Synch.h"
#include "ace/Svc_Handler.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward decls.
class TAO_ORB_Core;
class TAO_Operation_Details;
class TAO_Acceptor;
class TAO_Adapter;
namespace TAO
{
namespace HTIOP
{
class Connection_Handler;
// Service Handler for this transport
typedef ACE_Svc_Handler<ACE::HTBP::Stream, ACE_NULL_SYNCH>
SVC_HANDLER;
/**
* @class Transport
*
* @brief Specialization of the base Transport class to handle the
* HTIOP protocol.
*
*
*
*/
class HTIOP_Export Transport : public TAO_Transport
{
public:
/// Constructor.
Transport (Connection_Handler *handler,
TAO_ORB_Core *orb_core);
/// Default destructor.
~Transport (void);
protected:
/** @name Overridden Template Methods
*
* Please check the documentation in "tao/Transport.h" for more
* details.
*/
//@{
virtual ACE_Event_Handler * event_handler_i (void);
virtual TAO_Connection_Handler * invalidate_event_handler_i (void);
virtual ssize_t send (iovec *iov, int iovcnt,
size_t &bytes_transferred,
const ACE_Time_Value *timeout = 0);
virtual ssize_t recv (char *buf,
size_t len,
const ACE_Time_Value *s = 0);
virtual int register_handler (void);
public:
/// @@TODO: These methods IMHO should have more meaningful
/// names. The names seem to indicate nothing.
virtual int send_request (TAO_Stub *stub,
TAO_ORB_Core *orb_core,
TAO_OutputCDR &stream,
TAO_Message_Semantics message_semantics,
ACE_Time_Value *max_wait_time);
virtual int send_message (TAO_OutputCDR &stream,
TAO_Stub *stub = 0,
TAO_ServerRequest *request = 0,
TAO_Message_Semantics message_semantics =
TAO_Message_Semantics (),
ACE_Time_Value *max_time_wait = 0);
virtual int tear_listen_point_list (TAO_InputCDR &cdr);
virtual TAO_Connection_Handler * connection_handler_i (void);
//@}
private:
/// Set the Bidirectional context info in the service context list
void set_bidir_context_info (TAO_Operation_Details &opdetails);
/// Add the listen points in <acceptor> to the <listen_point_list>
/// if this connection is in the same interface as that of the
/// endpoints in the <acceptor>
int get_listen_point (::HTIOP::ListenPointList &listen_point_list,
TAO_Acceptor *acceptor);
/// The connection service handler used for accessing lower layer
/// communication protocols.
Connection_Handler *connection_handler_;
};
}
}
TAO_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"
#endif /* TRANSPORT_H */
|
#ifndef __GRID_CHART_H
#define __GRID_CHART_H
#include <QWidget>
#include <QtDesigner/QDesignerExportWidget>
#include <vector>
#include <memory>
#include <chartwork/Chart.h>
#include <chartwork/elements/Background.h>
#include <chartwork/elements/Key.h>
namespace chartwork
{
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// GridChart
//
////////////////////////////////////////////////////////////////////////////////////////////////////
class QDESIGNER_WIDGET_EXPORT GridChart : public Chart
{
Q_OBJECT
Q_PROPERTY(QString title READ title WRITE setTitle)
Q_PROPERTY(bool showKey READ showKey WRITE setShowKey)
Q_PROPERTY(double keyScale READ keyScale WRITE setKeyScale)
Q_PROPERTY(bool antialiasing READ antialiasing WRITE setAntialiasing)
Q_PROPERTY(QSize gridSize READ gridSize WRITE setGridSize)
Q_PROPERTY(double minValue READ minValue WRITE setMinValue)
Q_PROPERTY(double maxValue READ maxValue WRITE setMaxValue)
Q_PROPERTY(int precision READ precision WRITE setPrecision)
Q_PROPERTY(int numberOfColors READ numberOfColors WRITE setNumberOfColors)
Q_PROPERTY(QColor color0 READ color0 WRITE setColor0)
Q_PROPERTY(QColor color1 READ color1 WRITE setColor1)
Q_PROPERTY(QColor color2 READ color2 WRITE setColor2)
Q_PROPERTY(QColor color3 READ color3 WRITE setColor3)
Q_PROPERTY(QColor color4 READ color4 WRITE setColor4)
Q_PROPERTY(QColor color5 READ color5 WRITE setColor5)
Q_PROPERTY(QColor color6 READ color6 WRITE setColor6)
Q_PROPERTY(QColor color7 READ color7 WRITE setColor7)
public:
GridChart(QWidget *parent = 0);
// Get/set whether the key is shown (right of the chart)
bool showKey() const;
void setShowKey(bool showKey);
// Get/set the displayed scale/size of the chart's key
// 1.0 = default size, 0.5 = half the size
double keyScale() const;
void setKeyScale(double keyScale);
// Get/set whether the grid cells are antialiased
bool antialiasing() const;
void setAntialiasing(bool antialiasing);
// Get/set the grid size (width = columns, height = rows)
QSize gridSize() const;
void setGridSize(QSize gridSize);
// Get/set the minimum value; will be mapped to the first color in the color palette
double minValue() const;
void setMinValue(double minValue);
// Get/set the maximum value; will be mapped to the last color in the color palette
double maxValue() const;
void setMaxValue(double maxValue);
// Get/set the precision of the numbers shown in the chart's key
int precision() const;
void setPrecision(int precision);
// Get/set how many colors in the palette are used (always starts at the first color)
int numberOfColors() const;
void setNumberOfColors(int numberOfColors);
// Get/set the values of individual cells
void setValue(int x, int y, double value);
double value(int x, int y) const;
// Set the value of all grids simultaneously
void setAllValues(double value);
private:
void resetValues();
void generateRandomValues();
void updateKeyStrings();
double blockSize(int remainingWidth, int remainingHeight) const;
QSize gridSize(int remainingWidth, int remainingHeight) const;
void paintEvent(QPaintEvent *event);
void paint(QPainter &painter);
QFont m_titleFont;
QFont m_keyFont;
QFontMetrics m_keyFontMetrics;
bool m_antialiasing;
QSize m_gridSize;
double m_minValue;
double m_maxValue;
int m_precision;
std::shared_ptr<QStringList> m_keyStrings;
int m_numberOfColors;
std::vector<std::vector<double>> m_values;
elements::Background m_background;
elements::Key m_key;
QRect m_chartRect;
double m_blockSize;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
}
#endif
|
//
// BootstrapAppDelegate.h
// iOSBootstrap
//
// Created by Yaming on 10/05/2015.
// Copyright (c) 2015 Yaming. All rights reserved.
//
@import UIKit;
#import "iOSBootstrap/AppBootstrap.h"
@interface BootstrapAppDelegate : AppBootstrap
@end
|
//
// CYPNowWeatherBriefViewController.h
// WhatWeather
//
// Created by Chen Yongping on 6/22/14.
// Copyright (c) 2014 AllRoudHut. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CYPNowWeatherChildViewController.h"
@interface CYPNowWeatherBriefViewController :CYPNowWeatherChildViewController
@end
|
// Copyright (c) 2014 Yohsuke Yukishita
// This software is released under the MIT License: http://opensource.org/licenses/mit-license.php
#import <Foundation/Foundation.h>
#import "TGLBindable.h"
@interface TGLVertexArrayObject : NSObject<TGLBindable>
+ (TGLVertexArrayObject *)create;
@end
|
//
// Copyright (c) articy Software GmbH & Co. KG. All rights reserved.
//
#pragma once
#include "ArticyBaseObject.h"
#include "ArticyBaseTypes.h"
#include "ArticyPrimitive.generated.h"
/**
* A more lightweight base class for objects imported from articy.
*/
UCLASS(BlueprintType)
class ARTICYRUNTIME_API UArticyPrimitive : public UArticyBaseObject
{
GENERATED_BODY()
public:
FArticyId GetId() const { return Id; }
uint32 GetCloneId() const { return CloneId; }
protected:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Articy")
FArticyId Id;
// TODO k2 - changed to UArticyCloneableObject
//friend struct FArticyClonableObject;
friend struct FArticyObjectShadow;
/** The ID of this instance (0 is the original object). */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Articy")
int32 CloneId = 0;
protected:
/** Used internally by ArticyImporter. */
void InitFromJson(TSharedPtr<FJsonValue> Json) override
{
UArticyBaseObject::InitFromJson(Json);
if(!Json.IsValid() || Json->Type != EJson::Object)
return;
auto obj = Json->AsObject();
if(!ensure(obj.IsValid()))
return;
JSON_TRY_HEX_ID(obj, Id);
}
private:
mutable FString Path = "";
};
|
#include <stdio.h>
#include <string.h>
#include "hidapi.h"
#include "co20_hid.h"
hid_device *co20_handle;
int co20_init() {
// open the device using the VID, PID,
co20_handle = hid_open(0x3eb, 0x2013, NULL);
if(!co20_handle) {
printf("device not found\n");
return 1;
}
return 0;
}
short co20_get_air_quality() {
short airValue=0;
int res;
unsigned char buf[65];
memcpy(buf, "\x00\x40\x68\x2a\x54\x52\x0a\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40", 0x11);
res = hid_write(co20_handle, buf, 0x11);
if(res!=0x11) {
printf("write error: %d\n", res);
return -1;
}
res = hid_read(co20_handle, buf, 65);
if (res < 0) {
printf("unable to read()\n");
return -1;
}
// copy current air quality value from buffer
// you should get 450 as a result when you plug in the stick,
// if you are getting weird results you are probably not on a little endian system
// and need to correct the byte order
memcpy(&airValue, buf+2, 2);
return airValue;
}
|
/*
* libusb example program to list devices on the bus
* Copyright © 2007 Daniel Drake <dsd@gentoo.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include "libusb.h"
#include <time.h>
struct libusb_device_handle *ButtonAce = NULL;
static void print_devs(libusb_device **devs)
{
libusb_device *dev;
int i = 0, j = 0;
uint8_t path[8];
while ((dev = devs[i++]) != NULL) {
struct libusb_device_descriptor desc;
int r = libusb_get_device_descriptor(dev, &desc);
if (r < 0) {
fprintf(stderr, "failed to get device descriptor");
return;
}
printf("%04x:%04x (bus %d, device %d)",
desc.idVendor, desc.idProduct,
libusb_get_bus_number(dev), libusb_get_device_address(dev));
r = libusb_get_port_numbers(dev, path, sizeof(path));
if (r > 0) {
printf(" path: %d", path[0]);
for (j = 1; j < r; j++)
printf(".%d", path[j]);
if (desc.idVendor == 0x1209 && desc.idProduct == 0xACE5)
{
int Result = 0;
printf("\n Found this: ");
Result = libusb_open(dev, &ButtonAce);
switch (Result)
{
case 0:
printf("Success!\n");
default:
printf("Error %d\n", Result);
}
}
}
printf("\n");
}
}
/* Initialize and Set Default Vendor ID (VID) and Product ID (PID) */
static const int VID = 0x1209;
static const int PID = 0xACE5;
/* Endpoint Addresses defined in Endpoint Descriptor */
static const int IN_ENDPOINT_ADDRESS = 0x84;
static const int OUT_ENDPOINT_ADDRESS = 0x05;
/* Maximum Input and Output Transfer size */
static const int MAXIMUM_IN_TRANSFER_SIZE = 8;
static const int MAXIMUM_OUT_TRANSFER_SIZE = 8;
/* Miscellaneous variables for timing and interface referencing */
static const int INTERFACE_NUMBER = 1;
static const int TIMEOUT_MS = 5000;
static const int NUMBER_INPUT_ITERATIONS = 10;
static const int TIME_DELAY = 1000;
void Perform_Input_and_Output_Transfers(libusb_device_handle *MyHIDDevice)
{
/* Declare area in RAM for Input and Output Data Buffer */
unsigned char In_Data_Buffer[8];
unsigned char Out_Data_Buffer[8];
/* Various variables for application code */
int ADC_Result = 0;
int Switch_Status = 0;
int Transfer_Count;
int Result = 0;
int In_Iteration_Count = 0;
/* Store output data in output buffer prior to prior to transferring */
Out_Data_Buffer[0] = 'B';
Out_Data_Buffer[1] = 'D';
Out_Data_Buffer[2] = 'T';
Out_Data_Buffer[3] = 0;
/* Perform Output Transfer to PSoC */
Result = libusb_interrupt_transfer(MyHIDDevice, OUT_ENDPOINT_ADDRESS, Out_Data_Buffer,
MAXIMUM_OUT_TRANSFER_SIZE, &Transfer_Count,
TIMEOUT_MS);
/* Check to see if Output transaction was successful */
if (Result == 0)
{
printf("\n");
printf("/********** Output Data = '%s'\n",Out_Data_Buffer);
printf("\n");
printf("\n");
}
else
{
printf("Error Has Occurred with Output Transfer \n");
printf("\n");
}
/* Request IN report from PSoC. Performs in a loop. Number of cycles dependent on
NUMBER_INPUT_ITERATIONS */
printf("/********** Input Data **********/\n");
for (In_Iteration_Count = 0; In_Iteration_Count < 4; // NUMBER_INPUT_ITERATIONS;
In_Iteration_Count++)
{
Result = libusb_interrupt_transfer(MyHIDDevice,
IN_ENDPOINT_ADDRESS,
In_Data_Buffer,
MAXIMUM_IN_TRANSFER_SIZE,
&Transfer_Count,
TIMEOUT_MS);
/* Check to see if Input request was successful */
if (Result == 0)
{
/* Unload data from Input Buffer and format ADC Data */
printf("Ok, here's what we got: %s\n", In_Data_Buffer);
/* Print Input Data in the Terminal */
}
else
{
printf("Error Occurred with Input Transfer \n");
printf("\n");
}
/* Time is seconds to wait between Input requests */
Sleep(TIME_DELAY);
}
}
void TestOut()
{
//struct libusb_device_handle *ButtonAce = NULL;
int Device_Status = 0;
int Result = 0;
printf("\nOk, boys lets see if we can fly!\n");
/* Finds matching device and assigns device handle */
//ButtonAce = libusb_open_device_with_vid_pid(NULL, VID, PID);
/* Check to see if HID was detected and properly assigned a handle */
if (ButtonAce != NULL)
{
printf("Ha! Got one!\n");
/* Claim USB interface for Application */
Result = libusb_claim_interface(ButtonAce, INTERFACE_NUMBER);
/* Ask user to provide parameters for Output Report */
switch (Result)
{
case 0:
Device_Status = 1;
fprintf(stderr, "Device Connected \n");
Perform_Input_and_Output_Transfers(ButtonAce);
libusb_release_interface(ButtonAce, 0);
break;
case LIBUSB_ERROR_NOT_FOUND:
fprintf(stderr, "The requested interface does not exist. \n");
break;
case LIBUSB_ERROR_BUSY:
fprintf(stderr, "Another program or driver has claimed the interface.\n");
break;
case LIBUSB_ERROR_NO_DEVICE:
fprintf(stderr, "The device has been disconnected. \n");
break;
default:
fprintf(stderr, "An Error has occurred. Application cannot continue.\n");
break;
}
}
else
{
fprintf(stderr, "Unable to locate an attached device that matches.\n");
}
}
int main(void)
{
libusb_device **devs;
int r;
ssize_t cnt;
r = libusb_init(NULL);
if (r < 0)
return r;
libusb_set_debug(NULL,LIBUSB_LOG_LEVEL_WARNING);
cnt = libusb_get_device_list(NULL, &devs);
if (cnt < 0)
return (int)cnt;
print_devs(devs);
libusb_free_device_list(devs, 1);
TestOut();
getc(stdin);
libusb_exit(NULL);
return 0;
}
|
//
// LaserDot.h
//
// Created by Seb Lee-Delisle on 01/08/2013.
//
//
#pragma once
#include "ofxLaserShape.h"
namespace ofxLaser {
class Dot : public Shape{
public :
Dot(const ofPoint& dotPosition, const ofColor& dotColour, float dotIntensity, string profilelabel);
void appendPointsToVector(vector<ofxLaser::Point>& points, const RenderProfile& profile, float speedMultiplier);
void addPreviewToMesh(ofMesh& mesh);
virtual bool intersectsRect(ofRectangle & rect);
float intensity = 1;
int maxPoints = 5;
};
}
|
// Copyright Daniel Mouritzen, Niels Bang and Mathias Bredholt 2015
#include <sio.h>
#ifndef _ANSI_H_
#define _ANSI_H_
#define ESC 0x1B
void fg_color(int foreground);
void bg_color(int background);
void color(int foreground, int background);
void reset_bg_color();
void clr_scr();
void hide_scr();
void clear_eol();
void go_to_xy(int x, int y);
void underline(char on);
void blink(char on);
void reverse(char on);
void up(int n);
void down(int n);
void right(int n);
void left(int n);
void spacer(int n, int c);
#endif |
void routeTone(OSCMessage &msg, int addrOffset ) {
display.clearDisplay();
display.setTextSize(2);
display.setCursor(0, 0);
display.println(msg.getInt(0));
display.display();
}
void stripName(OSCMessage &msg, int addrOffset ){
int stripId = msg.getInt(0);
char stripName[16];
Serial.print("/strip/name ");
Serial.print(stripId);
Serial.print(" ");
msg.getString(1,stripName, 16);
Serial.print(stripName);
Serial.println();
}
|
#ifndef _NAVIGATION_H_
#define _NAVIGATION_H_
#include <joyos.h>
#include <motor.h>
#include <math.h>
#include "vector_tools.h"
// TODO: this does not belong
v2d robot_position_estimate() {
v2d v = {0,0};
return v;
}
struct lock nav_lock;
bool target_pos_active = false;
v2d target_pos;
void set_wheels(float vl, float vr) {
motor_set_vel(PIN_MOTOR_DRIVE_L, vr);
motor_set_vel(PIN_MOTOR_DRIVE_R, vl);
}
void move_robot_to(v2d pos) {
v2d rpe = robot_position_estimate();
v2d diff = v2d_sub(&pos, &rpe); // FIXME: pointer issues
float ang = fmod(atan2(diff.y, diff.x) + 2 * M_PI, 2 * M_PI); // radians
float motor_vels[2] = {0,0}; // range: [-1, 1]
// rotation component
motor_vels[0] += ang / 2 / M_PI / 4;
motor_vels[1] -= ang / 2 / M_PI / 4;
// straight componenet
static float charge_angle_thresh = 0.523598776; // radians
if (abs(ang) < charge_angle_thresh) {
motor_vels[0] += 0.5;
motor_vels[1] += 0.5;
}
// legalize motor vel range
motor_vels[0] = motor_vels[0] * 255;
printf("setting wheels powers : [%f, %f]\n", motor_vels[0], motor_vels[1]);
set_wheels(fmin(fmax(-1, motor_vels[0]), 1) * 255, fmin(fmax(-1, motor_vels[1]), 1) * 255);
}
int navigation_controller() {
while(1) {
acquire(&nav_lock);
if (target_pos_active) {
move_robot_to(target_pos);
}
pause(50); // safety interval (arbitrary time)
release(&nav_lock);
}
return 0;
}
// pass null to disable position targeting
void set_target_pos(v2d* pos) {
printf("nav: set_target_pos (is_null==%d)", pos == NULL);
acquire(&nav_lock);
if (pos != NULL)
target_pos = *pos;
target_pos_active = (pos != NULL);
release(&nav_lock);
}
#endif
|
//
// TUSuperDBCell.h
//
//
// Created by 3dlabuser on 14-6-2.
//
//
#import <UIKit/UIKit.h>
@interface TUSuperDBCell : UITableViewCell
@property (strong, nonatomic) UILabel *label;
@property (strong, nonatomic) UITextField *textField;
@property (strong, nonatomic) NSString *key;
@property (strong, nonatomic) id value;
@property (strong, nonatomic) NSManagedObject *hero;
- (BOOL)isEditable;
@end
|
#ifndef FAMILIATARGARYEN_H
#define FAMILIATARGARYEN_H
#include <string>
#include "Dothraki.h"
#include "Dragon.h"
using namespace std;
class FamiliaTargaryen{
private:
string reina;
string animal;
string lema;
Dothraki* ejercitoDothraki;
Dragon* ejercitoDragon;
int barcos;
int sizeEjercito;
public:
string getReina();
string getAnimal();
string getLema();
int getBarcos();
int getSizeEjercito();
void setReina(string);
void setAnimal(string);
void setLema(string);
void setBarcos(int);
void setSizeEjercito(int);
};
#endif
|
#include <exec/types.h>
#include <proto/exec.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "NiKomLib.h"
struct Library *NiKomBase;
void printUsage(void) {
printf("Usage: One of the following\n");
printf(" NiKomFido UpdateFido\n");
printf(" NiKomFido RescanConf <conf number>\n");
printf(" NiKomFido RescanAllConf\n");
printf(" NiKomFido RenumberConf <conf number> <new lowest text number>\n");
}
void updateFido(void) {
printf("Updating Fido mail.\n");
Matrix2NiKom();
printf("Updating Fido conferences.\n");
UpdateAllFidoConf();
}
int rescanConf(int argc, char *argv[]) {
int conf;
if(argc != 3) {
printf("RescanConf takes exactly one parameter, the number of the conf to rescan.\n");
return 5;
}
conf = atoi(argv[2]);
printf("Rescanning Fido conference %d\n", conf);
ReScanFidoConf(NULL, conf);
}
void rescanAllConf(void) {
printf("Rescanning all Fido conferences.\n");
ReScanAllFidoConf();
}
int renumberConf(int argc, char *argv[]) {
int conf, lowtext, res, error = 10;
if(argc != 4) {
printf("RenumberConf takes exactly two parameters.\n");
printf(" - the number of the conf to renumber.\n");
printf(" - the new lowest text number.\n");
return 5;
}
conf = atoi(argv[2]);
lowtext = atoi(argv[3]);
printf("Renumbering Fido conference %d. New low text: %d\n", conf, lowtext);
res = ReNumberConf(NULL, conf, lowtext);
switch(res) {
case 0:
error = 0;
break;
case 1:
printf("There is no conference with number %d.\n", conf);
break;
case 2:
printf("The new low text number is not lower than to old one.\n");
break;
case 3:
printf("Conference %d is not a Fido conference.\n", conf);
break;
case 4:
printf("Could not read the HWM (High Water Mark).\n");
break;
case 5:
printf("Could not write a new HWM (High Water Mark).\n");
break;
default:
printf("Unexpected error code: %d\n", res);
}
return error;
}
void main(int argc, char *argv[]) {
int ret = 0;
if(argc < 2) {
printUsage();
exit(5);
}
if(!(NiKomBase = OpenLibrary("nikom.library",0))) {
printf("Could not open nikom.library\n");
exit(10);
}
if(stricmp(argv[1], "UpdateFido") == 0) {
updateFido();
} else if(stricmp(argv[1], "RescanConf") == 0) {
ret = rescanConf(argc, argv);
} else if(stricmp(argv[1], "RescanAllConf") == 0) {
rescanAllConf();
} else if(stricmp(argv[1], "RenumberConf") == 0) {
ret = renumberConf(argc, argv);
} else {
printUsage();
ret = 5;
}
CloseLibrary(NiKomBase);
exit(ret);
}
|
//
// SpeechSynthesizer.h
// AMapNaviKit
//
// Created by 刘博 on 16/4/1.
// Copyright © 2016年 AutoNavi. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
/**
* iOS7及以上版本可以使用 AVSpeechSynthesizer 合成语音
*
* 或者采用"科大讯飞"等第三方的语音合成服务
*/
@interface SpeechSynthesizer : NSObject
+ (instancetype)sharedSpeechSynthesizer;
- (BOOL)isSpeaking;
- (void)speakString:(NSString *)string;
- (void)stopSpeak;
@end
|
/*
* Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include BLIK_OPENSSL_V_openssl__sha_h //original-code:<openssl/sha.h>
#include BLIK_OPENSSL_V_openssl__evp_h //original-code:<openssl/evp.h>
static const unsigned char app_b1[SHA256_DIGEST_LENGTH] = {
0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad
};
static const unsigned char app_b2[SHA256_DIGEST_LENGTH] = {
0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8,
0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39,
0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67,
0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1
};
static const unsigned char app_b3[SHA256_DIGEST_LENGTH] = {
0xcd, 0xc7, 0x6e, 0x5c, 0x99, 0x14, 0xfb, 0x92,
0x81, 0xa1, 0xc7, 0xe2, 0x84, 0xd7, 0x3e, 0x67,
0xf1, 0x80, 0x9a, 0x48, 0xa4, 0x97, 0x20, 0x0e,
0x04, 0x6d, 0x39, 0xcc, 0xc7, 0x11, 0x2c, 0xd0
};
static const unsigned char addenum_1[SHA224_DIGEST_LENGTH] = {
0x23, 0x09, 0x7d, 0x22, 0x34, 0x05, 0xd8, 0x22,
0x86, 0x42, 0xa4, 0x77, 0xbd, 0xa2, 0x55, 0xb3,
0x2a, 0xad, 0xbc, 0xe4, 0xbd, 0xa0, 0xb3, 0xf7,
0xe3, 0x6c, 0x9d, 0xa7
};
static const unsigned char addenum_2[SHA224_DIGEST_LENGTH] = {
0x75, 0x38, 0x8b, 0x16, 0x51, 0x27, 0x76, 0xcc,
0x5d, 0xba, 0x5d, 0xa1, 0xfd, 0x89, 0x01, 0x50,
0xb0, 0xc6, 0x45, 0x5c, 0xb4, 0xf5, 0x8b, 0x19,
0x52, 0x52, 0x25, 0x25
};
static const unsigned char addenum_3[SHA224_DIGEST_LENGTH] = {
0x20, 0x79, 0x46, 0x55, 0x98, 0x0c, 0x91, 0xd8,
0xbb, 0xb4, 0xc1, 0xea, 0x97, 0x61, 0x8a, 0x4b,
0xf0, 0x3f, 0x42, 0x58, 0x19, 0x48, 0xb2, 0xee,
0x4e, 0xe7, 0xad, 0x67
};
int main(int argc, char **argv)
{
unsigned char md[SHA256_DIGEST_LENGTH];
int i;
EVP_MD_CTX *evp;
fprintf(stdout, "Testing SHA-256 ");
if (!EVP_Digest("abc", 3, md, NULL, EVP_sha256(), NULL))
goto err;
if (memcmp(md, app_b1, sizeof(app_b1))) {
fflush(stdout);
fprintf(stderr, "\nTEST 1 of 3 failed.\n");
return 1;
} else
fprintf(stdout, ".");
fflush(stdout);
if (!EVP_Digest("abcdbcde" "cdefdefg" "efghfghi" "ghijhijk"
"ijkljklm" "klmnlmno" "mnopnopq", 56, md,
NULL, EVP_sha256(), NULL))
goto err;
if (memcmp(md, app_b2, sizeof(app_b2))) {
fflush(stdout);
fprintf(stderr, "\nTEST 2 of 3 failed.\n");
return 1;
} else
fprintf(stdout, ".");
fflush(stdout);
evp = EVP_MD_CTX_new();
if (evp == NULL) {
fflush(stdout);
fprintf(stderr, "\nTEST 3 of 3 failed. (malloc failure)\n");
return 1;
}
if (!EVP_DigestInit_ex(evp, EVP_sha256(), NULL))
goto err;
for (i = 0; i < 1000000; i += 288) {
if (!EVP_DigestUpdate(evp, "aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa"
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa"
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa"
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa"
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa"
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa"
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa"
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa"
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa",
(1000000 - i) < 288 ? 1000000 - i : 288))
goto err;
}
if (!EVP_DigestFinal_ex(evp, md, NULL))
goto err;
if (memcmp(md, app_b3, sizeof(app_b3))) {
fflush(stdout);
fprintf(stderr, "\nTEST 3 of 3 failed.\n");
return 1;
} else
fprintf(stdout, ".");
fflush(stdout);
fprintf(stdout, " passed.\n");
fflush(stdout);
fprintf(stdout, "Testing SHA-224 ");
if (!EVP_Digest("abc", 3, md, NULL, EVP_sha224(), NULL))
goto err;
if (memcmp(md, addenum_1, sizeof(addenum_1))) {
fflush(stdout);
fprintf(stderr, "\nTEST 1 of 3 failed.\n");
return 1;
} else
fprintf(stdout, ".");
fflush(stdout);
if (!EVP_Digest("abcdbcde" "cdefdefg" "efghfghi" "ghijhijk"
"ijkljklm" "klmnlmno" "mnopnopq", 56, md,
NULL, EVP_sha224(), NULL))
goto err;
if (memcmp(md, addenum_2, sizeof(addenum_2))) {
fflush(stdout);
fprintf(stderr, "\nTEST 2 of 3 failed.\n");
return 1;
} else
fprintf(stdout, ".");
fflush(stdout);
EVP_MD_CTX_reset(evp);
if (!EVP_DigestInit_ex(evp, EVP_sha224(), NULL))
goto err;
for (i = 0; i < 1000000; i += 64) {
if (!EVP_DigestUpdate(evp, "aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa"
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa",
(1000000 - i) < 64 ? 1000000 - i : 64))
goto err;
}
if (!EVP_DigestFinal_ex(evp, md, NULL))
goto err;
EVP_MD_CTX_free(evp);
if (memcmp(md, addenum_3, sizeof(addenum_3))) {
fflush(stdout);
fprintf(stderr, "\nTEST 3 of 3 failed.\n");
return 1;
} else
fprintf(stdout, ".");
fflush(stdout);
fprintf(stdout, " passed.\n");
fflush(stdout);
return 0;
err:
fprintf(stderr, "Fatal EVP error!\n");
return 1;
}
|
//
// 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"
@class NSString, SCNAction;
@protocol SCNActionable <NSObject>
- (void)removeAllActions;
- (void)removeActionForKey:(NSString *)arg1;
- (SCNAction *)actionForKey:(NSString *)arg1;
- (BOOL)hasActions;
- (void)runAction:(SCNAction *)arg1 forKey:(NSString *)arg2 completionHandler:(void (^)(void))arg3;
- (void)runAction:(SCNAction *)arg1 forKey:(NSString *)arg2;
- (void)runAction:(SCNAction *)arg1 completionHandler:(void (^)(void))arg2;
- (void)runAction:(SCNAction *)arg1;
@end
|
/**
* This header is generated by class-dump-z 0.2a.
* class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3.
*
* Source: (null)
*/
#import <XXUnknownSuperclass.h> // Unknown library
#import "UITextViewDelegate.h"
#import "ChineseSkillNew-Structs.h"
@class NSURLConnection, NSMutableData, UIButton, NSString, UIPlaceHolderTextView, UIActivityIndicatorView, UITextField;
__attribute__((visibility("hidden")))
@interface iPhone6SendFeedbackViewController : XXUnknownSuperclass <UITextViewDelegate> {
UIButton* _cancelButton;
UITextField* _emailTextFiled;
UIPlaceHolderTextView* _feedbackTextView;
UIActivityIndicatorView* _activityView;
UIButton* _sendButton;
NSURLConnection* _connection;
NSMutableData* _feedXML;
}
@property(assign, nonatomic) __weak UIActivityIndicatorView* activityView;
@property(assign, nonatomic) __weak UIButton* cancelButton;
@property(retain, nonatomic) NSURLConnection* connection;
@property(readonly, copy) NSString* debugDescription;
@property(readonly, copy) NSString* description;
@property(assign, nonatomic) __weak UITextField* emailTextFiled;
@property(retain, nonatomic) NSMutableData* feedXML;
@property(assign, nonatomic) __weak UIPlaceHolderTextView* feedbackTextView;
@property(readonly, assign) unsigned hash;
@property(retain, nonatomic) UIButton* sendButton;
@property(readonly, assign) Class superclass;
- (id)initWithNibName:(id)nibName bundle:(id)bundle;
- (void).cxx_destruct;
- (void)BackButtonClick:(id)click;
- (BOOL)CheckUserEmail;
- (id)GetValueFromSettingDB:(id)settingDB;
- (void)SendButtonClick:(id)click;
- (void)connection:(id)connection didFailWithError:(id)error;
- (void)connection:(id)connection didReceiveData:(id)data;
- (void)connection:(id)connection didReceiveResponse:(id)response;
- (void)connectionDidFinishLoading:(id)connection;
- (void)didReceiveMemoryWarning;
- (void)handleError:(id)error;
- (BOOL)isStringContainSubstring:(id)substring SUBSTRING:(id)substring2;
- (void)setupNavview;
- (void)textViewDidChange:(id)textView;
- (void)viewDidAppear:(BOOL)view;
- (void)viewDidDisappear:(BOOL)view;
- (void)viewDidLoad;
@end
|
//
// ____ _ __ _ _____
// / ___\ /_\ /\/\ /\ /\ /__\ /_\ \_ \
// \ \ //_\\ / \ / / \ \ / \// //_\\ / /\/
// /\_\ \ / _ \ / /\/\ \ \ \_/ / / _ \ / _ \ /\/ /_
// \____/ \_/ \_/ \/ \/ \___/ \/ \_/ \_/ \_/ \____/
//
// Copyright Samurai development team and other contributors
//
// http://www.samurai-framework.com
//
// 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 "Samurai_ViewCore.h"
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
#pragma mark -
@interface HtmlElementPre : UILabel
@end
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
#pragma once
#include "style.h"
#include "typedMesh.h"
#include "glfontstash.h"
#include "tile/labels/labelContainer.h"
#include <memory>
class TextStyle : public Style {
protected:
struct PosTexID {
float pos_x;
float pos_y;
float tex_u;
float tex_v;
float fsID;
};
virtual void constructVertexLayout() override;
virtual void constructShaderProgram() override;
virtual void buildPoint(Point& _point, StyleParams& _params, Properties& _props, VboMesh& _mesh) const override;
virtual void buildLine(Line& _line, StyleParams& _params, Properties& _props, VboMesh& _mesh) const override;
virtual void buildPolygon(Polygon& _polygon, StyleParams& _params, Properties& _props, VboMesh& _mesh) const override;
virtual void onBeginBuildTile(MapTile& _tile) const override;
virtual void onEndBuildTile(MapTile& _tile) const override;
typedef TypedMesh<PosTexID> Mesh;
virtual VboMesh* newMesh() const override {
return new Mesh(m_vertexLayout, m_drawMode);
};
std::string m_fontName;
float m_fontSize;
int m_color;
bool m_sdf;
bool m_sdfMultisampling = true;
public:
TextStyle(const std::string& _fontName, std::string _name, float _fontSize, unsigned int _color = 0xffffff,
bool _sdf = false, bool _sdfMultisampling = false, GLenum _drawMode = GL_TRIANGLES);
virtual void onBeginDrawFrame(const std::shared_ptr<View>& _view, const std::shared_ptr<Scene>& _scene) override;
virtual void onBeginDrawTile(const std::shared_ptr<MapTile>& _tile) override;
virtual void onEndDrawFrame() override;
virtual ~TextStyle();
/*
* A pointer to the tile being currently processed, e.g. the tile which data is being added to
* nullptr if no tile is being processed
*/
static MapTile* s_processedTile;
};
|
// Copyright (c) 2009-2015 The PlanBcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QT_TEST_URITESTS_H
#define BITCOIN_QT_TEST_URITESTS_H
#include <QObject>
#include <QTest>
class URITests : public QObject
{
Q_OBJECT
private Q_SLOTS:
void uriTests();
};
#endif // BITCOIN_QT_TEST_URITESTS_H
|
#ifndef RPCCONSOLE_H
#define RPCCONSOLE_H
#include <QDialog>
namespace Ui {
class RPCConsole;
}
class ClientModel;
/** Local Rotocoin RPC console. */
class RPCConsole: public QDialog
{
Q_OBJECT
public:
explicit RPCConsole(QWidget *parent = 0);
~RPCConsole();
void setClientModel(ClientModel *model);
enum MessageClass {
MC_ERROR,
MC_DEBUG,
CMD_REQUEST,
CMD_REPLY,
CMD_ERROR
};
protected:
virtual bool eventFilter(QObject* obj, QEvent *event);
private slots:
void on_lineEdit_returnPressed();
void on_tabWidget_currentChanged(int index);
/** open the debug.log from the current datadir */
void on_openDebugLogfileButton_clicked();
/** display messagebox with program parameters (same as rotocoin-qt --help) */
void on_showCLOptionsButton_clicked();
public slots:
void clear();
void message(int category, const QString &message, bool html = false);
/** Set number of connections shown in the UI */
void setNumConnections(int count);
/** Set number of blocks shown in the UI */
void setNumBlocks(int count, int countOfPeers);
/** Go forward or back in history */
void browseHistory(int offset);
/** Scroll console view to end */
void scrollToEnd();
signals:
// For RPC command executor
void stopExecutor();
void cmdRequest(const QString &command);
private:
Ui::RPCConsole *ui;
ClientModel *clientModel;
QStringList history;
int historyPtr;
void startExecutor();
};
#endif // RPCCONSOLE_H
|
/********************************************************************************
* The MIT License (MIT) *
* *
* Copyright (C) 2016 Alex Nolasco *
* *
*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 "HL7SummaryEntry.h"
@class HL7CodeSummary;
@class HL7DateRange;
@interface HL7MedicationSummaryEntry : HL7SummaryEntry <NSCopying, NSCoding>
- (HL7CodeSummary *_Nullable)routeCode;
- (NSString *_Nullable)doseQuantityValue;
- (NSString *_Nullable)doseQuantityUnit;
- (NSString *_Nullable)periodValue;
- (NSString *_Nullable)periodUnit;
- (HL7DateRange *_Nullable)effectiveTime;
- (BOOL)statusIsUnknown;
- (BOOL)active;
@end
|
//
// CKCoursesTableViewController.h
// CanvasKit 2.0 Example
//
// Created by rroberts on 9/17/13.
// Copyright (c) 2013 Instructure. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CKCoursesTableViewController : UITableViewController
@property (nonatomic, strong) NSMutableArray *courses;
@end
|
/* CoreAnimation - CAEAGLLayer.h
Copyright (c) 2007-2016, Apple Inc.
All rights reserved. */
#import <QuartzCore/CALayer.h>
#import <OpenGLES/EAGLDrawable.h>
NS_ASSUME_NONNULL_BEGIN
/* CAEAGLLayer is a layer that implements the EAGLDrawable protocol,
* allowing it to be used as an OpenGLES render target. Use the
* `drawableProperties' property defined by the protocol to configure
* the created surface. */
@interface CAEAGLLayer : CALayer <EAGLDrawable>
{
@private
struct _CAEAGLNativeWindow *_win;
}
/* When false (the default value) changes to the layer's render buffer
* appear on-screen asynchronously to normal layer updates. When true,
* changes to the GLES content are sent to the screen via the standard
* CATransaction mechanisms. */
@property BOOL presentsWithTransaction NS_AVAILABLE_IOS(9_0);
/* Note: the default value of the `opaque' property in this class is true,
* not false as in CALayer. */
@end
NS_ASSUME_NONNULL_END
|
//
// RLSlideAnimatingTableViewController.h
// RLooking
//
// Created by Madimo on 14/12/5.
// Copyright (c) 2014 Madimo. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "RLTableViewController.h"
@interface RLSlideAnimatingTableViewController : RLTableViewController
@property (nonatomic) BOOL stopSlideAnimating;
@end
|
/**
* problem:
* Reverse a singly linked list.
* examples:
* 1 => 1 (single node)
* 1 -> 2 => 2 -> 1 (two nodes)
* 1 -> 2 -> 3 => 3 -> 2 -> 1 (multiple nodes)
*
* complexity:
* time = O(N)
* space = O(1)
**/
#include "test.h"
/*
typedef struct Node {
int data;
struct Node *next;
} Node;
*/
/**
* Create a new list by popping nodes from the given list and inserting it at
* the beginning of the new list.
**/
void reverseList(Node **head) {
/* check input args */
/**
* Pop nodes from orig list and insert them at the beginning of the new list
**/
/* set the head pointer */
}
|
//
// STAButton.h
// STAControls
//
// Created by Aaron Jubbal on 5/18/15.
// Copyright (c) 2015 Aaron Jubbal. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface STAButton : UIButton
- (void)setBackgroundColor:(UIColor *)backgroundColor
forState:(UIControlState)state;
/**
@param title The title to set to the button, denote new lines with '\\n'.
@param attributes An array of dictionaries containing attributes that should be applied to
each line of text (first item in the array applies to row 1, etc.). If attributes are omitted,
then the last line's attributes will be applied to subsquent lines.
@param state The state that uses the specified title. Is fed into `addAttributes:range:`.
*/
- (void)setMultilineTitle:(NSString *)title
withLineAttributes:(NSArray<NSDictionary *> *)attributes
forState:(UIControlState)state;
@end
|
//
// HelloWorldLayer.h
// TP2
//
// Created by AdminMacLC02 on 11/7/13.
// Copyright bb 2013. All rights reserved.
//
#import <GameKit/GameKit.h>
// When you import this file, you import all the cocos2d classes
#import "cocos2d.h"
// Importing Chipmunk headers
#import "chipmunk.h"
@interface HelloWorldLayer2 : CCLayer <GKAchievementViewControllerDelegate, GKLeaderboardViewControllerDelegate>
{
CCTexture2D *_spriteTexture; // weak ref
CCPhysicsDebugNode *_debugLayer; // weak ref
cpSpace *_space; // strong ref
cpShape *_walls[4];
}
// returns a CCScene that contains the HelloWorldLayer as the only child
+(CCScene *) scene;
@end
|
/**
******************************************************************************
* @file stm8l_eval_i2c_ee.h
* @author MCD Application Team
* @version V1.2.1
* @date 30-September-2014
* @brief This file contains all the functions prototypes for the stm8_eval_i2c_ee
* firmware driver.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM8L_EVAL_I2C_EE_H
#define __STM8L_EVAL_I2C_EE_H
/* Includes ------------------------------------------------------------------*/
#include "stm8l101_eval.h"
/** @addtogroup Utilities
* @{
*/
/** @addtogroup STM8L101_EVAL
* @{
*/
/** @addtogroup Common
* @{
*/
/** @addtogroup STM8L_EVAL_I2C_EE
* @{
*/
/* Private types -------------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/** @defgroup STM8L_EVAL_I2C_EE_Private_define
* @{
*/
#if !defined (sEE_M24C64_32)
/* Use the defines below the choose the EEPROM type */
#define sEE_M24C64_32 /* Support the devices: M24C32 and M24C64 */
#endif
#ifdef sEE_M24C64_32
/* For M24C32 and M24C64 devices, E0,E1 and E2 pins are all used for device
address selection (ne need for additional address lines). According to the
Hardware connection on the board (on STM8L1x-EVAL board E0 = E1 = E2 = 0) */
#define sEE_HW_ADDRESS 0xA0 /* E0 = E1 = E2 = 0 */
#endif /* sEE_M24C64_32 */
#define I2C_SPEED 200000
#define I2C_SLAVE_ADDRESS7 0xA0
#if defined (sEE_M24C64_32)
#define sEE_PAGESIZE 32
#endif
/* Maximum timeout value for counting before exiting waiting loop.
This value depends directly on the maximum page size and
the sytem clock frequency. */
#define sEE_TIMEOUT_MAX 0x10000
/**
* @}
*/
/* Private macro -------------------------------------------------------------*/
/** @defgroup STM8L_EVAL_I2C_EE_Exported_Functions
* @{
*/
void sEE_DeInit(void);
void sEE_Init(void);
void sEE_WriteByte(uint8_t* pBuffer, uint16_t WriteAddr);
void sEE_WritePage(uint8_t* pBuffer, uint16_t WriteAddr, uint8_t* NumByteToWrite);
void sEE_WriteBuffer(uint8_t* pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite);
void sEE_ReadBuffer(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t* NumByteToRead);
void sEE_WaitEepromStandbyState(void);
#endif /* __STM8L_EVAL_I2C_EE_H */
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
#pragma once
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Windows XP or later.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#endif
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h> // MFC OLE classes
#include <afxodlgs.h> // MFC OLE dialog classes
#include <afxdisp.h> // MFC Automation classes
#endif // _AFX_NO_OLE_SUPPORT
#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h> // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT
#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h> // MFC DAO database classes
#endif // _AFX_NO_DAO_SUPPORT
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <atlbase.h>
|
//
// ValidationCallbackHandler.h
// Miruken
//
// Created by Craig Neuwirt on 2/4/13.
// Copyright (c) 2013 Craig Neuwirt. All rights reserved.
//
#import "MKDynamicCallbackHandler.h"
#import "MKValidation.h"
@interface MKValidateCallbackHandler : MKDynamicCallbackHandler <MKValidation>
@end
|
//
// VESiteOperator.h
// V2EX
//
// Created by baiyang on 8/29/15.
// Copyright (c) 2015 owl. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface VESiteOperator : NSObject
+ (NSURLSessionDataTask *)siteInfoWithBlock:(void (^)(id siteInfo, NSError *error))block;
+ (NSURLSessionDataTask *)siteStatsWithBlock:(void (^)(id siteStats, NSError *error))block;
@end
|
#include "global.h"
void orthosetup(){
glLoadIdentity();
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0,xres,0,yres,-1,1);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
}
void orthoreset(){
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glEnable(GL_DEPTH_TEST);
}
|
#ifndef BASICBUTTON_H_INCLUDED
#define BASICBUTTON_H_INCLUDED
#include "Button.h"
namespace GUI
{
class BasicButton : public Button
{
public:
BasicButton(const std::string& text,
std::function<void(void)> function);
void onClick() override;
void onMouseTouch() override;
void onNoInteract() override;
void draw (MasterRenderer& renderer) noexcept override;
void setPosition (const sf::Vector2f& position) override;
const sf::Vector2f getSize () const override;
private:
std::function<void(void)> m_function;
sf::RectangleShape m_quad;
sf::Text m_text;
};
}
#endif // BASICBUTTON_H_INCLUDED
|
//
// ContentfulModelGenerator.h
// ContentfulPlugin
//
// Created by Boris Bügling on 10/11/14.
// Copyright (c) 2014 Contentful GmbH. All rights reserved.
//
#import <CoreData/CoreData.h>
#import <Foundation/Foundation.h>
@class CMAClient;
typedef void(^CDAModelGenerationHandler)(NSManagedObjectModel* model, NSError* error);
@interface ContentfulModelGenerator : NSObject
-(void)generateModelForContentTypesWithCompletionHandler:(CDAModelGenerationHandler)handler;
-(instancetype)initWithClient:(CMAClient*)client spaceKey:(NSString*)spaceKey;
@end
|
// Copyright (c) 2016 Niklas Rosenstein
//
// 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.
/*!
* @file nr/c4d/cleanup.h
* @created 2016-07-09
* @brief Useful for cleaning up plugin registrations on PluginEnd().
*/
#pragma once
#include <c4d.h>
#include "functional.h"
namespace nr {
namespace c4d {
/*!
* Represents a node in the linked list of cleanup functions.
*/
struct cleanup_handler {
Bool heap;
std::function<void()> func;
cleanup_handler* next = nullptr;
cleanup_handler(cleanup_handler const&) = delete;
cleanup_handler(cleanup_handler&&) = delete;
cleanup_handler() : heap(false), func(), next(nullptr) { }
/*!
* Automatically adds the constructed object to the cleanup chain.
*/
inline cleanup_handler(std::function<void()>&& func_, Bool heap=false);
};
/*!
* The global head of the cleanup chain.
*/
extern cleanup_handler _cleanup_head;
/*!
* Register a cleanup handler.
*/
inline void cleanup(std::function<void()>&& func) {
// Gets automatically added to the chain when constructed.
cleanup_handler* curr = new cleanup_handler(std::forward<decltype(func)>(func), true);
CriticalAssert(curr != nullptr && "could not allocate a cleanup node");
}
/*!
* Call this function in #PluginEnd() to perform the cleanup.
*/
inline void do_cleanup() {
cleanup_handler* curr = &_cleanup_head;
while (curr) {
if (curr->func) curr->func();
cleanup_handler* next = curr->next;
// TODO: Called from C4DPL_ENDACTIVITY, this causes an EXC_BAD_ACCESS
// on MacOS in a release build. Since this function is supposed to be
// called at the end of C4D, it's currently not that important that
// the memory is really freed. Still, it should be addressed at some
// point in the future.
//if (curr->heap) DeleteObj(curr);
curr = next;
}
}
cleanup_handler::cleanup_handler(std::function<void()>&& func_, Bool heap_)
: heap(heap_), func(func_), next(nullptr)
{
// Find the last node in the chain.
cleanup_handler* last = &_cleanup_head;
while (last->next)
last = last->next;
last->next = this;
}
}} // namespace nr::c4d
|
#include <msp430g2553.h>
#include "uart.h"
void UART_Init()
{
P1SEL |= BIT1 + BIT2;
P1SEL2 |= BIT1 + BIT2;
UCA0CTL0 &= ~UC7BIT;
UCA0CTL1 |= UCSSEL_2 + UCSWRST;
UCA0BR0 = 52;
UCA0BR1 = 0;
UCA0MCTL = UCBRS0 + UCBRF1 + UCOS16;
}
void UART_Enable()
{
UCA0CTL1 &= ~UCSWRST;
}
void UART_Disable()
{
UCA0CTL1 |= UCSWRST;
}
void UART_Send(uchar data)
{
while (!(UC0IFG & UCA0TXIFG));
UCA0TXBUF = data;
}
|
#ifndef _DECK_
#define _DECK_
#include "card.h"
enum PokerRank {Nothing, Pair, TwoPair, ThreeOfAKind,
Straight, Flush, FullHouse, FourOfAKind,
StraightFlush, RoyalFlush};
class Deck
{
private:
Card theDeck[52];
int size;
public:
// Build a proper deck with size=52
Deck();
// Build a proper deck but also specify size
Deck(int);
// Reset deck to a proper deck
void Reset(int inSize = 52);
// Should call Print for each Card left in the deck.
void Print();
// Draw the cards
void PrintHand();
// Must use time as the random generator seed.
// Shuffle resets the deck to full
void Shuffle();
// Is the deck empty?
bool IsEmpty();
// Pre-condition: The deck is not empty.
Card DealACard();
// Return a DECK with the top X cards from this deck, removing them from this deck too
Deck Deal(int);
//Add a CARD to the top of the deck
void Add(Card);
//Add a DECK to the top of this deck
void Add(Deck&);
//Add a CARD to the bottom of the deck
void AddBottom(Card);
//Add a DECK to the bottom of the deck
void AddBottom(Deck&);
//Return number of cards in deck
int Count();
//Return the number of cards with a specific face value
int Count(FaceValue);
//Return the number of cards with a specific suit
int Count(Suit);
// Discard a card with specified index in the array.
void Discard(int = 0);
// Replace a specified card with a new card
void Replace(int, Card);
PokerRank Strength();
};
int random(int, int);
#endif |
#pragma once
#include <QObject>
// the base type of all the objects in the application that whises to use
// the reflection layer
// it also supplies each object with a unique ID
class Type : public QObject
{
Q_OBJECT
public:
Type();
virtual ~Type(){}
size_t getID();
private:
size_t mUID; // unique ID for the object
static size_t UID;
};
|
#pragma once
//#pragma warning( disable : 4201)
//#pragma warning( disable : 4514)
#include "ModelBase/BioSIMModelBase.h"
//#include "ContinuingRatio.h"
namespace WBSF
{
class CSBWEldonModel : public CBioSIMModelBase
{
public:
enum TSpecies { BALSAM_FIR, WHITE_SPRUCE, NB_SPECIES };
enum TParams { A2, A3, A4, A5, A6, A7, B, NB_PARAMS };
enum TStages { L2, L3, L4, L5, L6, L7, L8, NB_STAGES };
CSBWEldonModel();
virtual ~CSBWEldonModel();
virtual ERMsg OnExecuteDaily()override;
virtual ERMsg ProcessParameters(const CParameterVector& parameters)override;
static CBioSIMModelBase* CreateObject() { return new CSBWEldonModel; }
ERMsg ExecuteModel(CModelStatVector& stat);
protected:
std::array<double, NB_STAGES> OneDay(double ddays)const;
size_t m_species;
};
} |
#ifndef TYPES_H
#define TYPES_H
#include <stdint.h>
#include "common/iter.h"
#include "console/types.h"
typedef Common::Point16 Point;
using Common::Point32;
using Common::Rect16;
using Common::Rect32;
using Common::Rect;
using Common::x16u;
using Common::x32;
using Common::y16u;
using Common::y32;
using xuint = Common::xint<unsigned int>;
using yuint = Common::yint<unsigned int>;
using Common::Array;
using Common::reference;
using Common::ptr;
using Common::vector;
using Common::Iterator;
using Common::Optional;
using Common::Empty;
using std::tuple;
using std::make_tuple;
using std::move;
using std::make_unique;
using std::ref;
using std::cref;
#ifdef CONSOLE
const bool UseConsole = true;
#else
const bool UseConsole = false;
#endif
#ifdef PERFORMANCE_DEBUG
const bool PerfTest = true;
#else
const bool PerfTest = false;
#endif
#ifdef SYNC
const bool SyncTest = true;
#else
const bool SyncTest = false;
#endif
#ifdef DEBUG
const bool Debug = true;
#else
const bool Debug = false;
#endif
#ifdef STATIC_SEED
const uint32_t StaticSeed = STATIC_SEED;
#else
const uint32_t StaticSeed = 0;
#endif
const unsigned int NeutralPlayer = 0xb;
const unsigned int AllPlayers = 0x11;
class Unit;
class Sprite;
class LoneSpriteSystem;
class Image;
class Bullet;
class BulletSystem;
class DamagedUnit;
class Flingy;
class Entity;
class Tbl;
class Path;
class Order;
class Control;
class Dialog;
class TempMemoryPool;
class Rng;
class Save;
class Load;
class GrpFrameHeader;
class GameTests;
struct Contour;
struct PathingData;
struct Surface;
struct ReplayData;
struct MovementGroup;
struct NetPlayer;
struct Player;
struct ImgRenderFuncs;
struct ImgUpdateFunc;
struct BlendPalette;
struct Surface;
struct DrawLayer;
struct CollisionArea;
struct Trigger;
struct TriggerList;
struct TriggerAction;
struct ReplayData;
struct GameData;
struct File;
struct PlacementBox;
struct GrpSprite;
struct ReplayHeader;
struct Location;
struct MapDirEntry;
struct MapDl;
struct Event;
struct CycleStruct;
template <class Type, unsigned size = 15> class UnitList;
template <class C, unsigned offset> class RevListHead;
template <class C, unsigned offset> class ListHead;
template <class SaveLoad> class SaveBase;
namespace Common
{
class PatchContext;
}
namespace Ai
{
struct PlayerData;
struct Region;
class Script;
class Town;
class UnitAi;
class GuardAi;
class WorkerAi;
class BuildingAi;
class MilitaryAi;
class HitUnit;
template <class C> class DataList;
struct ResourceArea;
struct ResourceAreaArray;
class BestPickedTarget;
}
namespace Pathing
{
struct Region;
struct PathingSystem;
}
namespace Iscript
{
class Script;
}
class UnitIscriptContext;
class BulletIscriptContext;
#endif // TYPES_H
|
//
// ViewController.h
// 效果集1
//
// Created by Jacob_Liang on 16/10/16.
// Copyright © 2016年 Jacob. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#ifndef POMDP_ENVIRONMENT_H_
#define POMDP_ENVIRONMENT_H_
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <Eigen/Eigen>
using std::string ;
using std::getline ;
using std::stringstream ;
using std::ifstream ;
using std::vector ;
using namespace Eigen ;
class POMDPEnvironment{
public:
POMDPEnvironment(char *) ;
~POMDPEnvironment(){}
VectorXd UpdateBelief(VectorXd, size_t, size_t) ;
double GetDiscount(){return discount ;}
string GetValues(){return values ;}
vector<string> GetStates(){return states ;}
vector<string> GetActions(){return actions ;}
vector<string> GetObservations(){return observations ;}
vector<MatrixXd> GetTransitions(){return T ;}
vector<MatrixXd> GetObservationProbabilities(){return Z ;}
vector< vector<MatrixXd> > GetRewards(){return R ;} ;
private:
double discount ;
string values ;
vector<string> states ;
vector<string> actions ;
vector<string> observations ;
vector<MatrixXd> T ; // action, initial state, transitioned state
vector<MatrixXd> Z ; // action, initial state, observation
vector< vector<MatrixXd> > R ; // initial state, transitioned state, action, observation
} ;
#endif // POMDP_ENVIRONMENT_H_
|
//
// Text.h
// ChilliSource
// Created by Ian Copland on 05/11/2014.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Tag Games Limited
//
// 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 _CHILLISOURCE_UI_TEXT_H_
#define _CHILLISOURCE_UI_TEXT_H_
#include <ChilliSource/ChilliSource.h>
#include <ChilliSource/UI/Text/EditableTextUIComponent.h>
#include <ChilliSource/UI/Text/TextUIComponent.h>
#include <ChilliSource/UI/Text/TextIcon.h>
#endif
|
//
// WCProjectContainer.h
// WabbitStudio
//
// Created by William Towe on 1/13/12.
// Copyright (c) 2012 Revolution Software.
//
// 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 "WCGroupContainer.h"
@class WCProject;
@interface WCProjectContainer : WCGroupContainer
@property (readonly,nonatomic) WCProject *project;
+ (id)projectContainerWithProject:(WCProject *)project;
- (id)initWithProject:(WCProject *)project;
@end
|
// design rationale: now COW-Idiom here, is too complicated to get right and might lead to unexpected behaviour (that is, it
// can cost the original owner(-thread) of the image cpu time in case he is first to modifiy the image and then needs to
// copy it. Also, a user would have to declare the copied image constant to avoid copies, if an access operator is invoked
// (even only for read access)
|
#ifndef _core_h
#define _core_h
#define SIMULATE_QRS 0
#define SIMULATE_G1 0x0010
#define SIMULATE_G2 0x0020
#define SIMULATE_G3 0x0040
#define FPS 60.0
#define G2_FPS 61.68
#define RECENT_FRAMES 60
#define FRAMEDELAY_ERR 0
#define BUTTON_PRESSED_THIS_FRAME 2
#define JOYSTICK_DEAD_ZONE 8000
#include <vector>
#include <memory>
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>
#include "SGUIL/SGUIL.hpp"
typedef struct coreState_ coreState;
#include "grid.h"
#include "gfx_structures.h"
#include "audio.h"
#include "scores.h"
#include "player.h"
enum {
MODE_INVALID,
QUINTESSE
};
struct bindings
{
SDL_Keycode left;
SDL_Keycode right;
SDL_Keycode up;
SDL_Keycode down;
SDL_Keycode start;
SDL_Keycode a;
SDL_Keycode b;
SDL_Keycode c;
SDL_Keycode d;
SDL_Keycode escape;
};
typedef enum {
DAS_NONE,
DAS_LEFT,
DAS_RIGHT,
DAS_UP,
DAS_DOWN
} das_direction;
struct keyflags
{
Uint8 left;
Uint8 right;
Uint8 up;
Uint8 down;
Uint8 a;
Uint8 b;
Uint8 c;
Uint8 d;
Uint8 start;
Uint8 escape;
};
struct assetdb
{
gfx_image ASSET_IMG_NONE = {NULL};
#define IMG(name, filename) gfx_image name;
#include "images.h"
#undef IMG
#define FONT(name, sheetName, outlineSheetName, charW, charH) BitFont name;
#include "fonts.h"
#undef FONT
#define MUS(name, filename) struct music name;
#include "music.h"
#undef MUS
#define SFX(name) struct sfx name;
#include "sfx.h"
#undef SFX
};
struct settings
{
struct bindings *keybinds;
float video_scale;
bool video_stretch;
bool fullscreen;
int master_volume;
int sfx_volume;
int mus_volume;
char *home_path;
const char *player_name;
};
typedef struct game game_t;
#include "qrs.h"
struct coreState_
{
double fps; // because tap fps = 61.68
int text_editing;
int (*text_toggle)(coreState *); // used to abstract text editing functions, can be set/called by other parts of the code
int (*text_insert)(coreState *, char *);
int (*text_backspace)(coreState *);
int (*text_delete)(coreState *);
int (*text_seek_left)(coreState *);
int (*text_seek_right)(coreState *);
int (*text_seek_home)(coreState *);
int (*text_seek_end)(coreState *);
int (*text_select_all)(coreState *);
int (*text_copy)(coreState *);
int (*text_cut)(coreState *);
int left_arrow_das;
int right_arrow_das;
int backspace_das;
int delete_das;
int select_all;
int undo;
int redo;
int zero_pressed;
int one_pressed;
int two_pressed;
int three_pressed;
int four_pressed;
int five_pressed;
int six_pressed;
int seven_pressed;
int nine_pressed;
struct {
char *name;
unsigned int w;
unsigned int h;
SDL_Window *window;
SDL_Renderer *renderer;
//SDL_Texture *target_tex;
} screen;
char *cfg_filename;
char *calling_path;
struct settings *settings;
struct assetdb *assets;
SDL_Texture *bg;
SDL_Texture *bg_old;
//gfx_animation *g2_bgs[10];
//gfx_animation *anim_bg;
//gfx_animation *anim_bg_old;
gfx_message **gfx_messages;
gfx_animation **gfx_animations;
gfx_button **gfx_buttons;
int gfx_messages_max;
int gfx_animations_max;
int gfx_buttons_max;
struct keyflags prev_keys_raw;
struct keyflags keys_raw;
struct keyflags prev_keys;
struct keyflags keys;
struct keyflags pressed;
das_direction hold_dir;
int hold_time;
SDL_Joystick *joystick;
int mouse_x;
int mouse_y;
int mouse_left_down;
int mouse_right_down;
int master_volume;
int sfx_volume;
int mus_volume;
int menu_input_override;
int button_emergency_override;
game_t *p1game;
game_t *menu;
struct pracdata *pracdata_mirror;
std::vector<std::unique_ptr<GuiWindow>> guiWindowList;
long double avg_sleep_ms;
long double avg_sleep_ms_recent;
long frames;
long double avg_sleep_ms_recent_array[RECENT_FRAMES];
int recent_frame_overload;
struct scoredb scores;
struct player player;
};
struct game
{
int (*init)(game_t *);
int (*quit)(game_t *);
int (*preframe)(game_t *);
int (*input)(game_t *);
int (*frame)(game_t *);
int (*draw)(game_t *);
unsigned long frame_counter;
coreState *origin;
grid_t *field;
void *data;
};
extern struct bindings defaultkeybinds[2];
extern struct settings defaultsettings;
extern BindableVariables bindables;
int is_left_input_repeat(coreState *cs, int delay);
int is_right_input_repeat(coreState *cs, int delay);
int is_up_input_repeat(coreState *cs, int delay);
int is_down_input_repeat(coreState *cs, int delay);
struct bindings *bindings_copy(struct bindings *src);
void coreState_initialize(coreState *cs);
void coreState_destroy(coreState *cs);
gfx_animation *load_anim_bg(coreState *cs, const char *directory, int frame_multiplier);
int load_files(coreState *cs);
int init(coreState *cs, struct settings *s);
void quit(coreState *cs);
int run(coreState *cs);
int procevents(coreState *cs);
int procgame(game_t *g, int input_enabled);
void handle_replay_input(coreState* cs);
void update_input_repeat(coreState *cs);
void update_pressed(coreState *cs);
int button_emergency_inactive(coreState *cs);
int gfx_buttons_input(coreState *cs);
int request_fps(coreState *cs, double fps);
#endif
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_Emmlytics_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_Emmlytics_ExampleVersionString[];
|
/*
* Generated by class-dump 3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard.
*/
#import "NSView.h"
@interface RoundedCornersView : NSView
{
}
- (void)drawRect:(struct CGRect)arg1;
@end
|
//
// MRCSearchBar.h
// MVVMReactiveCocoa
//
// Created by leichunfeng on 15/11/15.
// Copyright © 2015年 leichunfeng. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MRCSearchBar : UISearchBar
- (UIImageView *)imageView;
@end
|
/*
* SpanDSP - a series of DSP components for telephony
*
* g711.c - A-law and u-law transcoding routines
*
* Written by Steve Underwood <steveu@coppice.org>
*
* Copyright (C) 2006 Steve Underwood
*
* Despite my general liking of the GPL, I place this code in the
* public domain for the benefit of all mankind - even the slimy
* ones who might try to proprietize my work and use it to my
* detriment.
*
* $Id: g711.c,v 1.1 2006/06/07 15:46:39 steveu Exp $
*
* Modifications for WebRtc, 2011/04/28, by tlegrand:
* -Removed unused include files
* -Changed to use WebRtc types
* -Added option to run encoder bitexact with ITU-T reference implementation
*/
#include BOSS_WEBRTC_U_modules__third_party__g711__g711_h //original-code:"modules/third_party/g711/g711.h"
/* Copied from the CCITT G.711 specification */
static const uint8_t ulaw_to_alaw_table[256] = {
42, 43, 40, 41, 46, 47, 44, 45, 34, 35, 32, 33, 38, 39, 36,
37, 58, 59, 56, 57, 62, 63, 60, 61, 50, 51, 48, 49, 54, 55,
52, 53, 10, 11, 8, 9, 14, 15, 12, 13, 2, 3, 0, 1, 6,
7, 4, 26, 27, 24, 25, 30, 31, 28, 29, 18, 19, 16, 17, 22,
23, 20, 21, 106, 104, 105, 110, 111, 108, 109, 98, 99, 96, 97, 102,
103, 100, 101, 122, 120, 126, 127, 124, 125, 114, 115, 112, 113, 118, 119,
116, 117, 75, 73, 79, 77, 66, 67, 64, 65, 70, 71, 68, 69, 90,
91, 88, 89, 94, 95, 92, 93, 82, 82, 83, 83, 80, 80, 81, 81,
86, 86, 87, 87, 84, 84, 85, 85, 170, 171, 168, 169, 174, 175, 172,
173, 162, 163, 160, 161, 166, 167, 164, 165, 186, 187, 184, 185, 190, 191,
188, 189, 178, 179, 176, 177, 182, 183, 180, 181, 138, 139, 136, 137, 142,
143, 140, 141, 130, 131, 128, 129, 134, 135, 132, 154, 155, 152, 153, 158,
159, 156, 157, 146, 147, 144, 145, 150, 151, 148, 149, 234, 232, 233, 238,
239, 236, 237, 226, 227, 224, 225, 230, 231, 228, 229, 250, 248, 254, 255,
252, 253, 242, 243, 240, 241, 246, 247, 244, 245, 203, 201, 207, 205, 194,
195, 192, 193, 198, 199, 196, 197, 218, 219, 216, 217, 222, 223, 220, 221,
210, 210, 211, 211, 208, 208, 209, 209, 214, 214, 215, 215, 212, 212, 213,
213
};
/* These transcoding tables are copied from the CCITT G.711 specification. To
achieve optimal results, do not change them. */
static const uint8_t alaw_to_ulaw_table[256] = {
42, 43, 40, 41, 46, 47, 44, 45, 34, 35, 32, 33, 38, 39, 36,
37, 57, 58, 55, 56, 61, 62, 59, 60, 49, 50, 47, 48, 53, 54,
51, 52, 10, 11, 8, 9, 14, 15, 12, 13, 2, 3, 0, 1, 6,
7, 4, 5, 26, 27, 24, 25, 30, 31, 28, 29, 18, 19, 16, 17,
22, 23, 20, 21, 98, 99, 96, 97, 102, 103, 100, 101, 93, 93, 92,
92, 95, 95, 94, 94, 116, 118, 112, 114, 124, 126, 120, 122, 106, 107,
104, 105, 110, 111, 108, 109, 72, 73, 70, 71, 76, 77, 74, 75, 64,
65, 63, 63, 68, 69, 66, 67, 86, 87, 84, 85, 90, 91, 88, 89,
79, 79, 78, 78, 82, 83, 80, 81, 170, 171, 168, 169, 174, 175, 172,
173, 162, 163, 160, 161, 166, 167, 164, 165, 185, 186, 183, 184, 189, 190,
187, 188, 177, 178, 175, 176, 181, 182, 179, 180, 138, 139, 136, 137, 142,
143, 140, 141, 130, 131, 128, 129, 134, 135, 132, 133, 154, 155, 152, 153,
158, 159, 156, 157, 146, 147, 144, 145, 150, 151, 148, 149, 226, 227, 224,
225, 230, 231, 228, 229, 221, 221, 220, 220, 223, 223, 222, 222, 244, 246,
240, 242, 252, 254, 248, 250, 234, 235, 232, 233, 238, 239, 236, 237, 200,
201, 198, 199, 204, 205, 202, 203, 192, 193, 191, 191, 196, 197, 194, 195,
214, 215, 212, 213, 218, 219, 216, 217, 207, 207, 206, 206, 210, 211, 208,
209
};
uint8_t alaw_to_ulaw(uint8_t alaw) { return alaw_to_ulaw_table[alaw]; }
uint8_t ulaw_to_alaw(uint8_t ulaw) { return ulaw_to_alaw_table[ulaw]; }
|
//
// DASravnenieNavigationBar.h
// AMSlideMenu
//
// Created by Егор on 8/26/14.
// Copyright (c) 2014 Artur Mkrtchyan. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface DASravnenieNavigationItem : UINavigationItem
@end
|
//
// NeoHttpFormTask.h
// TestLibuv
//
// Created by Ryou Zhang on 6/14/14.
// Copyright (c) 2014 Ryou Zhang. All rights reserved.
//
#import "NeoHttpTask.h"
@interface NeoHttpFormTask : NeoHttpTask {
@private
struct curl_httppost *_formData;
}
@end
|
//
// DZAdjustFrame.h
// Pods
//
// Created by stonedong on 16/5/4.
//
//
#ifndef DZAdjustFrame_h
#define DZAdjustFrame_h
#import "AdjustFrame.h"
#import "DZGrowImageView.h"
#import "DZGrowTextView.h"
#import "DZGrowLabel.h"
#import "DZAdjustTableView.h"
#endif /* DZAdjustFrame_h */
|
/*
* FTGL - OpenGL font library
*
* Copyright (c) 2001-2004 Henry Maddocks <ftgl@opengl.geek.nz>
* Copyright (c) 2008 Sam Hocevar <sam@zoy.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 _DIFONT_ExtrudeFontImpl__
#define _DIFONT_ExtrudeFontImpl__
#include "FontImpl.h"
namespace difont {
class Glyph;
class ExtrudeFontImpl : public FontImpl {
friend class ExtrudeFont;
protected:
ExtrudeFontImpl(Font *ftFont, const char* fontFilePath);
ExtrudeFontImpl(Font *ftFont, const unsigned char *pBufferBytes,
size_t bufferSizeInBytes);
/**
* Set the extrusion distance for the font.
*
* @param d The extrusion distance.
*/
virtual void Depth(float d) { depth = d; }
/**
* Set the outset distance for the font. Only implemented by
* OutlineFont, PolygonFont and ExtrudeFont
*
* @param o The outset distance.
*/
virtual void Outset(float o) { front = back = o; }
/**
* Set the outset distance for the font. Only implemented by
* ExtrudeFont
*
* @param f The front outset distance.
* @param b The back outset distance.
*/
virtual void Outset(float f, float b) { front = f; back = b; }
private:
/**
* The extrusion distance for the font.
*/
float depth;
/**
* The outset distance (front and back) for the font.
*/
float front, back;
};
}
#endif // __ExtrudeFontImpl__
|
/*
* ProjectEuler/src/c/Problem063.c
*
* Powerful digit counts
* =====================
* Published on Friday, 13th February 2004, 06:00 pm
*
* The 5-digit number, 16807=75, is also a fifth power. Similarly, the 9-digit
* number, 134217728=89, is a ninth power. How many n-digit positive integers
* exist which are also an nth power?
*/
#include <stdio.h>
#include "ProjectEuler/ProjectEuler.h"
#include "ProjectEuler/Problem063.h"
int main(int argc, char** argv) {
return 0;
} |
/*
* Copyright (c) 2012 Rafael Rivera
*
* 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
#include <SDKDDKVer.h>
|
//
// ZNGContactGroup.h
// Pods
//
// Created by Jason Neel on 6/15/17.
//
//
#import <Mantle/Mantle.h>
@class ZNGCondition;
@interface ZNGContactGroup : MTLModel <MTLJSONSerializing>
@property (nonatomic, copy, nonnull) NSString * groupId;
@property (nonatomic, copy, nullable) NSString * displayName;
@property (nonatomic, copy, nullable) NSString * conditionBooleanOperator;
@property (nonatomic, strong, nullable) NSArray<ZNGCondition *> * conditions;
@property (nonatomic, copy, nonnull) UIColor * textColor;
@property (nonatomic, copy, nonnull) UIColor * backgroundColor;
- (BOOL) matchesSearchTerm:(NSString * _Nonnull)term;
@end
|
#ifndef CController_H
#define CController_H
//turn off the warnings for the STL
#pragma warning (disable : 4786)
//------------------------------------------------------------------------
//
// Name: CController.h
//
// Author: Mat Buckland 2002
//
// Desc: controller class for the RecognizeIt mouse gesture recognition
// code project
//-------------------------------------------------------------------------
#include <vector>
#include <windows.h>
#include <iomanip>
#include "SVector2D.h"
#include "defines.h"
#include "CNeuralNet.h"
#include "CData.h"
using namespace std;
//the program can be in one of three states.
enum mode{LEARNING, ACTIVE, UNREADY, TRAINING};
class CController
{
private:
//the neural network
CNeuralNet* m_pNet;
//this class holds all the training data
CData* m_pData;
//the user mouse gesture paths - raw and smoothed
vector<POINTS> m_vecPath;
vector<POINTS> m_vecSmoothPath;
//the smoothed path transformed into vectors
vector<double> m_vecVectors;
//true if user is gesturing
bool m_bDrawing;
//the highest output the net produces. This is the most
//likely candidate for a matched gesture.
double m_dHighestOutput;
//the best match for a gesture based on m_dHighestOutput
int m_iBestMatch;
//if the network has found a pattern this is the match
int m_iMatch;
//the raw mouse data is smoothed to this number of points
int m_iNumSmoothPoints;
//the number of patterns in the database;
int m_iNumValidPatterns;
//the current state of the program
mode m_Mode;
//local copy of the application handle
HWND m_hwnd;
//clears the mouse data vectors
void Clear();
//given a series of points whis method creates a path of
//normalized vectors
void CreateVectors();
//preprocesses the mouse data into a fixed number of points
bool Smooth();
//tests for a match with a prelearnt gesture
bool TestForMatch();
//dialog box procedure. A dialog box is spawned when the user
//enters a new gesture.
static BOOL CALLBACK DialogProc(HWND hwnd,
UINT msg,
WPARAM wParam,
LPARAM lParam);
//this temporarily holds any newly created pattern names
static string m_sPatternName;
public:
CController(HWND hwnd);
~CController();
//call this to train the network using backprop with the current data
//set
bool TrainNetwork();
//renders the mouse gestures and relevant data such as the number
//of training epochs and training error
void Render(HDC &surface, int cxClient, int cyClient);
//returns whether or not the mouse is currently drawing
bool Drawing()const{return m_bDrawing;}
//this is called whenever the user depresses or releases the right
//mouse button.
//If val is true then the right mouse button has been depressed so all
//mouse data is cleared ready for the next gesture. If val is false a
//gesture has just been completed. The gesture is then either added to
//the current data set or it is tested to see if it matches an existing
//pattern.
//The hInstance is required so a dialog box can be created as a child
//window of the main app instance. The dialog box is used to grab the
//name of any user defined gesture
bool Drawing(bool val, HINSTANCE hInstance);
//clears the screen and puts the app into learning mode, ready to accept
//a user defined gesture
void LearningMode();
//call this to add a point to the mouse path
void AddPoint(POINTS p)
{
m_vecPath.push_back(p);
}
};
#endif |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.