text stringlengths 4 6.14k |
|---|
//
// ExpandableSectionHeader.h
// ExpandableTableView
//
// Created by Zouhair on 17/05/13.
// Copyright (c) 2013 Zedenem. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ExpandableSectionHeader : UIControl
#pragma mark Properties
@property (nonatomic, retain) UILabel *textLabel;
#pragma mark Lifecycle
- (void)setup;
@end
|
/*
***********************************************************************************************************************
*
* Copyright (c) 2016-2021 Advanced Micro Devices, Inc. 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.
*
**********************************************************************************************************************/
/**
***********************************************************************************************************************
* @file YCbCrAddressHandler.h
* @brief LLPC header file: contains the definition of LLPC class YCbCrAddressHandler.
***********************************************************************************************************************
*/
#pragma once
#include "lgc/util/GfxRegHandler.h"
namespace lgc {
// =====================================================================================================================
// The class is used for calculating and mantain the base address of each plane in YCbCr image.
// Note: There are at most 3 planes, and the index for plane is start from zero
class YCbCrAddressHandler {
public:
YCbCrAddressHandler(llvm::IRBuilder<> *builder, SqImgRsrcRegHandler *sqImgRsrcRegHandler, GfxIpVersion *gfxIp) {
m_builder = builder;
m_regHandler = sqImgRsrcRegHandler;
m_gfxIp = gfxIp;
m_planeBaseAddresses.clear();
m_one = builder->getInt32(1);
}
// Generate base address for image planes
void genBaseAddress(unsigned planeCount);
// Generate height and pitch
void genHeightAndPitch(unsigned bits, unsigned bpp, unsigned xBitCount, unsigned planeNum);
// Power2Align operation
llvm::Value *power2Align(llvm::Value *x, unsigned align);
// Get specific plane
llvm::Value *getPlane(unsigned idx) {
assert(idx < 3);
return m_planeBaseAddresses[idx];
}
// Get pitch for Y plane
llvm::Value *getPitchY() { return m_pitchY; }
// Get pitch for Cb plane
llvm::Value *getPitchCb() { return m_pitchCb; }
// Get height for Y plane
llvm::Value *getHeightY() { return m_heightY; }
// Get Height for Cb plane
llvm::Value *getHeightCb() { return m_heightCb; }
private:
SqImgRsrcRegHandler *m_regHandler;
llvm::IRBuilder<> *m_builder;
llvm::SmallVector<llvm::Value *, 3> m_planeBaseAddresses;
llvm::Value *m_pitchY = nullptr;
llvm::Value *m_heightY = nullptr;
llvm::Value *m_pitchCb = nullptr;
llvm::Value *m_heightCb = nullptr;
llvm::Value *m_swizzleMode = nullptr;
llvm::Value *m_one;
GfxIpVersion *m_gfxIp;
};
} // namespace lgc
|
/*============================================================================
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
Package, Release 3b, by John R. Hauser.
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions, and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions, and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=============================================================================*/
#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#include "internals.h"
#include "specialize.h"
#include "softfloat.h"
#ifdef SOFTFLOAT_FAST_INT64
float64_t f128M_to_f64( const float128_t *aPtr )
{
return f128_to_f64( *aPtr );
}
#else
float64_t f128M_to_f64( const float128_t *aPtr )
{
const uint32_t *aWPtr;
uint32_t uiA96;
bool sign;
int32_t exp;
uint64_t frac64;
struct commonNaN commonNaN;
uint64_t uiZ;
uint32_t frac32;
union ui64_f64 uZ;
/*------------------------------------------------------------------------
*------------------------------------------------------------------------*/
aWPtr = (const uint32_t *) aPtr;
uiA96 = aWPtr[indexWordHi( 4 )];
sign = signF128UI96( uiA96 );
exp = expF128UI96( uiA96 );
frac64 = (uint64_t) fracF128UI96( uiA96 )<<32 | aWPtr[indexWord( 4, 2 )];
/*------------------------------------------------------------------------
*------------------------------------------------------------------------*/
if ( exp == 0x7FFF ) {
if ( frac64 || aWPtr[indexWord( 4, 1 )] | aWPtr[indexWord( 4, 0 )] ) {
softfloat_f128MToCommonNaN( aWPtr, &commonNaN );
uiZ = softfloat_commonNaNToF64UI( &commonNaN );
} else {
uiZ = packToF64UI( sign, 0x7FF, 0 );
}
goto uiZ;
}
/*------------------------------------------------------------------------
*------------------------------------------------------------------------*/
frac32 = aWPtr[indexWord( 4, 1 )];
frac64 = frac64<<14 | frac32>>18;
if ( (frac32 & 0x0003FFFF) || aWPtr[indexWord( 4, 0 )] ) frac64 |= 1;
if ( ! (exp | frac64) ) {
uiZ = packToF64UI( sign, 0, 0 );
goto uiZ;
}
/*------------------------------------------------------------------------
*------------------------------------------------------------------------*/
exp -= 0x3C01;
if ( sizeof (int_fast16_t) < sizeof (int32_t) ) {
if ( exp < -0x1000 ) exp = -0x1000;
}
return
softfloat_roundPackToF64(
sign, exp, frac64 | UINT64_C( 0x4000000000000000 ) );
/*------------------------------------------------------------------------
*------------------------------------------------------------------------*/
uiZ:
uZ.ui = uiZ;
return uZ.f;
}
#endif
|
#pragma once
#include "PG/core/Point.h"
#include "PG/core/Size.h"
namespace PG {
//--------------------------------------------------------
struct PhysicsWorldParams
{
Size gravity = Size(0, 10);
Point forward = Point(2500, 0);
Point jumpForce = Point(0, -100);
Point minMovement = Point(-300, -4850);
Point maxMovement = Point(300, 1000);
double friction = 0.84;
};
}
|
/*
** client.c -- a stream socket client demo
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#define PORT "3490" // the port client will be connecting to
#define MAXDATASIZE 100 // max number of bytes we can get at once
// get sockaddr, IPv4 or IPv6:
void *get_in_addr(struct sockaddr *sa)
{
if (sa->sa_family == AF_INET) {
return &(((struct sockaddr_in*)sa)->sin_addr);
}
return &(((struct sockaddr_in6*)sa)->sin6_addr);
}
int main(int argc, char *argv[])
{
int sockfd, numbytes;
char buf[MAXDATASIZE];
struct addrinfo hints, *servinfo, *p;
int rv;
char s[256];
if (argc != 2) {
fprintf(stderr,"usage: client hostname\n");
exit(1);
}
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
if ((rv = getaddrinfo(argv[1], PORT, &hints, &servinfo)) != 0) {
fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
return 1;
}
// loop through all the results and connect to the first we can
for(p = servinfo; p != NULL; p = p->ai_next) {
if ((sockfd = socket(p->ai_family, p->ai_socktype,
p->ai_protocol)) == -1) {
perror("client: socket");
continue;
}
if (connect(sockfd, p->ai_addr, p->ai_addrlen) == -1) {
close(sockfd);
perror("client: connect");
continue;
}
break;
}
if (p == NULL) {
fprintf(stderr, "client: failed to connect\n");
return 2;
}
inet_ntop(p->ai_family, get_in_addr((struct sockaddr *)p->ai_addr),
s, sizeof s);
printf("client: connecting to %s\n", s);
freeaddrinfo(servinfo); // all done with this structure
if ((numbytes = recv(sockfd, buf, MAXDATASIZE-1, 0)) == -1) {
perror("recv");
exit(1);
}
buf[numbytes] = '\0';
printf("client: received '%s'\n",buf);
close(sockfd);
return 0;
}
|
#include <malloc.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <error.h>
#include <strings.h>
#include <string.h>
#define SBRK_SCALE 100
#define CHECKSUM ~0
#define MALLOC_OVERHEAD 20
#define USED_OVERHEAD 8
#define LINKED_LIST_OVERHEAD 12
#define FREE_SIZE 0
#define NEXT_PTR 1
#define PREV_PTR 2
#define USED_SIZE 3
#define CHECKSUM_LOC 4
#define USER_PTR 5
#define TRUE 1
#define FALSE 0
#define MIN(a,b) a < b ? a : b
void *malloc_head = NULL;
/*
4 bytes each:
1. Free Space Size
2. Next Pointer
3. Prev Pointer
4. Used Space Size
5. Checksum
*/
void *malloc(size_t size) {
void *start = malloc_head;
int malloc_size = size * SBRK_SCALE;
int searching = TRUE;
if (malloc_head == NULL) {
malloc_head = sbrk(malloc_size);
if ((int) malloc_head == -1) {
return NULL;
} else {
start = malloc_head;
((int *) malloc_head)[0] = malloc_size - LINKED_LIST_OVERHEAD; // Set the free size
}
}
while (searching) {
if (((int *) start)[FREE_SIZE] >= size + MALLOC_OVERHEAD) {
searching = FALSE;
} else if ((void *) ((int*) start)[NEXT_PTR] == NULL) {
// Now check to see if we need to sbrk again and that we are at the last linked list node
void *next_loc = sbrk(malloc_size);
if ((int) next_loc == -1) {
return NULL;
} else {
// Since sbrk may not give us continuous memory,
// so set up a linked list header at the new memory location
((int *) start)[NEXT_PTR] = (int) next_loc;
((int *) next_loc)[FREE_SIZE] = malloc_size - LINKED_LIST_OVERHEAD;
((int *) next_loc)[NEXT_PTR] = (int) NULL;
((int *) next_loc)[PREV_PTR] = (int) start;
}
} else {
// We haven't hit the last node, so just go to the next node
start = (void *) ((int *) start)[NEXT_PTR];
}
}
// Set up the headers for the next free spot
if (((int *) start)[NEXT_PTR] == (int) NULL) {
void *next_header = start + size + MALLOC_OVERHEAD;
((int *) next_header)[FREE_SIZE] = ((int *) start)[FREE_SIZE] - (USED_OVERHEAD + size);
((int *) next_header)[NEXT_PTR] = (int) NULL;
((int *) next_header)[PREV_PTR] = (int) start;
}
// Update the headers for this allocation
((int *) start)[FREE_SIZE] = 0;
((int *) start)[USED_SIZE] = size;
((int *) start)[CHECKSUM_LOC] = CHECKSUM;
return &((int *) start)[USER_PTR];
}
void free(void *ptr) {
if (ptr != NULL) {
// Go back 20 bytes to the start of the linked list headers
void *node = ptr - MALLOC_OVERHEAD;
((int *) node)[FREE_SIZE] = ((int *) node)[USED_SIZE] + USED_OVERHEAD;
}
}
void *calloc(size_t nmem, size_t size) {
if (nmem == 0) {
return NULL;
} else {
void *user_ptr = malloc(nmem * size);
bzero(user_ptr, nmem * size);
return user_ptr;
}
}
void *realloc(void *ptr, size_t size) {
if (ptr == NULL && size == 0) {
return NULL;
} else if (ptr == NULL && size > 0) {
return malloc(size);
} else if (ptr != NULL && size == 0) {
free(ptr);
return NULL;
} else {
void *new_ptr = malloc(size);
void *node = ptr - MALLOC_OVERHEAD;
memcpy(new_ptr, ptr, ((int *) node)[USED_SIZE]);
free(ptr);
return new_ptr;
}
}
|
//
// SurveyEmailMessageBuilder.h
// QOLEB
//
// Created by Tullie Murrell on 25/01/2015.
// Copyright (c) 2015 Tullie Murrell. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SSEmailMessageBuilder : NSObject
- (SSEmailMessageBuilder *)username:(NSString *)username;
- (SSEmailMessageBuilder *)userId:(NSString *)userId;
- (SSEmailMessageBuilder *)date:(NSString *)date time:(NSString *)time;
- (SSEmailMessageBuilder *)results:(NSArray *)pageResults;
- (SSEmailMessageBuilder *)finalScore:(NSInteger)score totalScore:(NSInteger)total;
- (NSString *)build;
@end
|
/**
* @file
* @brief Convert integer to string.
*
* @see stdlib.h
*
* @date 01.04.13
* @author Károly Oláh
* - Initial commit
*/
char *itoa( int num, char *buf, unsigned short int base )
{
char *p = buf;
char *p1, *p2;
int ud = 0;
*buf = '\0'; /* initialize buffer. In the case of an error, this will already be in the buffer, indicating that the result is invalid (NULL). */
p1 = buf; /* start of buffer */
// check base
if( base < 2 || base > 36 )
{ return buf; }
/* If num < 0, put `-' in the head. */
if( num < 0 )
{
*(p++) = '-';
p1++;
ud = -num;
}
else
{ ud = num; }
/* Divide ud by base until ud == 0. */
int remainder = 0;
do {
remainder = ud % base;
*(p++) = (remainder < 10) ? remainder + '0' : remainder + 'a' - 10;
} while( ud /= base );
/* Terminate buf. */
*p = '\0';
/* Reverse buffer. */
p2 = p - 1; /* end of buffer */
char tmp;
while( p1 < p2 )
{
tmp = *p1;
*p1 = *p2;
*p2 = tmp;
p1++;
p2--;
}
return buf;
}
char *utoa( unsigned int num, char *buf, unsigned short int base )
{
char *p = buf;
char *p1, *p2;
unsigned int ud = 0;
*buf = '\0'; /* initialize buffer. In the case of an error, this will already be in the buffer, indicating that the result is invalid (NULL). */
p1 = buf; /* start of buffer */
// check base
if( base < 2 || base > 36 )
{ return buf; }
ud = num;
/* Divide ud by base until ud == 0. */
int remainder = 0;
do {
remainder = ud % base;
*(p++) = (remainder < 10) ? remainder + '0' : remainder + 'a' - 10;
} while( ud /= base );
/* Terminate buf. */
*p = '\0';
/* Reverse buffer. */
p2 = p - 1; /* end of buffer */
char tmp;
while( p1 < p2 )
{
tmp = *p1;
*p1 = *p2;
*p2 = tmp;
p1++;
p2--;
}
return buf;
}
char *ltoa( long int num, char *buf, unsigned short int base )
{
char *p = buf;
char *p1, *p2;
long int ud = 0;
*buf = '\0'; /* initialize buffer. In the case of an error, this will already be in the buffer, indicating that the result is invalid (NULL). */
p1 = buf; /* start of buffer */
// check base
if( base < 2 || base > 36 )
{ return buf; }
/* If num < 0, put `-' in the head. */
if( num < 0 )
{
*(p++) = '-';
p1++;
ud = -num;
}
else
{ ud = num; }
/* Divide ud by base until ud == 0. */
int remainder = 0;
do {
remainder = ud % base;
*(p++) = (remainder < 10) ? remainder + '0' : remainder + 'a' - 10;
} while( ud /= base );
/* Terminate buf. */
*p = '\0';
/* Reverse buffer. */
p2 = p - 1; /* end of buffer */
char tmp;
while( p1 < p2 )
{
tmp = *p1;
*p1 = *p2;
*p2 = tmp;
p1++;
p2--;
}
return buf;
}
char *ultoa( unsigned long int num, char *buf, unsigned short int base )
{
char *p = buf;
char *p1, *p2;
long unsigned int ud = 0;
*buf = '\0'; /* initialize buffer. In the case of an error, this will already be in the buffer, indicating that the result is invalid (NULL). */
p1 = buf; /* start of buffer */
// check base
if( base < 2 || base > 36 )
{ return buf; }
ud = num;
/* Divide ud by base until ud == 0. */
int remainder = 0;
do {
remainder = ud % base;
*(p++) = (remainder < 10) ? remainder + '0' : remainder + 'a' - 10;
} while( ud /= base );
/* Terminate buf. */
*p = '\0';
/* Reverse buffer. */
p2 = p - 1; /* end of buffer */
char tmp;
while( p1 < p2 )
{
tmp = *p1;
*p1 = *p2;
*p2 = tmp;
p1++;
p2--;
}
return buf;
} |
#include "osloader/firmware/efi.h"
#include "osloader/console.h"
#include "osloader/memory.h"
static os_result_t
cs_private_input_console_create(cs_input_console_t* console)
{
OS_ASSERT(console != NULL);
(void)console;
return S_OK;
}
static os_result_t
cs_private_input_console_destroy(cs_input_console_t* console)
{
OS_ASSERT(console != NULL);
(void)console;
return S_OK;
}
static os_result_t
cs_private_input_console_peek_key(cs_input_console_t* console, cs_input_key_t* key)
{
OS_ASSERT(console != NULL);
(void)console;
OS_ASSERT(key != NULL);
efi_input_key_t input_key = { };
os_result_t status = efi_console_in_poll(&input_key);
if (OS_SUCCESS(status))
{
key->scancode = input_key.scan_code;
key->character = input_key.unicode_char;
}
return status;
}
static os_result_t
cs_private_input_console_read_key(cs_input_console_t* console, cs_input_key_t* key)
{
OS_ASSERT(console != NULL);
(void)console;
OS_ASSERT(key != NULL);
efi_input_key_t input_key = { };
os_result_t status = efi_console_in_read(&input_key);
if (OS_SUCCESS(status))
{
key->scancode = input_key.scan_code;
key->character = input_key.unicode_char;
}
return status;
}
static os_result_t
cs_private_input_console_flush(cs_input_console_t* console)
{
OS_ASSERT(console != NULL);
(void)console;
return efi_console_in_reset();
}
static cs_input_console_vtable_t cs_local_input_vtable = {
.create = (pfn_cs_input_console_create_t)cs_private_input_console_create,
.destroy = (pfn_cs_input_console_destroy_t)cs_private_input_console_destroy,
.peek_key = (pfn_cs_input_console_peek_key_t)cs_private_input_console_peek_key,
.read_key = (pfn_cs_input_console_read_key_t)cs_private_input_console_read_key,
.flush = (pfn_cs_input_console_flush_t)cs_private_input_console_flush,
};
os_result_t
cs_create_local_input_console(cs_input_console_t** console)
{
OS_ASSERT(console != NULL);
cs_local_input_console_t* local_console = NULL;
mm_heap_alloc((void**)&local_console, sizeof(cs_local_input_console_t));
local_console->base.vtable = &cs_local_input_vtable;
(*console) = (cs_input_console_t*)local_console;
return S_OK;
}
|
#ifndef FDSASDF_H
#define FDSASDF_H
//http://www.unknowncheats.me/forum/1064093-post3.html
bool CompareByteArray(PBYTE Data, PBYTE Signature)
{
for (; *Signature; ++Signature, ++Data)
{
if (*Signature == '\x00')
{
continue;
}
if (*Data != *Signature)
{
return false;
}
}
return true;
}
PBYTE FindSignature(PBYTE BaseAddress, DWORD ImageSize, PBYTE Signature)
{
BYTE First = Signature[0];
PBYTE Max = BaseAddress + ImageSize - strlen((PCHAR) Signature);
for (; BaseAddress < Max; ++BaseAddress)
{
if (*BaseAddress != First)
{
continue;
}
if (CompareByteArray(BaseAddress, Signature))
{
return BaseAddress;
}
}
return NULL;
}
struct FDSASDF : public BenchBase
{
virtual void init(Tests test)
{
switch (test)
{
case Tests::First:
mPattern = "\x45\x43\x45\x55\x33\x9a\xfa\x00\x00\x00\x00\x45\x68\x21";
//mMask = "xxxxxxx????xxx";
break;
case Tests::Second:
mPattern = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xbb\xaa\x00\x00\x00\x00\x45\x68\x21";
//mMask = "xxxxxxxxxxx????xxx";
break;
default:
break;
}
}
virtual LPVOID runOne(PBYTE baseAddress, DWORD size)
{
return FindSignature(baseAddress, size, (PBYTE) mPattern);
}
virtual const char* name() const
{
return "fdsasdf";
}
PCHAR mPattern; // = reinterpret_cast<PCHAR>("");
PCHAR mMask; // = reinterpret_cast<PCHAR>("");
};
REGISTER(FDSASDF);
#endif // FDSASDF_H
|
//
// NSMutableArray+IndexSelection.h
// SDForms
//
// Created by Rafal Kwiatkowski on 25.08.2014.
// Copyright (c) 2014 Snowdog sp. z o.o. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSMutableArray (IndexSelection)
- (BOOL)isIndexSelected:(NSInteger)index;
- (void)selectIndex:(NSInteger)index;
- (void)deselectIndex:(NSInteger)index;
@end
|
#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_KnobGestureRecognizer_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_KnobGestureRecognizer_ExampleVersionString[];
|
//
// NewsTableViewController.h
// 163News
//
// Created by 王冠阳 on 15/8/31.
// Copyright (c) 2015年 itcast. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NewsTableViewController : UITableViewController
@end
|
#include <gtk/gtk.h>
#include <string.h>
/* Stolen from gnome bugzilla (small hacks for my needs).
* Fsck you gnome guys for not adding this.
* The patch is there since 2004 goddamnit */
/**
* tbim: (text_buffer_insert_markup)
* @buffer: a #GtkTextBuffer
* @iter: a position in the buffer
* @markup: UTF-8 format text with pango markup to insert
* @len: length of text in bytes, or -1
*
* Inserts @len bytes of @markup at position @iter. If @len is -1,
* @text must be nul-terminated and will be inserted in its
* entirety. Emits the "insert_text" signal, possibly multiple
* times; insertion actually occurs in the default handler for
* the signal. @iter will point to the end of the inserted text
* on return
*
**/
void
gtk_tbim (GtkTextBuffer *buffer,
GtkTextIter *textiter,
const gchar *markup,
gint len)
{
PangoAttrIterator *paiter;
PangoAttrList *attrlist;
GtkTextMark *mark;
GError *error = NULL;
gchar *text;
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (textiter != NULL);
g_return_if_fail (markup != NULL);
g_return_if_fail (gtk_text_iter_get_buffer (textiter) == buffer);
if (len == 0)
return;
if (!pango_parse_markup(markup, len, 0, &attrlist, &text, NULL, &error))
{
g_warning("Invalid markup string: %s", error->message);
g_error_free(error);
return;
}
len = strlen(text); /* TODO: is this needed? */
if (attrlist == NULL)
{
gtk_text_buffer_insert(buffer, textiter, text, len);
g_free(text);
return;
}
/* create mark with right gravity */
mark = gtk_text_buffer_create_mark(buffer, NULL, textiter, FALSE);
paiter = pango_attr_list_get_iterator(attrlist);
do
{
PangoAttribute *attr;
GtkTextTag *tag;
gint start, end;
pango_attr_iterator_range(paiter, &start, &end);
if (end == G_MAXINT) /* last chunk */
end = strlen(text);
tag = gtk_text_tag_new(NULL);
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_LANGUAGE)))
g_object_set(tag, "language", pango_language_to_string(((PangoAttrLanguage*)attr)->value), NULL);
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_FAMILY)))
g_object_set(tag, "family", ((PangoAttrString*)attr)->value, NULL);
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_STYLE)))
g_object_set(tag, "style", ((PangoAttrInt*)attr)->value, NULL);
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_WEIGHT)))
g_object_set(tag, "weight", ((PangoAttrInt*)attr)->value, NULL);
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_VARIANT)))
g_object_set(tag, "variant", ((PangoAttrInt*)attr)->value, NULL);
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_STRETCH)))
g_object_set(tag, "stretch", ((PangoAttrInt*)attr)->value, NULL);
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_SIZE)))
g_object_set(tag, "size", ((PangoAttrInt*)attr)->value, NULL);
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_FONT_DESC)))
g_object_set(tag, "font-desc", ((PangoAttrFontDesc*)attr)->desc, NULL);
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_FOREGROUND)))
{
GdkColor col = { 0,
((PangoAttrColor*)attr)->color.red,
((PangoAttrColor*)attr)->color.green,
((PangoAttrColor*)attr)->color.blue
};
g_object_set(tag, "foreground-gdk", &col, NULL);
}
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_BACKGROUND)))
{
GdkColor col = { 0,
((PangoAttrColor*)attr)->color.red,
((PangoAttrColor*)attr)->color.green,
((PangoAttrColor*)attr)->color.blue
};
g_object_set(tag, "background-gdk", &col, NULL);
}
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_UNDERLINE)))
g_object_set(tag, "underline", ((PangoAttrInt*)attr)->value, NULL);
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_STRIKETHROUGH)))
g_object_set(tag, "strikethrough", (gboolean)(((PangoAttrInt*)attr)->value != 0), NULL);
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_RISE)))
g_object_set(tag, "rise", ((PangoAttrInt*)attr)->value, NULL);
/* PANGO_ATTR_SHAPE cannot be defined via markup text */
if ((attr = pango_attr_iterator_get(paiter, PANGO_ATTR_SCALE)))
g_object_set(tag, "scale", ((PangoAttrFloat*)attr)->value, NULL);
gtk_text_tag_table_add(gtk_text_buffer_get_tag_table(buffer), tag);
gtk_text_buffer_insert_with_tags(buffer, textiter, text+start, end - start, tag, NULL);
/* mark had right gravity, so it should be
* at the end of the inserted text now */
gtk_text_buffer_get_iter_at_mark(buffer, textiter, mark);
}
while (pango_attr_iterator_next(paiter));
gtk_text_buffer_delete_mark(buffer, mark);
pango_attr_iterator_destroy(paiter);
pango_attr_list_unref(attrlist);
g_free(text);
}
|
#ifndef __BATTLE_UI_H__
#define __BATTLE_UI_H__
#include "ui/CocosGUI.h"
#include "UIView.h"
#include "GameCharacter.h"
#include "InputManager.h"
#include "JoyStick.h"
#include "CircularProgress.h"
using namespace cocos2d;
using namespace ui;
/**
* Õ½¶·Ê±ºòµÄUI½çÃæ£¬Ö÷Òª¾ÍÊÇһЩ²Ù×÷ºÍһЩÐÅÏ¢µÄÏÔʾ£¬Í¬Ê±ËüÒ²¼Ì³Ð£¬×÷ΪÓÎÏ·µÄÊäÈë¶Ë
*/
class BattleUI : public UIView, public InputManager
{
public:
bool init() override;
/**
* ½ÓÊÜʼþµÄ»Øµ÷º¯Êý
*/
void onWee(RefreshUIMsg& msg) override;
void update(float dm) override;
CREATE_FUNC(BattleUI);
protected:
BattleUI();
void setWeeList() override;
/**
* Ë¢ÐÂÕ½¶·UIÖеĽÇÉ«Êý¾ÝµÄÏÔʾ
*/
void refreshCharacter(GameCharacter* character);
/**
* ˢе±Ç°×÷ΪÖ÷½Ç¹¥»÷Ä¿±êµÄ½ÇÉ«
*/
void refreshTargetCharacter(GameCharacter* character);
/**
* ÒÔÏÂÊǽÓÊܽçÃæ°´Å¥µÄµã»÷ʼþ
*/
void onClickChangeTargetBtn(Ref* target,Widget::TouchEventType type);
void onClickConvergeBtn(Ref* target,Widget::TouchEventType type);
void onClickSkillBtn(Ref* target,Widget::TouchEventType type);
private:
/**
* ¸ßÁÁÓÒÉϽǼ¼Äܰ´Å¥
*/
void highLightSkillBtn();
/**
* ÈÃÓÒÉϽǼ¼Äܰ´Å¥°µµ
*/
void dimSkillBtn();
/**
* ÈÃ×óϽǵļ¼Äܰ´Å¥ÀäÈ´µ½¶àÉÙ£¬ratioÊÇ0~100
*/
void coolSkill2Btn(int ratio);
LoadingBar* m_leaderHpBar; // Ö÷½ÇhpÌõ
ImageView* m_leaderIcon; // Ö÷½ÇµÄÍ·Ïñ
LoadingBar* m_enemyHpBar; // µ±Ç°Ö÷½ÇÕýÔÚ´òµÄµÐÈ˵Ähp
ImageView* m_enemyIcon; // µÐÈËÍ·Ïñ
Node* m_enemyPanel; // µÐÈËÐÅÏ¢µÄÃæ°å¸ù½Úµã
Button* m_convergeBtn; // ¼¯ÖлðÁ¦µÄ°´Å¥
CircularProgress* m_circularProgress; // Ô²Ðνø¶ÈÌõ
Button* m_changeTargetBtn; // ¸ü»»µ±Ç°Ö÷½ÇµÄ¹¥»÷Ä¿±ê
Button* m_skillBtn; // ¼¼Äܰ´Å¥
JoyStick* m_jokStick; // ²Ù×ݱú
};
#endif |
//
// WQNavViewController.h
// SomeUIKit
//
// Created by WangQiang on 2017/5/2.
// Copyright © 2017年 WangQiang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface WQNavViewController : UINavigationController
@end
|
// Copyright (c) 2011-2013 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 BITBREADCRUMB_QT_EDITADDRESSDIALOG_H
#define BITBREADCRUMB_QT_EDITADDRESSDIALOG_H
#include <QDialog>
class AddressTableModel;
namespace Ui {
class EditAddressDialog;
}
QT_BEGIN_NAMESPACE
class QDataWidgetMapper;
QT_END_NAMESPACE
/** Dialog for editing an address and associated information.
*/
class EditAddressDialog : public QDialog
{
Q_OBJECT
public:
enum Mode {
NewReceivingAddress,
NewSendingAddress,
EditReceivingAddress,
EditSendingAddress
};
explicit EditAddressDialog(Mode mode, QWidget *parent);
~EditAddressDialog();
void setModel(AddressTableModel *model);
void loadRow(int row);
QString getAddress() const;
void setAddress(const QString &address);
public slots:
void accept();
private:
bool saveCurrentRow();
Ui::EditAddressDialog *ui;
QDataWidgetMapper *mapper;
Mode mode;
AddressTableModel *model;
QString address;
};
#endif // BITBREADCRUMB_QT_EDITADDRESSDIALOG_H
|
/**
* \file Path.h
* \brief Static class for path manipulation.
*
* Licensed under the MIT License (MIT)
* Copyright (c) 2014 Eder de Almeida Perez
*
* @author: Eder A. Perez.
*/
#ifndef PATH_H
#define PATH_H
#include <algorithm>
#include <sstream>
namespace nut
{
class Path
{
public:
/**
* Given a path, get the file name including extension.
*
* Examples:
*
* "/usr/local/lib/lib.a" returns "lib.a" as file name.
* "/usr/local/" returns an empty string, because "local" is considered a directory not a file.
* "/usr/local" returns "local" as file name.
*/
static std::string getFileName( const std::string& path )
{
std::string name;
bool separatorFound = false;
int pos = path.size() - 1;
for (std::string::const_reverse_iterator rit = path.rbegin(); rit != path.rend(); ++rit, pos--)
{
if ( *rit == '\\' || *rit == '/')
{
separatorFound = true;
break;
}
}
if ( separatorFound )
{
name = path.substr(pos + 1).c_str();
}
else
{
name = path;
}
return name;
}
/**
* Get the file extension. The returned string is in lower case.
*/
static std::string getFileExtension( const std::string& path )
{
std::string fileName = getFileName( path );
std::string extension;
bool dotFound = false;
int pos = fileName.size() - 1;
for (std::string::const_reverse_iterator rit = fileName.rbegin(); rit != fileName.rend(); ++rit, pos--)
{
if ( *rit == '.' )
{
dotFound = true;
break;
}
}
if ( dotFound && pos > 1 )
{
extension = fileName.substr(pos + 1).c_str();
std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
}
return extension;
}
};
}
#endif // STRING_H
|
/*
* Copyright (C) 2013-2015
*
* @author jxfengzi@gmail.com
* @date 2013-11-19
*
* @file SwitchPower.h
*
* @remark
*
*/
#ifndef __SWITCH_POWER_H__
#define __SWITCH_POWER_H__
#include "tiny_base.h"
#include "UpnpService.h"
#include "UpnpRuntime.h"
TINY_BEGIN_DECLS
struct _SwitchPower;
typedef struct _SwitchPower SwitchPower;
SwitchPower * SwitchPower_Create(UpnpService *service, UpnpRuntime *runtime);
void SwitchPower_Delete(SwitchPower *thiz);
/*------------------------------------------------------------------------
* Actions (3)
*------------------------------------------------------------------------*/
/**
* GetTarget
*/
typedef struct _SwitchPower_GetTargetResult
{
bool theTargetValue;
} SwitchPower_GetTargetResult;
TinyRet SwitchPower_GetTarget(SwitchPower *thiz, SwitchPower_GetTargetResult *result, UpnpError *error);
/**
* SetTarget
*/
TinyRet SwitchPower_SetTarget(SwitchPower *thiz, bool newTargetValue, UpnpError *error);
/**
* GetStatus
*/
typedef struct _SwitchPower_GetStatusResult
{
bool theResultStatus;
} SwitchPower_GetStatusResult;
TinyRet SwitchPower_GetStatus(SwitchPower *thiz, SwitchPower_GetStatusResult *result, UpnpError *error);
/*------------------------------------------------------------------------
* Event
*------------------------------------------------------------------------*/
typedef void(*SwitchPower_SubscriptionExpired)(void *ctx);
typedef void(*SwitchPower_StatusChanged)(bool currentValue, void *ctx);
typedef struct _SwitchPower_EventListener
{
SwitchPower_SubscriptionExpired onSubscriptionExpired;
SwitchPower_StatusChanged onStatusChanged;
} SwitchPower_EventListener;
TinyRet SwitchPower_Subscribe(SwitchPower *thiz,
SwitchPower_SubscriptionExpired onSubscriptionExpired,
SwitchPower_StatusChanged onStatusChanged,
UpnpError *error,
void *ctx);
TinyRet SwitchPower_Unsubscribe(SwitchPower *thiz, UpnpError *error);
TINY_END_DECLS
#endif /* __SWITCH_POWER_H__ */
|
//
// JobsListViewController.h
// Homeless Helper
//
// Created by Jessi Schoenleber on 4/12/12.
// Copyright (c) 2012 JJAppCo, LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CustomListTableViewCell.h"
#import "JobProfileViewController.h"
@interface JobsListViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
{
}
@property (nonatomic, retain) NSMutableArray *jobsArray;
@property (nonatomic, retain) UITableView *jobsTableView;
@end |
///////////////////////////////////////////////////////////////////////////////
// MicroOrk (Orkid)
// Copyright 1996-2013, Michael T. Mayers
// Provided under the MIT License (see LICENSE.txt)
///////////////////////////////////////////////////////////////////////////////
#pragma once
///////////////////////////////////////////////////////////////////////////////
namespace ork {
/// ////////////////////////////////////////////////////////////////////////////
/// tweaks fixedvector class
/// fixed capacity, variable sized stl compatible vector
/// It will only use memory that you explicitly give it.
/// If you instantiate one on the stack, it will only use stack memory
/// If you instantiate one on the heap, it will only use heap memory
/// Think of it as a bounds checked variable sized array
/// ////////////////////////////////////////////////////////////////////////////
template<typename T, int kmax>
class fixedvector
{
public:
typedef T value_type;
typedef size_t size_type;
typedef intptr_t difference_type;
struct iterator_base
{
typedef std::random_access_iterator_tag iterator_category;
typedef T value_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef std::ptrdiff_t difference_type;
intptr_t mindex;
int mdirection;
iterator_base( intptr_t idx=-1, int idir=0 );
};
struct iterator : public iterator_base
{
typedef intptr_t iter_type;
static const iter_type npos = -1;
fixedvector* mpfixedary;
iterator( intptr_t idx=npos, int idir=0, fixedvector* pfm=0);
iterator(const iterator& oth);
void operator = ( const iterator& oth );
bool operator == (const iterator& oth ) const;
bool operator != (const iterator& oth ) const;
T* operator ->() const;
T& operator *() const;
iterator operator++(); // prefix
iterator operator--(); // prefix
iterator operator++(int i); // postfix
iterator operator--(int i); // prefix
iterator operator+(intptr_t i) const; // add
iterator operator-(intptr_t i) const; // sub
iterator operator+=(intptr_t i); // add
iterator operator-=(intptr_t i); // sub
bool operator < ( const iterator& oth ) const;
typename iterator_base::difference_type operator - ( const iterator& oth ) const;
};
struct const_iterator : public iterator_base
{
typedef intptr_t iter_type;
static const iter_type npos = -1;
const fixedvector* mpfixedary;
const_iterator( intptr_t idx=npos, int idir=0, const fixedvector* pfm=0);
const_iterator(const iterator& oth);
const_iterator(const const_iterator& oth);
void operator = ( const const_iterator& oth );
bool operator == (const const_iterator& oth ) const;
bool operator != (const const_iterator& oth ) const;
const T* operator ->() const;
const T& operator *() const;
const_iterator operator++(); // prefix
const_iterator operator--(); // prefix
const_iterator operator++(int i); // postfix
const_iterator operator--(int i); // prefix
const_iterator operator+(intptr_t i) const; // add
const_iterator operator-(intptr_t i) const; // sub
const_iterator operator+=(intptr_t i); // add
const_iterator operator-=(intptr_t i); // sub
bool operator < ( const const_iterator& oth ) const;
typename iterator_base::difference_type operator - ( const const_iterator& oth ) const;
};
fixedvector(size_t iinitialsize);
fixedvector();
fixedvector(const fixedvector& rhs);
fixedvector& operator=(const fixedvector& rhs);
T& operator[](size_t index);
const T& operator[](size_t index) const;
size_t size() const;
void push_back( const T& val );
void pop_back();
iterator end();
iterator begin();
iterator rbegin();
iterator rend();
const_iterator begin() const;
const_iterator end() const;
iterator insert( const iterator& it, const T& value );
void erase( const const_iterator& it );
void reserve( size_t icount );
void resize( size_t icount );
void clear();
T& create();
private:
T mArray[kmax];
size_t misize;
};
///////////////////////////////////////////////////////////////////////////////
} // namespace ork
///////////////////////////////////////////////////////////////////////////////
|
#pragma once
#include "analyze_RIFF_item_Base.h"
namespace analyze_RIFF
{
class item_LIST : public item_Base
{
public:
item_LIST(const container_RIFF* _image, uint64_t offset, uint64_t size);
virtual ~item_LIST();
virtual HRESULT getItemName(agaliaString** str) const override;
virtual HRESULT getItemPropCount(uint32_t* count) const override;
virtual HRESULT getItemPropName(uint32_t index, agaliaString** str) const override;
virtual HRESULT getItemPropValue(uint32_t index, agaliaString** str) const override;
virtual HRESULT getChildItem(uint32_t sibling, agaliaItem** child) const override;
virtual HRESULT getColumnValue(uint32_t column, agaliaString** str) const;
enum {
prop_fccListType = item_Base::prop_last,
prop_last
};
};
}
|
#pragma once
#include "inodecompiler.h"
namespace Syntax
{
namespace GraphicsCompiler
{
class MaterialsCompiler :
public Syntax::Compiler::INodeCompiler
{
public:
MaterialsCompiler(void);
virtual ~MaterialsCompiler(void);
virtual std::wstring IndexName() {return L"materials";}
};
}
}
|
// -*- c++ -*-
// Generated by gmmproc 2.46.2 -- DO NOT MODIFY!
#ifndef _GIOMM_MEMORYINPUTSTREAM_P_H
#define _GIOMM_MEMORYINPUTSTREAM_P_H
#include <giomm/private/inputstream_p.h>
#include <glibmm/class.h>
namespace Gio
{
class MemoryInputStream_Class : public Glib::Class
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef MemoryInputStream CppObjectType;
typedef GMemoryInputStream BaseObjectType;
typedef GMemoryInputStreamClass BaseClassType;
typedef Gio::InputStream_Class CppClassParent;
typedef GInputStreamClass BaseClassParent;
friend class MemoryInputStream;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
const Glib::Class& init();
static void class_init_function(void* g_class, void* class_data);
static Glib::ObjectBase* wrap_new(GObject*);
protected:
//Callbacks (default signal handlers):
//These will call the *_impl member methods, which will then call the existing default signal callbacks, if any.
//You could prevent the original default signal handlers being called by overriding the *_impl method.
//Callbacks (virtual functions):
};
} // namespace Gio
#endif /* _GIOMM_MEMORYINPUTSTREAM_P_H */
|
//----------------------------------------------------------------------------
// 프로그램명 : IMU 센서 관련 함수
//
// 만든이 : Cho Han Cheol(Baram)
//
// 날 짜 :
//
// 최종 수정 :
//
// MPU_Type :
//
// 파일명 : Hw_IMU.c
//----------------------------------------------------------------------------
//----- 헤더파일 열기
//
#define HW_HMC5883_LOCAL
#include "Hw_IMU.h"
#include "Lb_Printf.h"
#include "math.h"
/*---------------------------------------------------------------------------
TITLE : Hw_IMU_Init
WORK :
ARG : void
RET : void
---------------------------------------------------------------------------*/
u16 Hw_IMU_Init( void )
{
u16 Ret = 0;
Ret = Hw_MPU6050_Init();
if( Ret != 0 )
{
Lb_printf("Hw_MPU6050_Init Ret : 0x%x\n", Ret);
return Ret;
}
Ret = Hw_HMC5883_Init();
if( Ret != 0 )
{
Lb_printf("Hw_HMC5883_Init Ret : 0x%x\n", Ret);
return Ret;
}
return Ret;
}
/*---------------------------------------------------------------------------
TITLE : Hw_IMU_Reset
WORK :
ARG : void
RET : void
---------------------------------------------------------------------------*/
void Hw_IMU_Reset( HW_IMU_DATA_OBJ *ptr_data )
{
}
/*---------------------------------------------------------------------------
TITLE : Hw_IMU_GetData
WORK :
ARG : void
RET : void
---------------------------------------------------------------------------*/
u16 Hw_IMU_GetData( HW_IMU_DATA_OBJ *ptr_data )
{
u16 Err = 0;
HW_MPU6050_DATA_OBJ MPU6050_Data;
HW_HMC5883_DATA_OBJ HMC5883_Data;
ptr_data->Enable_Acc = FALSE;
ptr_data->Enable_Temp = FALSE;
ptr_data->Enable_Gyro = FALSE;
ptr_data->Enable_Compass = FALSE;
if( Hw_HMC5883_GetEnable() == TRUE )
{
Err = Hw_MPU6050_GetData( &MPU6050_Data );
if( Err == 0 )
{
ptr_data->X_Acc = MPU6050_Data.X_Acc;
ptr_data->Y_Acc = MPU6050_Data.Y_Acc;
ptr_data->Z_Acc = MPU6050_Data.Z_Acc;
ptr_data->Temp = MPU6050_Data.Temp;
ptr_data->X_Gyro = MPU6050_Data.X_Gyro;
ptr_data->Y_Gyro = MPU6050_Data.Y_Gyro;
ptr_data->Z_Gyro = MPU6050_Data.Z_Gyro;
ptr_data->Enable_Acc = TRUE;
ptr_data->Enable_Temp = TRUE;
ptr_data->Enable_Gyro = TRUE;
// 각도 계산
ptr_data->X_AccAngle = (atan2(MPU6050_Data.Y_Acc, MPU6050_Data.Z_Acc)+M_PI)*RAD_TO_DEG;
ptr_data->Y_AccAngle = (atan2(MPU6050_Data.X_Acc, MPU6050_Data.Z_Acc)+M_PI)*RAD_TO_DEG;
}
}
if( Hw_HMC5883_GetEnable() == TRUE )
{
Err = Hw_HMC5883_GetData( &HMC5883_Data );
if( Err == 0 )
{
ptr_data->X_Compass = HMC5883_Data.X_Compass;
ptr_data->Y_Compass = HMC5883_Data.Y_Compass;
ptr_data->Z_Compass = HMC5883_Data.Z_Compass;
ptr_data->Enable_Compass = TRUE;
}
}
return Err;
}
|
#ifndef _SOUND_LIB_H_
#define _SOUBD_LIB_H_
#if defined(_Z8F6403)
extern rom char soundFX[15][8][5];
extern rom char music[4][128][5];
#endif
#endif |
//
// Constants.h
// ByrdFeed
//
// Created by Eddie Freeman on 6/24/14.
// Copyright (c) 2014 NinjaSudo Inc. All rights reserved.
//
#import "Crittercism.h"
// Notification Constants
static NSString *UserLoggedInNotification = @"UserLoggedInNotification";
static NSString *UserSignOutNotification = @"UserSignOutNotification";
static NSString *NewTweetCreatedNotification = @"NewTweetCreatedNotification";
static NSString *ComposeClicked = @"ComposeClicked";
static NSString *TweetClicked = @"TweetClicked";
//static NSString *EmptyNotification = @"EmptyNotification";
// User Default Keys
#define CURRENT_USER_KEY @"current_user" |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import <SceneKit/SCNGeometry.h>
@interface SCNCapsule : SCNGeometry
{
id _reserved;
double _capsulecapRadius;
double _capsuleheight;
long long _capsuleheightSegmentCount;
long long _capsuleradialSegmentCount;
long long _capsulecapSegmentCount;
long long _capsuleprimitiveType;
}
+ (BOOL)supportsSecureCoding;
+ (id)SCNJSExportProtocol;
+ (id)capsuleWithCapRadius:(double)arg1 height:(double)arg2;
- (id)initWithCoder:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (id)copy;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (void)_setupObjCModelFrom:(id)arg1;
- (id)description;
- (BOOL)getBoundingSphereCenter:(struct SCNVector3 *)arg1 radius:(double *)arg2;
- (BOOL)getBoundingBoxMin:(struct SCNVector3 *)arg1 max:(struct SCNVector3 *)arg2;
@property(nonatomic) long long radialSegmentCount;
- (void)setPrimitiveType:(long long)arg1;
- (long long)primitiveType;
@property(nonatomic) long long heightSegmentCount;
@property(nonatomic) double height;
@property(nonatomic) long long capSegmentCount;
@property(nonatomic) double capRadius;
- (void)_syncObjCModel:(struct __C3DParametricGeometry *)arg1;
- (struct __C3DAnimationChannel *)copyAnimationChannelForKeyPath:(id)arg1;
- (id)presentationGeometry;
- (id)presentationCapsule;
- (id)initPresentationParametricGeometryWithParametricGeometryRef:(struct __C3DParametricGeometry *)arg1;
- (void)dealloc;
- (struct __C3DGeometry *)__createCFObject;
- (id)initWithParametricGeometryRef:(struct __C3DParametricGeometry *)arg1;
- (id)init;
@end
|
//
// RCDTableViewController.h
// SealTalk
//
// Created by Sin on 2017/9/26.
// Copyright © 2017年 RongCloud. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "RCDUtilities.h"
@interface RCDTableViewController : UITableViewController
@end
|
//
// HZYDatePicker.h
// CMM
//
// Created by Michael-Nine on 2017/4/26.
// Copyright © 2017年 zuozheng. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HZYDatePicker : UIView
+ (void)datePicker:(UIDatePickerMode)mode selectedHandler:(void(^)(NSDate *date, BOOL isCanceled))handler;
@end
|
//
// MSPair.h
// MYOrse
//
// Created by Marcin Stepnowski on 25/11/14.
// Copyright (c) 2014 siema. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "NSDictionary+MSPair.h"
#import "NSMutableDictionary+MSPair.h"
@interface MSPair : NSObject
@property (strong) id first;
@property (strong) id second;
/**
* Array with 2 object: first and second
*/
@property (nonatomic, readonly) NSArray* valueArray;
-(instancetype)initWithFirst:(id)first andSecond:(id)second;
+(instancetype)pairWithFirst:(id)first andSecond:(id)second;
/**
* Init object with values from array
* first = array[0]
* second = array[1]
*
* @param array with values
*
* @return Initialized object if array have 2 objects or more
*/
-(instancetype)initWithArray:(NSArray*)array;
/**
* Create object with values from array
* first = array[0]
* second = array[1]
*
* @param array with values
*
* @return Initialized object if array have 2 objects or more
*/
+(instancetype)pairWithArray:(NSArray*)array;
-(BOOL)isEqualToPair:(MSPair*)other;
@end
|
//===--------------------------------------------------------------------------------*- C++ -*-===//
// _
// | |
// __| | __ ___ ___ ___
// / _` |/ _` \ \ /\ / / '_ |
// | (_| | (_| |\ V V /| | | |
// \__,_|\__,_| \_/\_/ |_| |_| - Compiler Toolchain
//
//
// This file is distributed under the MIT License (MIT).
// See LICENSE.txt for details.
//
//===------------------------------------------------------------------------------------------===//
#pragma once
#include "dawn/IIR/ASTStmt.h"
#include "dawn/SIR/ASTStmt.h"
#include "dawn/AST/ASTVisitor.h"
#include <memory>
#include <unordered_map>
namespace dawn {
//===------------------------------------------------------------------------------------------===//
// ASTConverter
//===------------------------------------------------------------------------------------------===//
/// @brief Converts an AST with SIR data to one (duplicated) with IIR data.
/// Can retrieve the converted nodes from the the stmt conversion map that is filled with the AST
/// visit.
class ASTConverter : public ast::ASTVisitorForwardingNonConst {
public:
using StmtMap = std::unordered_map<std::shared_ptr<ast::Stmt>, std::shared_ptr<ast::Stmt>>;
ASTConverter();
StmtMap& getStmtMap();
void visit(const std::shared_ptr<ast::BlockStmt>& blockStmt) override;
void visit(const std::shared_ptr<ast::ExprStmt>& stmt) override;
void visit(const std::shared_ptr<ast::ReturnStmt>& stmt) override;
void visit(const std::shared_ptr<ast::VarDeclStmt>& varDeclStmt) override;
void visit(const std::shared_ptr<ast::VerticalRegionDeclStmt>& stmt) override;
void visit(const std::shared_ptr<ast::StencilCallDeclStmt>& stmt) override;
void visit(const std::shared_ptr<ast::BoundaryConditionDeclStmt>& bcStmt) override;
void visit(const std::shared_ptr<ast::IfStmt>& stmt) override;
void visit(const std::shared_ptr<ast::LoopStmt>& stmt) override;
private:
StmtMap stmtMap_; // TODO: make it a pointer to first visited element
};
} // namespace dawn
|
//
// FLOperationQueue.h
// FishLampCocoa
//
// Created by Mike Fullerton on 4/20/13.
// Copyright (c) 2013 GreenTongue Software LLC, Mike Fullerton.
// The FishLamp Framework is released under the MIT License: http://fishlamp.com/license
//
#if DEPRECATED
#import "FLOrderedCollection.h"
#import "FLOperation.h"
@interface FLOperationQueue : NSObject<NSFastEnumeration> {
@private
FLOrderedCollection* _operations;
}
@property (readonly, strong) id firstOperation;
@property (readonly, strong) id lastOperation;
@property (readonly, assign) NSUInteger count;
- (void) queueOperation:(FLOperation*) operation;
- (void) addOperationWithTarget:(id) target action:(SEL) action; // @selector(callback:) parameter is the operation
- (void) addOperationsWithArray:(NSArray*) operations;
- (id) operationForIdentifier:(id) identifier;
- (id) operationAtIndex:(NSUInteger) index;
- (void) removeOperationForIdentifier:(id) identifier;
- (void) removeOperation:(FLOperation*) operation;
- (void) removeAllOperations;
- (id) removeFirstOperation;
- (id) removeLastOperation;
- (void) requestCancel;
@end
// TODO:
//- (void) insertOperation:(FLOperation*) newOperation
// afterOperation:(FLOperation*) afterOperation;
#endif
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Users/tball/tmp/j2objc/guava/sources/com/google/common/collect/EmptyImmutableSetMultimap.java
//
#include "J2ObjC_header.h"
#pragma push_macro("ComGoogleCommonCollectEmptyImmutableSetMultimap_INCLUDE_ALL")
#if ComGoogleCommonCollectEmptyImmutableSetMultimap_RESTRICT
#define ComGoogleCommonCollectEmptyImmutableSetMultimap_INCLUDE_ALL 0
#else
#define ComGoogleCommonCollectEmptyImmutableSetMultimap_INCLUDE_ALL 1
#endif
#undef ComGoogleCommonCollectEmptyImmutableSetMultimap_RESTRICT
#if !defined (_ComGoogleCommonCollectEmptyImmutableSetMultimap_) && (ComGoogleCommonCollectEmptyImmutableSetMultimap_INCLUDE_ALL || ComGoogleCommonCollectEmptyImmutableSetMultimap_INCLUDE)
#define _ComGoogleCommonCollectEmptyImmutableSetMultimap_
#define ComGoogleCommonCollectImmutableSetMultimap_RESTRICT 1
#define ComGoogleCommonCollectImmutableSetMultimap_INCLUDE 1
#include "com/google/common/collect/ImmutableSetMultimap.h"
@interface ComGoogleCommonCollectEmptyImmutableSetMultimap : ComGoogleCommonCollectImmutableSetMultimap
@end
J2OBJC_STATIC_INIT(ComGoogleCommonCollectEmptyImmutableSetMultimap)
FOUNDATION_EXPORT ComGoogleCommonCollectEmptyImmutableSetMultimap *ComGoogleCommonCollectEmptyImmutableSetMultimap_INSTANCE_;
J2OBJC_STATIC_FIELD_GETTER(ComGoogleCommonCollectEmptyImmutableSetMultimap, INSTANCE_, ComGoogleCommonCollectEmptyImmutableSetMultimap *)
J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCollectEmptyImmutableSetMultimap)
#endif
#pragma pop_macro("ComGoogleCommonCollectEmptyImmutableSetMultimap_INCLUDE_ALL")
|
#pragma once
#include <Core/Object.h>
#include <Core/HashString.h>
namespace uutRPG
{
using namespace uut;
class ItemType;
class Item : public Object
{
UUT_OBJECT(uutRPG, Item, Object)
public:
Item();
protected:
SharedPtr<ItemType> _itemType;
};
} |
// 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 STRICT
#define STRICT
#endif
#include "targetver.h"
#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#include "resource.h"
#include <atlbase.h>
#include <atlcom.h>
//#include <atlctl.h>
using namespace ATL;
#include <string>
#include <list>
#import "..\FB2EPubConverter.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids, auto_search
|
/*numPass=4, numTotal=4
Verdict:ACCEPTED, Visibility:1, Input:"2", ExpOutput:"2 -3 2 ", Output:"2 -3 2"
Verdict:ACCEPTED, Visibility:1, Input:"20", ExpOutput:"20 15 10 5 0 5 10 15 20 ", Output:"20 15 10 5 0 5 10 15 20"
Verdict:ACCEPTED, Visibility:1, Input:"4", ExpOutput:"4 -1 4 ", Output:"4 -1 4"
Verdict:ACCEPTED, Visibility:0, Input:"16", ExpOutput:"16 11 6 1 -4 1 6 11 16 ", Output:"16 11 6 1 -4 1 6 11 16"
*/
#include <stdio.h>
int n,count=0;
void res(int a)
{
if(a<=0)
count++;
if(a!=n)
{
printf("%d ",a);
if (count==0)
{
res(a-5);
}
else
res(a+5);
}
else
{
printf("%d",a);
return;
}
}
int main(){
scanf("%d",&n);
printf("%d ",n);
res(n-5);
return 0;
} |
//
// DarkShapesScene.h
// show
//
// Created by Chris Mullany on 02/09/2015.
//
//
#pragma once
#include "ofMain.h"
#include "SceneBase.h"
#include "ShapeRenderer.h"
#define MAX_ATTEMPTS 3
#define DARK_SHAPES_LXCUE_COUNT 10
#define DARK_SHAPES_TIMER_COUNT 8
// TODO: cv blob tracking and shape detection
//
class DarkShapesScene : public SceneBase {
public:
struct ShapeGame{
int attemptNum = 1;
int startScene;
int endScene;
int sceneI;
string label;
ShapeRenderer::ShapeMode shapeMode;
enum State {
INTRO=0, PLAY=2, FAIL=3, PASS=4, INACTIVE=5
} state;
ShapeGame(ShapeRenderer::ShapeMode shapeMode, int startScene, int endScene) {
this->shapeMode = shapeMode;
this->startScene = startScene;
this->endScene = endScene;
state = INACTIVE;
if (shapeMode == ShapeRenderer::CIRCLE) label = "Circle";
else if (shapeMode == ShapeRenderer::RECTANGLE) label = "Rectangle";
else if (shapeMode == ShapeRenderer::TRIANGLE) label = "Triangle";
else if (shapeMode == ShapeRenderer::STAR) label = "Star";
}
void updateSceneI() {
sceneI = getSceneForState(state);
}
int getSceneForState(State state) {
if (state == INTRO) return endScene - 3;
else if (state == PLAY) return endScene - 2;
else if (state == FAIL) return endScene - 1;
else if (state == PASS) return endScene;
else return -1;
}
void setScene(int scene) {
int outroOffset = endScene - scene;
if (outroOffset == 0) state = PASS;
else if (outroOffset == 1) state = FAIL;
else if (outroOffset == 2) state = PLAY;
else if (outroOffset == 3) state = INTRO;
updateSceneI();
}
State getNextState() {
State nextState;
if (state == INTRO) nextState = PLAY;
else if (state == PLAY) nextState = FAIL;
else if (state == FAIL) {
attemptNum++;
if (attemptNum > MAX_ATTEMPTS) nextState = INACTIVE;
else nextState = INTRO;
}
else if (state == PASS) nextState = INACTIVE;
return nextState;
}
void success() {
state = PASS;
updateSceneI();
}
void draw() {
string s = label + " state: " + getStateString() + " attempt " + ofToString(attemptNum) + "/3";
ofDrawBitmapStringHighlight(s, 5, 5);
}
string getStateString() {
if (state == INTRO) return "intro";
else if (state == PLAY) return "play";
else if (state == FAIL) return "fail";
else if (state == PASS) return "pass";
else if (state == INACTIVE) return "inactive";
}
};
DarkShapesScene();
void setup();
void update();
void draw();
void drawMasterScreen();
void play(int i);
void stop();
void setupGui();
void drawGui();
string getShapeForScene(int scene);
// gui
ofParameter<int> modeSelector;
void onShapeModeSelect(int & i);
protected:
private:
ShapeRenderer shapeRenderer;
// gui
ofParameter<string> title;
ofParameter<string> playAgain;
ofParameter<string> goingDark;
ofParameter<string> bonusComplete;
ofParameter<string> heIs;
ofParameter<string> nextLevel;
// LX cues:
// 11 bright, 12 blackout, 13 lights up, 14 black, 15 lights, 16 black, 17 lights, 18 black, 19 lights, 22 countdown
ofParameter<int> lxCues[DARK_SHAPES_LXCUE_COUNT];
ofParameterGroup lxCueGroup;
// Sound cues
// bonus, countdown, bad, good
ofParameter<int> soundCueBonus;
ofParameter<int> soundCueCount;
ofParameter<int> soundCueBad;
ofParameter<int> soundCueGood;
ofParameter<int> outroCueSound;
ofParameter<int> outroCueLighting;
ofParameter<int> CircleStarting;
ofParameter<int> SquareStarting;
ofParameter<int> TriangleStarting;
ofParameter<int> StarStarting;
ofParameterGroup soundCueGroup;
ofParameterGroup timerGroup;
ofParameter<int> timers[DARK_SHAPES_TIMER_COUNT];
ofxPanel shapesPanel;
ofxButton shapeSuccess;
void onSuccess();
vector<ShapeGame> shapeGames;
ShapeGame * currentShapeGame;
virtual void onCountdownComplete(int& i);
}; |
/*
* Copyright (c) Tomohiro Iizuka. All rights reserved.
* Licensed under the MIT license.
*/
#ifndef BASELIB_IO_CHARBUFFER_H_
#define BASELIB_IO_CHARBUFFER_H_
namespace java {
namespace nio {
using namespace alinous;
class CharBuffer : public virtual IObject {
public:
inline void* operator new(size_t size) throw() {
return SysThread::getMalloc()->allocate(size);
}
inline void* operator new(size_t size, MemoryInterface* ctx) throw() {
return ctx->alloc->allocate(size);
}
inline void operator delete(void* p, size_t size) throw() {
SysThread::getMalloc()->freeMemory((char*)p, size);
}
CharBuffer(const wchar_t* buffer, int length, ThreadContext* ctx);
CharBuffer(int size, ThreadContext* ctx);
virtual ~CharBuffer();
void __releaseRegerences(bool prepare, ThreadContext* ctx) throw() ;
static CharBuffer* allocate(int capacity, ThreadContext* ctx);
CharBuffer* clear(ThreadContext* ctx);
RawArrayPrimitive<wchar_t>* move(ThreadContext* ctx);
bool hasArray(ThreadContext* ctx);
int arrayOffset(ThreadContext* ctx);
IArrayObjectPrimitive<wchar_t>* array(ThreadContext* ctx);
bool hasRemaining(ThreadContext* ctx);
int length(ThreadContext* ctx);
int remaining(ThreadContext* ctx);
int position(ThreadContext* ctx);
CharBuffer* position(int newPosition, ThreadContext* ctx);
int limit(ThreadContext* ctx);
CharBuffer* limit(int limit, ThreadContext* ctx);
wchar_t get(ThreadContext* ctx);
wchar_t get(int index, ThreadContext* ctx);
CharBuffer* get(IArrayObjectPrimitive<wchar_t>* dest, ThreadContext* ctx);
CharBuffer* get(IArrayObjectPrimitive<wchar_t>* dest, int off, int len, ThreadContext* ctx);
CharBuffer* put(wchar_t ch, ThreadContext* ctx);
CharBuffer* put(int index, wchar_t ch, ThreadContext* ctx);
CharBuffer* put(UnicodeString* str, ThreadContext* ctx);
CharBuffer* put(IArrayObjectPrimitive<wchar_t>* src, ThreadContext* ctx);
CharBuffer* put(IArrayObjectPrimitive<wchar_t>* src, int off, int len, ThreadContext* ctx);
wchar_t* rawArray();
static CharBuffer* wrap(IArrayObjectPrimitive<wchar_t>* buffer, int begin, int count, ThreadContext* ctx);
static CharBuffer* wrap(UnicodeString* str, ThreadContext* ctx);
static CharBuffer* wrap(UnicodeString* str, int begin, int count, ThreadContext* ctx);
// private:
int pos;
int lim;
int cap;
RawArrayPrimitive<wchar_t>* data;
ArrayObjectPrimitive<wchar_t>* wrapper;
public:
static void __cleanUp(ThreadContext* ctx)
{
}
};
}} /* namespace alinous */
#endif /* BASELIB_IO_CHARBUFFER_H_ */
|
/*
* The MIT License (MIT)
*
* Copyright (c) 2017 Johan Kanflo (github.com/kanflo)
*
* 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 __SPI_DRIVER_H__
#define __SPI_DRIVER_H__
/**
* @brief Initialize the SPI driver
* @retval None
*/
void spi_init(void);
/**
* @brief TX, and optionally RX data on the SPI bus
* @param tx_buf transmit buffer
* @param tx_len transmit buffer size
* @param rx_buf receive buffer (may be NULL)
* @param rx_len receive buffer size (may be 0)
* @retval true if operation succeeded
* false if parameter or driver error
*/
bool spi_dma_transceive(uint8_t *tx_buf, uint32_t tx_len, uint8_t *rx_buf, uint32_t rx_len);
#endif // __SPI_DRIVER_H__
|
//
// BXU.h
// Bit6UI
//
// Created by Carlos Thurber on 11/06/15.
// Copyright © 2015 Bit6. All rights reserved.
//
#ifndef _BIT6UI_H
#define _BIT6UI_H
#endif
#ifndef _BIT6_H
@import Bit6;
#endif
#import <UIKit/UIKit.h>
#import "BXUContactSource.h"
#import "BXUContactNameLabel.h"
#import "BXUConversationAvatarView.h"
#import "BXUContactAvatarImageView.h"
#import "BXUTypingLabel.h"
#import "BXUWebSocketStatusLabel.h"
#import "BXUAttachmentImageView.h"
#import "BXUImageViewController.h"
#import "BXULocationViewController.h"
#import "BXUConversationTableViewController.h"
#import "BXUConversationTableViewCell.h"
#import "BXUMessageTableViewController.h"
#import "BXUMessageTableViewCell.h"
#import "BXUConversationsTabBarItem.h"
#import "BXUCallViewController.h"
#import "BXUIncomingCallPrompt.h"
#import "BXUProgressWindow.h"
#import "BXUButtons.h"
#define BIT6UI_IOS_SDK_VERSION_STRING @"0.10.1"
NS_ASSUME_NONNULL_BEGIN
/*! BXU offers some generic functionality like setting the ContactDataSource to use through the framework, to show incoming message banners and deletion of cache pictures. */
@interface BXU : NSObject
/*! Unavailable init
@return a new instance of the class.
*/
- (instancetype)init NS_UNAVAILABLE;
/*! Gets the current <BXUContactSource> object.
@return contact source object.
*/
+ (nullable id<BXUContactSource>)contactSource;
/*! Sets the current <BXUContactSource> object to use through the framework.
@note After a logout this value will be set to nil automatically.
@param contactDataSource contact source object to set.
*/
+ (void)setContactSource:(nullable id<BXUContactSource>)contactDataSource;
/*! Returns the display name for an specified identity. If no contact is provided for the identity in the +[BXU contactSource] then a default display name will be generated.
@param address identity to search for an display name.
@return display name for the identity.
@see +[BXU contactSource]
*/
+ (NSString*)displayNameForAddress:(Bit6Address*)address;
/*! Returns the name initials for an specified identity.
@param address identity to search for the name initials.
@return name initials for the identity.
@see +[BXU displayNameForAddress:]
@see +[BXU contactSource]
*/
+ (NSString*)initialsForAddress:(Bit6Address*)address;
/*! Returns the image URL for an specified identity.
@param address identity to search for the image URL.
@return image URL for the identity.
@see +[BXU contactSource]
*/
+ (nullable NSURL*)displayImageURLForAddress:(Bit6Address*)address;
/*! Deletes the profile pictures from cache.
@return number of files deleted.
*/
+ (NSUInteger)clearProfilePictures;
/*! Deletes an identity profile picture from cache.
@param address identity of the profile picture to delete.
@return YES if the file was deleted from cache.
*/
+ (BOOL)clearProfilePictureForAddress:(Bit6Address*)address;
/*! Shows a incoming message notification banner.
@param from identity to use as the sender of the message.
@param message message to show in the banner
@param tappedHandler handler to execute if the banner is tapped
*/
+ (void)showNotificationFrom:(Bit6Address*)from message:(NSString*)message tappedHandler:(nullable void(^)(Bit6Address * _Nullable from))tappedHandler;
///---------------------------------------------------------------------------------------
/// @name Calls
///---------------------------------------------------------------------------------------
/*! The current call media mode. */
+ (Bit6CallMediaMode)callMediaMode;
/*! Indicates if the calls will go P2P or if the server should process the media.
@param callMediaMode P2P or MIX to process the calls media in the server.
*/
+ (void)setCallMediaMode:(Bit6CallMediaMode)callMediaMode;
/*! The current configuration for audio calls support.
@return YES if audio calls are enabled.
*/
+ (BOOL)enableAudioCalls;
/*! Used to configure the support for audio streams in the calls.
@param enable YES if audio streams should be available during the calls.
*/
+ (void)setEnableAudioCalls:(BOOL)enable;
/*! The current configuration for video calls support.
@return YES if video calls are enabled.
*/
+ (BOOL)enableVideoCalls;
/*! Used to configure the support for video streams in the calls.
@param enable YES if video streams should be available during the calls.
*/
+ (void)setEnableVideoCalls:(BOOL)enable;
/*! The current configuration for data transfers during a call.
@return YES if data transfer should be enabled in the calls.
*/
+ (BOOL)enableCallsWithData;
/*! Used to configure the support for data transfers in the calls.
@param enable YES if data transfers should be available during the calls.
*/
+ (void)setEnableCallsWithData:(BOOL)enable;
/*! Convenient method to get the enabled streams in Bit6UI framework from a given streams param.
@param streams the list of streams we want to compare.
@return the enabled streams in the given streams param.
*/
+ (Bit6CallStreams)availableStreamsIn:(Bit6CallStreams)streams;
@end
NS_ASSUME_NONNULL_END
|
/*
*
* Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
* prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
* Product and Trade Secret source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2014 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
*
*/
#ifndef HKSCENEDATA_MATERIAL_HKXMATERIALEFFECT_HKCLASS_H
#define HKSCENEDATA_MATERIAL_HKXMATERIALEFFECT_HKCLASS_H
extern HK_EXPORT_COMMON const class hkClass hkxMaterialEffectClass;
class HK_EXPORT_COMMON hkxMaterialEffect : public hkReferencedObject
{
//+vtable(true)
//+version(1)
public:
HK_DECLARE_CLASS_ALLOCATOR( HK_MEMORY_CLASS_SCENE_DATA );
HK_DECLARE_REFLECTION();
hkxMaterialEffect() { }
hkxMaterialEffect(hkFinishLoadedObjectFlag f) : hkReferencedObject(f), m_name(f), m_data(f) {}
/// Used by textures to hint at their usage.
enum EffectType
{
EFFECT_TYPE_INVALID,
EFFECT_TYPE_UNKNOWN,
EFFECT_TYPE_HLSL_FX_INLINE, // As a source text file
EFFECT_TYPE_CG_FX_INLINE, // As a source text file
EFFECT_TYPE_HLSL_FX_FILENAME, // As a source text file
EFFECT_TYPE_CG_FX_FILENAME, // As a source text file
EFFECT_TYPE_MAX_ID
};
//
// Members
//
public:
/// The name of the material effect
hkStringPtr m_name;
/// What type of effect is this?
hkEnum<EffectType, hkUint8> m_type;
/// The data for the effect (source, or filename)
hkArray<hkUint8> m_data;
};
#endif // HKSCENEDATA_MATERIAL_HKXMATERIALEFFECT_HKCLASS_H
/*
* Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
*
* Confidential Information of Havok. (C) Copyright 1999-2014
* Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
* Logo, and the Havok buzzsaw logo are trademarks of Havok. Title, ownership
* rights, and intellectual property rights in the Havok software remain in
* Havok and/or its suppliers.
*
* Use of this software for evaluation purposes is subject to and indicates
* acceptance of the End User licence Agreement for this product. A copy of
* the license is included with this software and is also available at www.havok.com/tryhavok.
*
*/
|
// Copyright 2015 XLGAMES Inc.
//
// Distributed under the MIT License (See
// accompanying file "LICENSE" or the website
// http://www.opensource.org/licenses/mit-license.php)
#pragma once
#include "../RenderCore/Metal/Forward.h"
#include "../Math/Vector.h"
namespace SceneEngine
{
class LightingParserContext;
void DrawBasisAxes(RenderCore::Metal::DeviceContext* context, LightingParserContext& parserContext, const Float3& offset = Float3(0,0,0));
}
|
/*
* Copyright (c) 2012 - 2016 Kulykov Oleh <info@resident.name>
*
* 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 __REFILEMANAGER_H__
#define __REFILEMANAGER_H__
#include "REString.h"
#include <wchar.h>
/**
@brief Class used for creating, checking files and directories
*/
class __RE_PUBLIC_CLASS_API__ REFileManager
{
private:
public:
bool moveFile(const wchar_t * sourceFilePath, const wchar_t * destinationFilePath) const;
bool moveFile(const char * sourceFilePath, const char * destinationFilePath) const;
bool moveFile(const REString & sourceFilePath, const REString & destinationFilePath) const;
bool isExistsAtPath(const wchar_t * path, bool * isDirectory) const;
bool isExistsAtPath(const char * path, bool * isDirectory) const;
bool isExistsAtPath(const REString & path, bool * isDirectory) const;
REString randomName(const RESizeT nameLength = 8);
REFileManager();
virtual ~REFileManager();
};
#endif /* __REFILEMANAGER_H__ */
|
//
// ZXTableViewCell.h
// 1224_custom-cell-by-xib
//
// Created by zx on 12/24/14.
// Copyright (c) 2014 zuoxue@qq.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@class ZXBookDataModel;
@interface ZXTableViewCell : UITableViewCell
@property(nonatomic,strong) UILabel * bookTitleLabel;
@property(nonatomic,strong) UILabel * bookPriceLabel;
@property(nonatomic,strong) UILabel * bookDetailLabel;
@property(nonatomic,strong) UIImageView * iconImageView;
@property(nonatomic,strong) ZXBookDataModel * bookDataModel;
+(ZXTableViewCell *)cellWithTableView:(UITableView *)tableView;
@end
|
#pragma once
#include "MicroManager.h"
namespace UAlbertaBot
{
class DetectorManager : public MicroManager
{
std::map<BWAPI::Unit, bool> m_cloakedUnitMap;
BWAPI::Unit unitClosestToEnemy = nullptr;
bool isAssigned(BWAPI::Unit unit);
public:
DetectorManager();
void setUnitClosestToEnemy(BWAPI::Unit unit) { unitClosestToEnemy = unit; }
void executeMicro(const BWAPI::Unitset & targets);
BWAPI::Unit closestCloakedUnit(const BWAPI::Unitset & cloakedUnits, BWAPI::Unit detectorUnit);
};
} |
//
// Created by Derek van Vliet on 2014-12-10.
// Copyright (c) 2015 Get Set Games Inc. All rights reserved.
//
#pragma once
#include "IAdColony.h"
// You should place include statements to your module's private header files here. You only need to
// add includes for headers that are used in most of your module's source files though.
#if PLATFORM_IOS
#import <AdColony/AdColony.h>
#endif
DECLARE_LOG_CATEGORY_EXTERN(LogAdColony, Log, All);
#include "AdColonyClasses.h"
|
// Copyright (c) 2009-2012 The Vegascoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef VEGASCOIN_CHECKPOINT_H
#define VEGASCOIN_CHECKPOINT_H
#include <map>
class uint256;
class CBlockIndex;
/** Block-chain checkpoints are compiled-in sanity checks.
* They are updated every release or three.
*/
namespace Checkpoints
{
// Returns true if block passes checkpoint checks
bool CheckBlock(int nHeight, const uint256& hash);
// Return conservative estimate of total number of blocks, 0 if unknown
int GetTotalBlocksEstimate();
// Returns last CBlockIndex* in mapBlockIndex that is a checkpoint
CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex);
double GuessVerificationProgress(CBlockIndex *pindex);
}
#endif
|
/* fetchsamplelist.c, 8jun2016, from fetchsample.c, 7may106, from: samplestest.c, 26jan2015, from h5fetchsample.c, 25jan2015
Fetch a set of entire rows, alleles for all markers for the specified samples. */
/* 12jun16, Detect and handle different datatypes. */
#include "hdf5.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <time.h>
#define DATASETNAME "/allelematrix_samples-fast"
#define RANK 2 /* number of dimensions */
int main (int argc, char *argv[]) {
/* HDF5 variables */
hsize_t filedims[RANK], dimsm[RANK];
hsize_t start[RANK], stride[RANK], count[RANK], block[RANK];
hid_t file_id, dataset_id; /* handles */
hid_t dataspace_id, memspace_id;
hid_t datumtype;
herr_t status;
FILE *outfile;
int datumsize, j, k;
if (argc < 3) {
printf("Usage: %s <HDF5 file> <listfile> <output file>\n", argv[0]);
printf("E.g. %s /shared_data/HDF5/Maize/SeeD_unimputed.h5 ./samplelist /tmp/fetchsamplelist.out\n", argv[0]);
printf("E.g. %s /shared_data/HDF5/Rice/PhasedSNPs.h5 ./samplelist /tmp/fetchsamplelist.out \n", argv[0]);
printf("Fetch alleles for the samples listed in the listfile, for all markers.\n");
printf("The listfile contains sample position numbers, separated by newline.\n");
return 0;
}
/* Read the arguments. */
char *h5filename = argv[1];
char *listfilename = argv[2];
char *outfilename = argv[3];
outfile = fopen (outfilename, "w");
/* Open the HDF5 file and dataset. */
file_id = H5Fopen (h5filename, H5F_ACC_RDONLY, H5P_DEFAULT);
dataset_id = H5Dopen2 (file_id, DATASETNAME, H5P_DEFAULT);
dataspace_id = H5Dget_space (dataset_id);
/* Find the dimensions of the HDF5 file dataset. */
H5Sget_simple_extent_dims(dataspace_id, filedims, NULL);
int SampleTotal = filedims[0];
int MarkerTotal = filedims[1];
/* Determine the datatype and the size of an individual element. */
datumtype = H5Dget_type(dataset_id);
datumsize = H5Tget_size(datumtype);
/* Create memory space with size of subset. Get file dataspace. */
dimsm[0] = 1;
dimsm[1] = MarkerTotal;
char rdata[MarkerTotal * datumsize]; /* buffer for read */
memspace_id = H5Screate_simple (RANK, dimsm, NULL);
/* Select subset from file dataspace. */
start[1] = 0;
stride[0] = 1; stride[1] = 1;
count[0] = 1; count[1] = 1;
block[0] = 1; block[1] = MarkerTotal;
/* Read in the list of sample positions one at a time, outputting the matrix row for each. */
FILE *samples = fopen (listfilename, "r");
char *listitem = malloc(100);
int sample;
while (fgets(listitem, 100, samples)) {
sample = atoi(listitem);
if (sample >= SampleTotal) {
printf("Sample number %i out of range.\n", sample);
return 1;
}
if (sample < 0) {
/* Sample "position" is -1, missing. Return a row of Ns. */
for (j = 0; j < MarkerTotal * datumsize; j = j + datumsize) {
for (k = 0; k < datumsize; k++)
fprintf(outfile, "N");
if (j < (MarkerTotal - 1) * datumsize)
/* No trailing <Tab> at end of line. */
fprintf(outfile, "\t");
}
fprintf(outfile, "\n");
}
else {
start[0] = sample;
status = H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, start, stride, count, block);
/* Read the hyperslab. */
status = H5Dread (dataset_id, datumtype, memspace_id, dataspace_id, H5P_DEFAULT, rdata);
/* Write the results to the output file, as a tab-delimited string for each sample. */
for (j = 0; j < MarkerTotal * datumsize; j = j + datumsize) {
for (k = 0; k < datumsize; k++)
fprintf(outfile, "%c", rdata[j + k]);
/* No trailing <Tab> at end of line. */
if (j < (MarkerTotal - 1) * datumsize)
fprintf(outfile, "\t");
}
fprintf(outfile, "\n");
}
}
fclose(outfile);
status = H5Tclose(datumtype);
status = H5Sclose (memspace_id);
status = H5Sclose (dataspace_id);
status = H5Dclose (dataset_id);
status = H5Fclose (file_id);
if (status >= 0) return 0;
else return 1;
}
|
//
// WASLoginButton.h
// YueXin
//
// Created by wangshuo on 16/5/19.
// Copyright © 2016年 wangshuo. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface WASLoginButton : UIButton
- (instancetype)initLoginButtonWithButtonTitle:(NSString *)buttonTitle;
@end
|
/*
Copyright (c) 2016 Martin Sustrik
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
#include <stdio.h>
#include "assert.h"
#include "../libdill.h"
coroutine void worker(int count, const char *text) {
int i;
for(i = 0; i != count; ++i) {
printf("%s\n", text);
int rc = msleep(now() + 10);
errno_assert(rc == 0);
}
}
int main() {
int cr1 = go(worker(4, "a "));
errno_assert(cr1 >= 0);
int cr2 = go(worker(2, "b"));
errno_assert(cr2 >= 0);
int cr3 = go(worker(3, "c"));
errno_assert(cr3 >= 0);
int rc = msleep(now() + 100);
errno_assert(rc == 0);
rc = hclose(cr1);
errno_assert(rc == 0);
rc = hclose(cr2);
errno_assert(rc == 0);
rc = hclose(cr3);
errno_assert(rc == 0);
return 0;
}
|
#ifndef SRL_ENVIRONMENT_H
#define SRL_ENVIRONMENT_H
#include "Value.h"
#include "Blocks.h"
#include "String.h"
#include "Hash.h"
#include "Parser.h"
#include "In.h"
#include "Out.h"
#include <list>
namespace Srl {
class Tree;
class Node;
namespace Lib {
template<class T> struct Link {
size_t hash;
T field;
Link(size_t hash_, const T& field_)
: hash(hash_), field(field_) { }
};
template<class T>
using Items = std::list<Lib::Link<T>, Lib::HeapAllocator<Lib::Link<T>>>;
template<> struct HashSrl<const void*> {
size_t operator()(const void* v) const
{
uint64_t addr = (uint64_t)v;
return HashSrl<uint64_t>()(addr);
}
};
struct Environment {
static const Encoding Str_Encoding = Encoding::UTF8;
Environment(Tree& tree_) : tree(&tree_) { }
Tree* tree;
Heap heap;
HTable<String, String> str_table;
HTable<const void*, size_t> shared_table_store { 16 };
HTable<size_t, std::shared_ptr<void>> shared_table_restore { 16 };
std::vector<uint8_t> str_buffer;
std::vector<uint8_t> type_buffer;
Parser* parser = nullptr;
bool parsing = false;
Lib::In in;
Lib::Out out;
template<class T>
Link<T>* create_link(Lib::Items<T>& lst, const T& val, const String& name);
Link<Node>* create_node (Type type, const String& name);
Link<Node>* store_node (Node& parent, const Node& node, const String& name);
Link<Value>* store_value (Node& parent, const Value& value, const String& name);
uint64_t hash_string (const String& str);
String conv_string (const String& str);
void write (const Value& value, const String& name);
void write_conv (const Value& value, const String& name);
Value conv_type (const Value& value);
void set_output (Parser& parser, Lib::Out::Source src);
void set_input (Parser& parser, Lib::In::Source src);
std::pair<const String*, size_t> store_string (const String& str);
void clear();
};
} }
#endif
|
/* vim: foldmethod=marker
* {{{ License header: MIT
* Copyright (c) 2014 Till Maas <opensource@till.name>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
}}}*/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
/* USAGE ${0} WAITFILE COMMAND COMMANDARGS
* Execute COMMAND with COMMANDARGS and kill it when WAITFILE exists
*/
int main(int argc, char** argv) {
pid_t pid, ppid, pgid;
int res;
struct stat buf;
char* waitfile;
/* Create a new process group to be able to kill all processes */
pgid = setsid();
if (pgid == -1) {
perror("pgid");
return -1;
}
pid = fork();
if (pid == 0) {
waitfile = argv[1];
/* Wait until waitfile exists */
while (1) {
if ((res = stat(waitfile, &buf)) == -1) {
sleep(1);
} else {
break;
}
}
ppid = getppid();
//kill(ppid, SIGTERM);
/* Kill procress group */
kill(-1 * pgid, SIGTERM);
return 0;
} else {
/* Execute command specified starting with argv[2] */
if (execvp(argv[2], &argv[2]) == -1) {
perror("execvp");
return -1;
}
}
return 0;
}
|
#include <stdio.h>
int main(){
const int NK = 3;
const int NN = 5;
int sizes[NK] = { 5, 4, 4 };
int arr[NK][NN] = {
{4, 10, 15, 24, 26},
{0, 9, 12, 20},
{5, 18, 22, 30},
};
int indice[NK];
for( int k=0;k<NK;k++ ){
indice[k] = 0;
}
int min_k = 0;
int max_k = 0;
int range[2] = { -1e9, 1e9 };
while( indice[min_k] < sizes[min_k] ){
min_k = max_k = 0;
for( int k=0;k<NK;k++ ){
if( arr[min_k][indice[min_k]] > arr[k][indice[k]] ) min_k = k;
if( arr[max_k][indice[max_k]] < arr[k][indice[k]] ) max_k = k;
}
if( arr[max_k][indice[max_k]]-arr[min_k][indice[min_k]] < range[1]-range[0] ){
range[1] = arr[max_k][indice[max_k]];
range[0] = arr[min_k][indice[min_k]];
}
indice[min_k]++;
}
printf("%d\t%d\n",range[1],range[0]);
return 0;
}
|
//
// Created by Yaali on 15/4/18.
// Copyright © 2015年 Yaali. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "YLBlockType.h"
@interface UIView(UIView_YLKit)
@property (nonatomic,copy,setter=yl_setTapGesture:) yl_block_Void yl_tapGesture;
@property (nonatomic,strong,setter=yl_setSuperVC:) UIViewController * yl_superVC;
-(void)yl_ani_zoomIn:(CGFloat)scale duration:(CGFloat)duration;
-(void)yl_ani_rotate:(NSInteger)angle duration:(CGFloat)duration;
-(void)yl_ani_resume;
-(void)yl_ani_clean;
@end
|
//
// BKRadarCircle.h
// BKRadar
//
// Created by Bastian Kohlbauer on 22.04.14.
// Copyright (c) 2014 Bastian Kohlbauer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BKRadarCircle : UIView
- (void)setAnimationAlphaForBeginning:(CGFloat)alpha;
- (void)setAnimationAlphaForEnding:(CGFloat)alpha;
- (void)setLineWidth:(CGFloat)lineWidth;
- (void)setStrokeColor:(UIColor *)strokeColor;
- (void)setFillColor:(UIColor *)fillColor;
@property (assign, nonatomic) CGFloat alphaStart;
@property (assign, nonatomic) CGFloat alphaEnd;
@end
|
//
// SRHTwitchUser.h
// StreamPerfect
//
// Created by Francois Courville on 2014-08-03.
// Copyright (c) 2014 Swift Synergy. All rights reserved.
//
#import <Foundation/Foundation.h>
@class RKObjectMapping;
@interface SRHTwitchUser : NSObject
@property(nonatomic, strong) NSString *displayName;
@property(nonatomic, strong) NSString *name;
@property(nonatomic, strong) NSString *authenticationToken;
@property(nonatomic, strong) NSURL *photoURL;
@property(nonatomic, assign, getter = isPartnered) BOOL partnered;
@property(nonatomic, strong) NSString *email;
@property(nonatomic, strong) NSArray *followedStreamNames;
@property(nonatomic, assign) BOOL hasFetchedDetails;
+ (RKObjectMapping *)mappingForTwitchAPI;
@end
|
#pragma once
#include "Arduino.h"
//Bean --> Computer
const uint8_t timeOutCodeBC = 0xBA;
const uint8_t dataAvailableBC = 0xBB;
const uint8_t endOfDataCodeBC = 0xBC;
const uint8_t clockNotSetCodeBC = 0xBD;
const uint8_t updatingDataBC = 0xBE;
const uint8_t StorageOverFlowBC = 0xBF;
//Computer --> Bean
const uint8_t requestDataCodeCB = 0xCA;
const uint8_t setTimeCodeCB = 0xCB;
|
#include <stdio.h>
void unbufferstdout_() {setbuf(stdout,NULL);}
|
//
// AppDelegate.h
// MTLogDemo
//
// Created by Marin Todorov on 7/9/13.
// Copyright (c) 2013 Underplot ltd. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_HomeControlTestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_HomeControlTestsVersionString[];
|
//
// NSOperationViewController.h
// MultiThreading
//
// Created by Li Zhe on 10/15/16.
// Copyright © 2016 SH10. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NSOperationViewController : UIViewController
@end
|
//
// Attachment.h
// Helpifier
//
// Created by Sean Dougall on 1/29/11.
//
// Copyright (c) 2011 Figure 53 LLC, http://figure53.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 <Cocoa/Cocoa.h>
@interface Attachment : NSObject
{
NSString *_localPath;
NSData *_fileData;
}
@property (readonly) NSString *name;
@property (readonly) NSString *size;
@property (readonly) NSString *mimeType;
@property (readonly) NSString *body;
+ (Attachment *) attachmentWithFileAtPath: (NSString *) path;
- (id) initWithFileAtPath: (NSString *) path;
@end
|
#pragma once
#include <Input/InputConditionEvent.h>
// Event condition that is triggered by ButtonDown of the corresponding button
namespace Input
{
class CInputConditionDown: public CInputConditionEvent
{
protected:
EDeviceType _DeviceType;
U8 _Button;
public:
CInputConditionDown(EDeviceType DeviceType, U8 Button);
virtual bool OnButtonDown(const IInputDevice* pDevice, const Event::ButtonDown& Event) override;
};
}
|
#include "mex.h" /*--This one is required*/
/* Prototype for the Props function to be called. Can't use the CoolProp.h header because there are a lot of
c++ parts in the header that cannot be easily hidden when compiling */
double PropsSI(char *Output, char *Name1, double Prop1, char *Name2, double Prop2, char * Ref);
double Props1(char *Output, char * Ref);
long get_global_param_string(char*, char*);
long get_fluid_param_string(char *fluid, char *param, char * Output);
long get_standard_unit_system(void);
void set_standard_unit_system(long);
#include "GlobalConstants.h"
#include "float.h"
bool ValidNumber(double x)
{
// Idea from http://www.johndcook.com/IEEE_exceptions_in_cpp.html
return (x <= DBL_MAX && x >= -DBL_MAX);
};
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
int npol,Nel;
int m,n,u,v,k,Output_len,Name1_len,Name2_len,Ref_len,Param_len;
int *c,status;
double *d,Prop1,Prop2,x,y;
char *Output,*Name1,*Name2,*Ref,*Param,errstr[1000],errstr2[1000],fluidslist[10000];
double val;
mxArray *cMat[1];
if (nrhs == 2 && mxIsChar (prhs[0]) && mxIsChar (prhs[1]))
{
/* Get the refrigerant (it is a string) (+1 for the NULL terminator)*/
Ref_len=(mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1;
Ref = mxCalloc(Ref_len, sizeof(char));
status = mxGetString(prhs[0], Ref, Ref_len);
/* Get the output (it is a string) (+1 for the NULL terminator)*/
Output_len=(mxGetM(prhs[1]) * mxGetN(prhs[1])) + 1;
Output = mxCalloc(Output_len, sizeof(char));
status = mxGetString(prhs[1], Output, Output_len);
/* Try to shortcut to get the strings for the fluid */
if (!strcmp(Output,"aliases") || !strcmp(Output,"CAS") || !strcmp(Output,"CAS_number") || !strcmp(Output,"ASHRAE34") || !strcmp(Output,"REFPROPName") || !strcmp(Output,"REFPROP_name") || !strcmp(Output,"TTSE_mode"))
{
get_fluid_param_string(Ref,Output,fluidslist);
plhs[0] = mxCreateString(fluidslist);
return;
}
else if (!strcmp(Output,"enable_TTSE"))
{
enable_TTSE_LUT(Ref);
return;
}
else if (!strcmp(Output,"disable_TTSE"))
{
disable_TTSE_LUT(Ref);
return;
}
/* Ok, now try to get the values for the fluid */
/* Create matrix for the return argument. */
plhs[0] = mxCreateDoubleMatrix(1,1, mxREAL);
/* Get the value*/
val = Props1(Ref,Output);
/* If it is a good value, return it*/
if (ValidNumber(val))
{
*mxGetPr(plhs[0]) = val;
}
/* Otherwise there was an error, return the CoolProp error*/
else
{
get_global_param_string("errstring",errstr);
sprintf(errstr2,"CoolProp Error: %s",errstr);
mexErrMsgTxt(errstr2);
}
}
else if (nrhs == 6 && mxIsChar (prhs[0]) && mxIsChar (prhs[1]) && mxIsChar (prhs[3]) && mxIsChar (prhs[5]) )
{
/* Create matrix for the return argument. */
plhs[0] = mxCreateDoubleMatrix(1,1, mxREAL);
/* Get the refrigerant (it is a string) (+1 for the NULL terminator)*/
Ref_len=(mxGetM(prhs[5]) * mxGetN(prhs[5])) + 1;
Ref = mxCalloc(Ref_len, sizeof(char));
mxGetString(prhs[5], Ref, Ref_len);
/* Get the output (it is a string) (+1 for the NULL terminator)*/
Output_len=(mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1;
Output = mxCalloc(Output_len, sizeof(char));
mxGetString(prhs[0], Output, Output_len);
Name1_len=(mxGetM(prhs[1]) * mxGetN(prhs[1])) + 1;
Name1 = mxCalloc(Name1_len, sizeof(char));
mxGetString(prhs[1], Name1, Name1_len);
Name2_len=(mxGetM(prhs[3]) * mxGetN(prhs[3])) + 1;
Name2 = mxCalloc(Name2_len, sizeof(char));
mxGetString(prhs[3], Name2, Name2_len);
Prop1 = mxGetScalar(prhs[2]);
Prop2 = mxGetScalar(prhs[4]);
val = PropsSI(Output,Name1,Prop1,Name2,Prop2,Ref);
/* If it is a good value, return it */
if (ValidNumber(val))
{
*mxGetPr(plhs[0]) = val;
}
/* Otherwise there was an error, return the CoolProp error*/
else
{
get_global_param_string("errstring",errstr);
sprintf(errstr2,"CoolProp Error: %s",errstr);
mexErrMsgTxt(errstr2);
}
}
else if (nrhs == 1 && mxIsChar (prhs[0]))
{
Ref_len=(mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1;
Ref = mxCalloc(Ref_len, sizeof(char));
status = mxGetString(prhs[0], Ref, Ref_len);
if (!strcmp(Ref,"FluidsList")){
get_global_param_string("FluidsList",fluidslist);
}
else if (!strcmp(Ref,"version")){
get_global_param_string("version",fluidslist);
}
else if (!strcmp(Ref,"gitrevision")){
get_global_param_string("gitrevision", fluidslist);
}
else
{
sprintf(errstr2,"single input is invalid: %s",Ref);
mexErrMsgTxt(errstr2);
}
plhs[0] = mxCreateString(fluidslist);
return;
}
else
{
mexErrMsgTxt("Props must either receive two strings or the signature Props(Output,Param1,Value1,Param2,Value2,FluidName)");
}
}
|
//
// UITableView+VDEnhance.h
// objcTemp
//
// Created by Deng on 16/7/7.
// Copyright © Deng. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UITableView (VDEnhance)
#pragma mark Public Method
- (void)vd_setDelaysContentTouches:(BOOL)delay;
@end
|
"ACE_RangeTable_82mm",
"ACE_fieldDressing",
"ACE_bloodIV_500",
"ACE_bloodIV_250",
"ACE_bloodIV",
"ACE_CableTie",
"ACE_DefusalKit",
"ACE_EntrenchingTool",
"ACE_epinephrine",
"ACE_Flashlight_MX991",
"ACE_Flashlight_KSF1",
"ACE_M26_Clacker",
"ACE_Clacker",
"ACE_Flashlight_XL50",
"ACE_MapTools",
"ACE_morphine",
"ACE_RangeCard",
"ACE_Sandbag_empty",
"ACE_SpottingScope",
"ACE_Tripod",
"ACE_wirecutter",
"ACE_SpraypaintBlack",
"ACE_SpraypaintBlue",
"ACE_SpraypaintGreen",
"ACE_SpraypaintRed",
"ACE_bodyBag", |
//
// CueSheetDecoder.h
//
// Copyright (c) 2015 Jerry Wong
//
// 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 "JWMCommonProtocols.h"
@interface CueSheetDecoder : NSObject <JWMDecoder>
@end
|
//
// OTTypeDef.h
// Pomodoro
//
// Created by OpenThread on 12/3/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
typedef struct objc_ivar *Ivar;
typedef struct objc_property *objc_property_t;
typedef struct objc_method *Method;
typedef uintptr_t objc_AssociationPolicy;
|
/*
** $Id: lualib.h,v 1.44 2014/02/06 17:32:33 roberto Exp $
** Lua standard libraries
** See Copyright Notice in lua.h
*/
#ifndef lualib_h
#define lualib_h
#include "lua.h"
LUAMOD_API int (luaopen_base) (lua_State *L);
#define LUA_COLIBNAME "coroutine"
LUAMOD_API int (luaopen_coroutine) (lua_State *L);
#define LUA_TABLIBNAME "table"
LUAMOD_API int (luaopen_table) (lua_State *L);
#define LUA_IOLIBNAME "io"
LUAMOD_API int (luaopen_io) (lua_State *L);
#define LUA_OSLIBNAME "os"
LUAMOD_API int (luaopen_os) (lua_State *L);
#define LUA_STRLIBNAME "string"
LUAMOD_API int (luaopen_string) (lua_State *L);
#define LUA_UTF8LIBNAME "utf8"
LUAMOD_API int (luaopen_utf8) (lua_State *L);
#define LUA_BITLIBNAME "bit32"
LUAMOD_API int (luaopen_bit32) (lua_State *L);
#define LUA_MATHLIBNAME "math"
LUAMOD_API int (luaopen_math) (lua_State *L);
#define LUA_DBLIBNAME "debug"
LUAMOD_API int (luaopen_debug) (lua_State *L);
#define LUA_LOADLIBNAME "package"
LUAMOD_API int (luaopen_package) (lua_State *L);
#define LUA_UVLIBNAME "uv"
LUAMOD_API int (luaopen_uv)(lua_State *L);
/* open all previous libraries */
LUALIB_API void (luaL_openlibs) (lua_State *L);
#if !defined(lua_assert)
#define lua_assert(x) ((void)0)
#endif
#endif
|
#pragma once
#ifndef Algorithm2DWrapper_h__20160813
#define Algorithm2DWrapper_h__20160813
#include "Interface/Implement/ProcessorImpl.h"
#include <complex>
namespace Yap
{
template<typename INPUT_TYPE, typename OUTPUT_TYPE>
class Algorithm2DWrapper :
public ProcessorImpl
{
public:
typedef void (*ProcessingFunc) (INPUT_TYPE * input_data, OUTPUT_TYPE * output_data,
size_t width, size_t height);
explicit Algorithm2DWrapper(ProcessingFunc func, const wchar_t * processor_name) :
_func(func), ProcessorImpl(processor_name)
{
AddInput(L"Input", 2, type_id<INPUT_TYPE>::type);
AddOutput(L"Output", 2, type_id<OUTPUT_TYPE>::type);
}
Algorithm2DWrapper(const Algorithm2DWrapper<INPUT_TYPE, OUTPUT_TYPE>& rhs) :
_func(rhs._func), ProcessorImpl(rhs)
{
}
~Algorithm2DWrapper() {}
virtual bool Input(const wchar_t * port, IData * data) override
{
if (wstring(port) != L"Input")
return false;
if (data->GetDataType() != type_id<INPUT_TYPE>::type)
return false;
DataHelper input_data(data);
if (input_data.GetActualDimensionCount() != 2)
return false;
unsigned int width = input_data.GetWidth();
unsigned int height = input_data.GetHeight();
auto output_data = CSmartPtr<CDataImp<OUTPUT_TYPE>>(new CDataImp<OUTPUT_TYPE>(data->GetDimensions()));
_func(GetDataArray<INPUT_TYPE>(data),
GetDataArray<OUTPUT_TYPE(output_data.get()),
width, height);
Feed(L"Output", output_data.get());
}
virtual IProcessor * Clone() override
{
return new(nothrow) Algorithm2DWrapper<INPUT_TYPE, OUTPUT_TYPE>(*this);
}
protected:
ProcessingFunc _func;
};
template<typename T>
class Algorithm2DInPlaceWrapper :
public ProcessorImpl
{
public:
typedef void(*ProcessingFunc) (T * input_data, size_t width, size_t height);
explicit Algorithm2DInPlaceWrapper(ProcessingFunc func, const wchar_t * processor_name) :
_func(func), ProcessorImpl(processor_name)
{
AddInput(L"Input", 2, type_id<T>::type);
AddOutput(L"Output", 2, type_id<T>::type);
}
Algorithm2DInPlaceWrapper(const Algorithm2DInPlaceWrapper<T>& rhs) :
_func(rhs._func), ProcessorImpl(rhs)
{
}
~Algorithm2DInPlaceWrapper() {}
virtual bool Input(const wchar_t * port, IData * data) override
{
if (std::wstring(port) != L"Input")
return false;
if (data->GetDataType() != type_id<T>::type)
return false;
DataHelper input_data(data);
if (input_data.GetActualDimensionCount() != 2)
return false;
unsigned int width = input_data.GetWidth();
unsigned int height = input_data.GetHeight();
_func(GetDataArray<T>(data), width, height);
Feed(L"Output", data);
return true;
}
virtual IProcessor * Clone() override
{
return new (std::nothrow) Algorithm2DInPlaceWrapper<T>(*this);
}
protected:
ProcessingFunc _func;
};
}
#endif // Algorithm2DWrapper_h__
|
//
// Copyright (c) 2008-2022 the Urho3D project.
//
// 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 "XmlAnalyzer.h"
#include <map>
#include <stdexcept>
#include <string>
namespace ASBindingGenerator
{
enum class TypeUsage
{
FunctionParameter = 0,
FunctionReturn,
StaticField,
Field,
};
struct ConvertedVariable
{
std::string asDeclaration_;
std::string cppDeclaration_;
std::string glue_;
bool NeedWrapper() const { return !glue_.empty(); }
};
std::string JoinASDeclarations(const std::vector<ConvertedVariable>& vars);
enum class VariableUsage
{
FunctionParameter = 0,
FunctionReturn,
StaticField,
Field,
};
ConvertedVariable CppVariableToAS(const TypeAnalyzer& type, VariableUsage usage, const std::string& name = "", const std::string& defaultValue = "");
std::string CppTypeToAS(const TypeAnalyzer& type, TypeUsage typeUsage);
std::shared_ptr<EnumAnalyzer> FindEnum(const std::string& name);
std::string CppPrimitiveTypeToAS(const std::string& cppType);
std::string CppValueToAS(const std::string& cppValue);
class Exception : public std::runtime_error
{
using runtime_error::runtime_error;
};
bool IsKnownCppType(const std::string& name);
std::shared_ptr<ClassAnalyzer> FindClassByName(const std::string& name);
std::shared_ptr<ClassAnalyzer> FindClassByID(const std::string& name);
std::string GenerateWrapperName(const GlobalFunctionAnalyzer& functionAnalyzer);
std::string GenerateWrapperName(const ClassStaticFunctionAnalyzer& functionAnalyzer);
std::string GenerateWrapperName(const MethodAnalyzer& methodAnalyzer, bool templateVersion = false);
std::string GenerateWrapper(const GlobalFunctionAnalyzer& functionAnalyzer, const std::vector<ConvertedVariable>& convertedParams, const ConvertedVariable& convertedReturn);
std::string GenerateWrapper(const ClassStaticFunctionAnalyzer& functionAnalyzer, bool templateVersion, const std::vector<ConvertedVariable>& convertedParams, const ConvertedVariable& convertedReturn);
std::string GenerateWrapper(const MethodAnalyzer& methodAnalyzer, bool templateVersion, const std::vector<ConvertedVariable>& convertedParams, const ConvertedVariable& convertedReturn);
std::string GenerateConstructorWrapper(const MethodAnalyzer& methodAnalyzer, const std::vector<ConvertedVariable>& convertedParams);
std::string GenerateFactoryWrapper(const MethodAnalyzer& methodAnalyzer, const std::vector<ConvertedVariable>& convertedParams);
std::string Generate_asFUNCTIONPR(const GlobalFunctionAnalyzer& functionAnalyzer);
std::string Generate_asFUNCTIONPR(const ClassStaticFunctionAnalyzer& functionAnalyzer, bool templateVersion);
std::string Generate_asMETHODPR(const MethodAnalyzer& methodAnalyzer, bool templateVersion);
}
|
#pragma once
#ifndef EMANAGER_H
#define EMANAGER_H
#include "RManager.h"
#include "WorldUpdater.h"
#include "Game.h"
#include "WorldConstants.h"
#include "Features.h"
class EManager
{
public:
// Entities
static Entity *CreateEntity(EntityLayer pLayer, EntityType pType, int pX, int pY);
static void DeleteEntityAt(EntityLayer pLayer, int pX, int pY);
// Features
static bool IsEntityType(Entity &pEntity, EntityType pType);
static bool IsSurface(Entity &pEntity);
static bool IsWaterTile(Entity &pEntity);
static bool IsWaterTile(EntityType &pEntType);
static bool IsFitForTrees(Entity &pSurface);
static bool IsMountain(Entity &pSurface);
static bool IsHill(Entity &pSurface);
static bool IsFreshWaterTile(Entity &pSurface);
static bool IsLakeTile(Entity &pSurface);
static bool IsObject(Entity &pEntity);
static bool IsTree(Entity &pEntity);
static bool IsTree(EntityType &pEntType);
static bool IsBush(Entity &pEntity);
static bool IsBush(EntityType &pEntType);
static bool IsFlora(Entity &pEntity);
static bool IsNativeSurfForObj(EntityType pObjType, EntityType pSurfType);
static bool IsYoungTree(Entity &pEntity);
static bool IsAdultTree(Entity &pEntity);
static bool IsDeadTree(Entity &pEntity);
private:
static int m_nextId;
static void InitializeEntity(Entity &pEntity);
};
#endif // EMANAGER_H
|
/* -*-C-*-
********************************************************************************
*
* File: plotedges.h (Formerly plotedges.h)
* Description: Convert the various data type into line lists
* Author: Mark Seaman, OCR Technology
* Created: Fri Jul 28 13:14:48 1989
* Modified: Mon May 13 09:34:51 1991 (Mark Seaman) marks@hpgrlt
* Language: C
* Package: N/A
* Status: Experimental (Do Not Distribute)
*
* (c) Copyright 1989, Hewlett-Packard Company.
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
** http://www.apache.org/licenses/LICENSE-2.0
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*
*********************************************************************************/
#ifndef PLOTEDGES_H
#define PLOTEDGES_H
#include "callcpp.h"
#include "oldlist.h"
#include "tessclas.h"
#include "split.h"
/*----------------------------------------------------------------------
V a r i a b l e s
----------------------------------------------------------------------*/
extern ScrollView *edge_window; /* Window for edges */
/*----------------------------------------------------------------------
Macros
----------------------------------------------------------------------*/
/**********************************************************************
* update_edge_window
*
* Refresh the display of the edge window.
**********************************************************************/
#define update_edge_window() \
if (display_splits) { \
c_make_current (edge_window); \
} \
/**********************************************************************
* edge_window_wait
*
* Wait for someone to click in the edges window.
**********************************************************************/
#define edge_window_wait() \
if (display_splits) window_wait (edge_window)
/*----------------------------------------------------------------------
F u n c t i o n s
---------------------------------------------------------------------*/
void display_edgepts(LIST outlines);
void draw_blob_edges(TBLOB *blob);
void mark_outline(EDGEPT *edgept);
void mark_split(SPLIT *split);
#endif
|
//
// AppDelegate.h
// UIImageViewAniamtions
//
// Created by fangjiayou on 15/11/23.
// Copyright © 2015年 方. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
#pragma once
OC_NS_BG;
class Timer
{
public:
Timer();
// Total time in seconds (without paused duration)
float GetElapsed() const;
// Delta time between ticks in seconds
float GetDelta() const;
// Delta time between ticks in milliseconds
float GetDeltaMs() const;
void Start();
void Stop();
void Reset();
void Tick();
private:
double m_secondsPerCount;
double m_deltaTime;
int64 m_baseTime;
int64 m_pausedTime;
int64 m_stopTime;
int64 m_prevTime;
int64 m_currentTime;
bool m_stopped;
};
OC_NS_END; |
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "mbedtls/base64.h"
#include "mbedtls/md.h"
#define WRITE_HEX_DUMPS 1
#if WRITE_HEX_DUMPS
extern void hex_dump (FILE* f, void *addr, int len);
#define HEX_DUMP( ... ) hex_dump(stdout, __VA_ARGS__)
#endif
#define REQUEST_STRING_FORMAT "%s\n%u"
int32_t make_sas_signature(const char* audience, const uint8_t* device_key, uint8_t device_key_len, uint32_t expiry_time, uint8_t* result, size_t result_len, size_t* written_len) {
size_t decoded_len, request_len, hashed_len;
int32_t ret;
uint8_t *decoded, *request, *hashed_request;
mbedtls_md_context_t* md_ctx;
ret = mbedtls_base64_decode(NULL, 0, &decoded_len, device_key, device_key_len);
if (ret == MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL) decoded = malloc(decoded_len);
else return ret;
if (decoded == NULL) {
printf("Memory allocation failed\n");
goto closeup;
}
if ((ret = mbedtls_base64_decode(decoded, decoded_len, &decoded_len, device_key, device_key_len)) != 0)
goto closeup;
#if WRITE_HEX_DUMPS
printf("\n> decoded key: %d bytes\n", decoded_len);
HEX_DUMP(decoded, decoded_len);
#endif
request_len = snprintf(NULL, 0, REQUEST_STRING_FORMAT, audience, expiry_time);
request_len++;// allow for NULL character at the end
if ((request = malloc(request_len)) == NULL) {
printf("Memory allocation failed\n");
goto closeup;
}
request_len = snprintf((char*)request, request_len, REQUEST_STRING_FORMAT, audience, expiry_time);
#if WRITE_HEX_DUMPS
printf("\n> request: %d bytes\n", request_len);
HEX_DUMP(request, request_len);
#endif
if ((md_ctx = malloc(sizeof(mbedtls_md_context_t))) == NULL) {
printf("Memory allocation failed\n");
goto closeup;
}
mbedtls_md_init(md_ctx);
if ((ret = mbedtls_md_setup(md_ctx, mbedtls_md_info_from_type(MBEDTLS_MD_SHA256), 1)) != 0) {
printf("HMAC setup failed! returned %d (-0x%04x)\r\n", ret, -ret);
goto closeup;
}
if ((ret = mbedtls_md_hmac_starts(md_ctx, decoded, decoded_len)) != 0) {
printf("HMAC starts failed! returned %d (-0x%04x)\r\n", ret, -ret);
goto closeup;
}
if ((ret = mbedtls_md_hmac_update(md_ctx, request, request_len)) != 0) {
printf("HMAC update failed! returned %d (-0x%04x)\r\n", ret, -ret);
goto closeup;
}
if ((hashed_request = malloc(request_len + decoded_len)) == NULL) {
printf("Memory allocation failed\n");
goto closeup;
}
if ((ret = mbedtls_md_hmac_finish(md_ctx, hashed_request)) != 0) {
printf("HMAC update failed! returned %d (-0x%04x)\r\n", ret, -ret);
goto closeup;
}
hashed_len = strlen((const char*)hashed_request);
#if WRITE_HEX_DUMPS
printf("\n> hashed request: %d bytes\n", hashed_len);
HEX_DUMP(hashed_request, hashed_len);
#endif
if ((ret = mbedtls_base64_encode(result, result_len, written_len, hashed_request, hashed_len)) != 0) {
printf("Encoding device key failed! returned %d (-0x%04x)\r\n", ret, -ret);
goto closeup;
}
#if WRITE_HEX_DUMPS
printf("\n> result: %d bytes\n", *written_len);
HEX_DUMP(result, *written_len);
#endif
closeup:
mbedtls_md_free(md_ctx);
if (decoded) free(decoded);
if (request) free(request);
if (md_ctx) free(md_ctx);
if (hashed_request) free(hashed_request);
return ret;
}
|
// TODO: organize these: I'm getting a migraine header-ache!
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <limits.h>
#include <errno.h>
#include <err.h>
#include <netdb.h>
#include <dirent.h>
#include <pwd.h>
#include <magic.h>
#include <grp.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
static int serve_dir(int, const char *);
static int serve_file(int, const char *);
static int service(int);
//static int daemonize();
static int init_socket();
static int drop_privileges();
static const char denied[] = "3Permission denied for requested resource\n.\n";
static const char notfound[] = "3Requested resource was not found\n.\n";
static const char srverror[] = "3Server error: failed to access requested resource\n.\n";
static const char _docroot[] = "/srv/gopher/";
static const char *docroot = _docroot;
static const char _host[] = "localhost";
static const char *host = _host;
static const char *type_map[] = {
"h text/html",
"0 text/",
"g image/gif",
"I image/",
"s audio/",
"d application/pdf",
/* use 9="binary" as a catch all for anything else */
"9 "
};
int serve_dir(int wfd, const char *path) {
/* if "gophermap" exits, serve that instead of the dir listing: */
if (chdir(path) < 0) {
write(wfd, srverror, sizeof(srverror));
warn("chdir [path=\"%s\"", path);
return 1;
}
if (access("gophermap", R_OK) == 0)
return serve_file(wfd, "gophermap");
/* no "gophermap", create a dir listing: */
DIR *dir;
struct dirent *de;
struct stat info;
char type;
const char *mime, *match;
magic_t m;
int i;
/* open dir, init libmagic, read magic db - return error on any failure: */
if (!(dir=opendir(path)) || !(m=magic_open(MAGIC_MIME)) || magic_load(m, NULL)) {
if (m) magic_close(m);
write(wfd, srverror, sizeof(srverror));
return 1;
}
// TODO include a ".." item?
// -> append "/.." to path and put through realpath?
// or strrchr for last "/" and trim?
while ((de=readdir(dir))) {
if (de->d_name[0] == '.') continue;
if (stat(de->d_name, &info) < 0) continue;
if (S_ISDIR(info.st_mode)) type = '1';
else if (S_ISREG(info.st_mode)) {
/* not a subdir, so get type from libmagic and type_map: */
mime = magic_file(m, de->d_name);
for (i = 0; i < sizeof(type_map)/sizeof(type_map[0]); ++i) {
match = &type_map[i][2];
type = type_map[i][0];
if (strncmp(match, mime, strlen(match)) == 0) break;
}
}
else continue;
/* print gopher line: */
dprintf(wfd, "%c%s\t%s/%s\t%s\t70\n", type, de->d_name, path, de->d_name, host);
}
magic_close(m);
return 0;
}
int serve_file(int wfd, const char *path) {
int rfd = open(path, O_RDONLY);
if (!rfd) {
write(wfd, srverror, sizeof(srverror));
close(wfd);
err(1, "serve_file");
}
int n;
char buf[256];
while ((n=read(rfd,buf,255)) > 0)
if (write(wfd, buf, n) < 0) err(10, "serve_file");
if (n < 0)
err(2, "serve_file");
return 0;
}
int service(int fd) {
int n;
char path[256], *ptr;
memset(path, 0, 256);
path[0] = '/';
if ((n=read(fd,path+1,254)) < 0)
err(3, "read");
if ((ptr=strpbrk(path,"\t\r\n"))) *ptr = 0;
struct stat info;
if (stat(path, &info) != 0) {
write(fd, notfound, sizeof(notfound));
warn("service");
}
else if (S_ISDIR(info.st_mode)) serve_dir(fd, path);
else if (S_ISREG(info.st_mode)) serve_file(fd, path);
else write(fd, denied, sizeof(denied));
close(fd);
return 0;
}
/*
* Old habits die hard ... but this shouldn't be needed
int daemonize() {
int pid;
if ((pid=fork()) < 0) error(1, errno, "daemonize");
if (pid) exit(0);
if (setsid() < 0) error(1, errno, "daemonize");
signal(SIGCHLD, SIG_IGN);
signal(SIGHUP, SIG_IGN);
if ((pid=fork()) < 0) error(1, errno, "daemonize");
if (pid) exit(0);
chdir(docroot);
return 0;
}
*/
int init_socket() {
int fd;
struct sockaddr_in serv_addr;
if ((fd=socket(AF_INET, SOCK_STREAM, 0)) < 0)
err(3,"socket");
memset(&serv_addr, 0, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = INADDR_ANY;
serv_addr.sin_port = htons(70);
if (bind(fd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0)
err(4,"bind");
listen(fd, 5); // TODO why 5?
return fd;
}
int drop_privileges() {
// TODO create gopher user + group, then replace "http" with "gopher"
#warning The method of dropping root privileges needs 3rd party review before it should be considered safe.
#warning The user and group "http" will currently be used to serve files, this will change to "gopher" in an upcoming revision.
struct passwd *pw;
if ( !(pw=getpwnam("http")) ||
chdir(docroot) ||
chroot(docroot) ||
setgid(pw->pw_gid) ||
initgroups(pw->pw_name, pw->pw_gid) ||
setuid(pw->pw_uid) )
err(6,"drop");
return 0;
}
static int running = 1;
static void signal_handler(int sig) {
running = 0;
}
int main(int argc, const char **argv) {
/* TODO make args[] more flexible ... */
// if (argc != 3) return 1;
// host = argv[1];
// docroot = argv[2];
if (getuid() != 0)
err(7,"must be run as root");
//daemonize();
int fd = init_socket();
drop_privileges();
/* load signal handler */
struct sigaction sa;
sa.sa_handler = signal_handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART;
//if (sigaction(SIGINT, &sa, NULL) < 0) error(1, errno, "signal_handler");
//if (sigaction(SIGTERM, &sa, NULL) < 0) error(1, errno, "signal_handler");
/* listen for connections */
int client, pid;
while (running) {
/* fork to service each incoming connection: */
if ((client=accept(fd,NULL,NULL)) < 0) err(8, "accept");
if ((pid=fork()) < 0) err(9, "fork");
if (pid == 0) {
close(fd);
service(client);
exit(0);
}
else {
close(client);
}
}
close(fd);
return 0;
}
|
//===--------------------------------------------------------------------------------*- C++ -*-===//
// _
// | |
// __| | __ ___ ___ ___
// / _` |/ _` \ \ /\ / / '_ |
// | (_| | (_| |\ V V /| | | |
// \__,_|\__,_| \_/\_/ |_| |_| - Compiler Toolchain
//
//
// This file is distributed under the MIT License (MIT).
// See LICENSE.txt for details.
//
//===------------------------------------------------------------------------------------------===//
#pragma once
#include "dawn/AST/ASTExpr.h"
#include "dawn/AST/LocationType.h"
#include "dawn/AST/Value.h"
#include "dawn/IIR/ASTExpr.h"
#include "dawn/IIR/ASTStmt.h"
#include "dawn/IIR/Field.h"
#include "dawn/Support/Type.h"
#include <memory>
namespace dawn {
namespace astgen {
#define EXPR_CONSTRUCTOR_ALIAS(alias, expr) \
template <typename... Args> \
decltype(auto) alias(Args&&... args) { \
return std::make_shared<expr>(std::forward<Args>(args)...); \
}
#define STMT_CONSTRUCTOR_ALIAS(alias, maker) \
template <typename... Args> \
decltype(auto) alias(Args&&... args) { \
return maker(std::forward<Args>(args)...); \
}
STMT_CONSTRUCTOR_ALIAS(expr, iir::makeExprStmt)
STMT_CONSTRUCTOR_ALIAS(ifstmt, iir::makeIfStmt)
EXPR_CONSTRUCTOR_ALIAS(assign, ast::AssignmentExpr)
EXPR_CONSTRUCTOR_ALIAS(binop, ast::BinaryOperator)
EXPR_CONSTRUCTOR_ALIAS(var, ast::VarAccessExpr)
EXPR_CONSTRUCTOR_ALIAS(field, ast::FieldAccessExpr)
EXPR_CONSTRUCTOR_ALIAS(lit, ast::LiteralAccessExpr)
EXPR_CONSTRUCTOR_ALIAS(red, ast::ReductionOverNeighborExpr)
template <typename... Stmts>
decltype(auto) block(Stmts&&... stmts) {
return iir::makeBlockStmt(std::vector<std::shared_ptr<ast::Stmt>>{std::move(stmts)...});
}
inline decltype(auto) vardecl(const std::string& name, BuiltinTypeID type = BuiltinTypeID::Float) {
return iir::makeVarDeclStmt(Type(type), name, 0, "=", ast::VarDeclStmt::InitList{});
}
template <typename T>
decltype(auto) lit(T&& value) {
return std::make_shared<dawn::ast::LiteralAccessExpr>(
std::to_string(std::forward<T>(value)),
dawn::ast::Value::typeToBuiltinTypeID(
dawn::ast::Value::TypeInfo<typename std::decay<T>::type>::Type));
}
inline decltype(auto) red(const std::shared_ptr<ast::Expr> rhs,
std::vector<std::shared_ptr<ast::Expr>> weights,
std::vector<ast::LocationType> chain) {
return iir::makeReductionOverNeighborExpr("+", rhs, lit(0.), weights, chain);
}
template <typename... Args>
decltype(auto) global(Args&&... args) {
auto expr = var(std::forward<Args>(args)...);
expr->setIsExternal(true);
return expr;
}
} // namespace astgen
} // namespace dawn
|
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include <vector>
#include <algorithm>
#include <omp.h>
#include <queue>
#include "FlyCapture2.h"
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/video.hpp>
#include "fmfwriter.h"
#include "pgrcam.h"
#include "readerwriterqueue.h"
// TODO: reference additional headers your program requires here
|
//
// routesTests.h
// routesTests
//
// Created by Diego Lafuente on 26/08/13.
// Copyright (c) 2013 Tui Travel A&D. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface routesTests : SenTestCase
@end
|
//
// CKNotification.h
// CloudKit
//
// Copyright (c) 2014 Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CloudKit/CKRecord.h>
@class CKRecordID, CKRecordZoneID;
NS_ASSUME_NONNULL_BEGIN
NS_CLASS_AVAILABLE(10_10, 8_0)
@interface CKNotificationID : NSObject <NSCopying, NSSecureCoding>
@end
typedef NS_ENUM(NSInteger, CKNotificationType) {
CKNotificationTypeQuery = 1,
CKNotificationTypeRecordZone = 2,
CKNotificationTypeReadNotification = 3, /* Indicates a notification that a client had previously marked as read. */
} NS_ENUM_AVAILABLE(10_10, 8_0);
NS_CLASS_AVAILABLE(10_10, 8_0)
@interface CKNotification : NSObject
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)notificationFromRemoteNotificationDictionary:(NSDictionary <NSString *, NSObject *> *)notificationDictionary;
/* When you instantiate a CKNotification from a remote notification dictionary, you will get back a concrete
subclass defined below. Use the type of notification to avoid -isKindOfClass: checks */
@property (nonatomic, readonly, assign) CKNotificationType notificationType;
@property (nonatomic, readonly, copy, nullable) CKNotificationID *notificationID;
@property (nonatomic, readonly, copy, nullable) NSString *containerIdentifier;
/* push notifications have a limited size. In some cases, CloudKit servers may not be able to send you a full
CKNotification's worth of info in one push. In those cases, isPruned returns YES. The order in which we'll
drop properties is defined in each CKNotification subclass below.
The CKNotification can be obtained in full via a CKFetchNotificationChangesOperation */
@property (nonatomic, readonly, assign) BOOL isPruned;
/* These keys are parsed out of the 'aps' payload from a remote notification dictionary.
On tvOS, alerts, badges, sounds, and categories are not handled in push notifications. */
/* Optional alert string to display in a push notification. */
@property (nonatomic, readonly, copy, nullable) NSString *alertBody __TVOS_PROHIBITED;
/* Instead of a raw alert string, you may optionally specify a key for a localized string in your app's Localizable.strings file. */
@property (nonatomic, readonly, copy, nullable) NSString *alertLocalizationKey __TVOS_PROHIBITED;
/* A list of field names to take from the matching record that is used as substitution variables in a formatted alert string. */
@property (nonatomic, readonly, copy, nullable) NSArray <NSString *> *alertLocalizationArgs __TVOS_PROHIBITED;
/* A key for a localized string to be used as the alert action in a modal style notification. */
@property (nonatomic, readonly, copy, nullable) NSString *alertActionLocalizationKey __TVOS_PROHIBITED;
/* The name of an image in your app bundle to be used as the launch image when launching in response to the notification. */
@property (nonatomic, readonly, copy, nullable) NSString *alertLaunchImage __TVOS_PROHIBITED;
/* The number to display as the badge of the application icon */
@property (nonatomic, readonly, copy, nullable) NSNumber *badge __TVOS_PROHIBITED;
/* The name of a sound file in your app bundle to play upon receiving the notification. */
@property (nonatomic, readonly, copy, nullable) NSString *soundName __TVOS_PROHIBITED;
/* The ID of the subscription that caused this notification to fire */
@property (nonatomic, readonly, copy, nullable) NSString *subscriptionID NS_AVAILABLE(10_11, 9_0);
/* The category for user-initiated actions in the notification */
@property (nonatomic, readonly, copy, nullable) NSString *category NS_AVAILABLE(10_11, 9_0) __TVOS_PROHIBITED;
@end
/* notificationType == CKNotificationTypeQuery
When properties must be dropped (see isPruned), here's the order of importance. The most important properties are first,
they'll be the last ones to be dropped.
- notificationID
- badge
- alertLocalizationKey
- alertLocalizationArgs
- alertBody
- alertActionLocalizationKey
- alertLaunchImage
- soundName
- desiredKeys
- queryNotificationReason
- recordID
- containerIdentifier
*/
typedef NS_ENUM(NSInteger, CKQueryNotificationReason) {
CKQueryNotificationReasonRecordCreated = 1,
CKQueryNotificationReasonRecordUpdated,
CKQueryNotificationReasonRecordDeleted,
} NS_ENUM_AVAILABLE(10_10, 8_0);
NS_CLASS_AVAILABLE(10_10, 8_0)
@interface CKQueryNotification : CKNotification
@property (nonatomic, readonly, assign) CKQueryNotificationReason queryNotificationReason;
/* A set of key->value pairs for creates and updates. You request the server fill out this property via the
"desiredKeys" property of CKNotificationInfo */
@property (nonatomic, readonly, copy, nullable) NSDictionary <NSString *, __kindof id <CKRecordValue>> *recordFields;
@property (nonatomic, readonly, copy, nullable) CKRecordID *recordID;
/* If YES, this record is in the public database. Else, it's in the private database */
@property (nonatomic, readonly, assign) BOOL isPublicDatabase;
@end
/* notificationType == CKNotificationTypeRecordZone
When properties must be dropped (see isPruned), here's the order of importance. The most important properties are first,
they'll be the last ones to be dropped.
- notificationID
- badge
- alertLocalizationKey
- alertLocalizationArgs
- alertBody
- alertActionLocalizationKey
- alertLaunchImage
- soundName
- recordZoneID
- containerIdentifier
*/
NS_CLASS_AVAILABLE(10_10, 8_0)
@interface CKRecordZoneNotification : CKNotification
@property (nonatomic, readonly, copy, nullable) CKRecordZoneID *recordZoneID;
@end
NS_ASSUME_NONNULL_END |
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2016, Intel Corporation
// 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 changes (yyyy-mm-dd)
// 2016-09-07: filip.strugar@intel.com: first commit (extracted from VertexAsylum codebase, 2006-2016 by Filip Strugar)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "Core/System/vaStream.h"
struct _iobuf;
typedef struct _iobuf FILE;
namespace VertexAsylum
{
typedef HANDLE vaPlatformFileStreamType;
}
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
UTProgress.h
The MIT License (MIT)
Copyright (c) 2014 Gregory Maksyuk (GregoryMaks)
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.
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#import <Foundation/Foundation.h>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface
// Serves as copy of Apple NSProgress but with some enhancements and also some minor issues
@interface UTProgress : NSObject
@property (nonatomic, assign) NSUInteger totalUnitCount;
@property (nonatomic, assign) NSUInteger completedUnitCount;
@property (nonatomic, weak) NSString *bubblingMessage; ///< message that bubbles up to root progress bar
@property (nonatomic, weak) NSString *developerBubblingMessage; ///< message intended for dev usage (bubbles up)
/// KVO observable property
@property (nonatomic, assign, readonly) float fractionCompleted;
+ (instancetype)rootProgressWithTotalUnitCount:(NSUInteger)aTotalUnitCount;
+ (instancetype)progressWithParent:(UTProgress *)aParent totalUnitCount:(NSUInteger)aTotalUnitCount;
/// @param aParent can be nil or parent progress set as current prior to calling this method
- (id)initWithParent:(UTProgress *)aParent totalUnitCount:(NSUInteger)aTotalUnitCount;
/// Becomes progress to which child progresses can be added
- (void)becomeCurrentWithPendingUnitCount:(NSUInteger)aPendingUnitCount;
- (void)resignCurrent;
/// Can be called to mark progress as 100% completed
- (void)completeProgress;
@end
|
# /* ********************************************************************
# * *
# * (C) Copyright Paul Mensonides 2003-2005. *
# * *
# * Distributed under the Boost Software License, Version 1.0. *
# * (See accompanying file LICENSE). *
# * *
# * See http://chaos-pp.sourceforge.net for most recent version. *
# * *
# ******************************************************************** */
#
# ifndef CHAOS_PREPROCESSOR_SEQ_AUTO_FOR_EACH_H
# define CHAOS_PREPROCESSOR_SEQ_AUTO_FOR_EACH_H
#
# include <chaos/preprocessor/cat.h>
# include <chaos/preprocessor/config.h>
# include <chaos/preprocessor/lambda/ops.h>
# include <chaos/preprocessor/recursion/expr.h>
# include <chaos/preprocessor/recursion/higher_order.h>
# include <chaos/preprocessor/seq/for_each.h>
#
# /* CHAOS_PP_SEQ_AUTO_FOR_EACH */
#
# if CHAOS_PP_VARIADICS
# define CHAOS_PP_SEQ_AUTO_FOR_EACH CHAOS_PP_CAT(CHAOS_IP_SEQ_AUTO_FOR_EACH_, CHAOS_PP_HIGHER_ORDER())
# define CHAOS_PP_SEQ_AUTO_FOR_EACH_ID() CHAOS_PP_SEQ_AUTO_FOR_EACH
# define CHAOS_PP_SEQ_AUTO_FOR_EACH_ CHAOS_PP_LAMBDA(CHAOS_PP_SEQ_AUTO_FOR_EACH_ID)()
# endif
#
# if CHAOS_PP_VARIADICS
# define CHAOS_IP_SEQ_AUTO_FOR_EACH_1(...) CHAOS_PP_HIGHER_ORDER(1)(, CHAOS_PP_EXPR(CHAOS_PP_SEQ_FOR_EACH(__VA_ARGS__)))
# define CHAOS_IP_SEQ_AUTO_FOR_EACH_2(...) CHAOS_PP_HIGHER_ORDER(2)(, CHAOS_PP_EXPR(CHAOS_PP_SEQ_FOR_EACH(__VA_ARGS__)))
# define CHAOS_IP_SEQ_AUTO_FOR_EACH_3(...) CHAOS_PP_HIGHER_ORDER(3)(, CHAOS_PP_EXPR(CHAOS_PP_SEQ_FOR_EACH(__VA_ARGS__)))
# define CHAOS_IP_SEQ_AUTO_FOR_EACH_4(...) CHAOS_PP_HIGHER_ORDER(4)(, CHAOS_PP_EXPR(CHAOS_PP_SEQ_FOR_EACH(__VA_ARGS__)))
# define CHAOS_IP_SEQ_AUTO_FOR_EACH_5(...) CHAOS_PP_HIGHER_ORDER(5)(, CHAOS_PP_EXPR(CHAOS_PP_SEQ_FOR_EACH(__VA_ARGS__)))
# define CHAOS_IP_SEQ_AUTO_FOR_EACH_6(...) CHAOS_PP_HIGHER_ORDER(6)(, CHAOS_PP_EXPR(CHAOS_PP_SEQ_FOR_EACH(__VA_ARGS__)))
# define CHAOS_IP_SEQ_AUTO_FOR_EACH_7(...) CHAOS_PP_HIGHER_ORDER(7)(, CHAOS_PP_EXPR(CHAOS_PP_SEQ_FOR_EACH(__VA_ARGS__)))
# define CHAOS_IP_SEQ_AUTO_FOR_EACH_8(...) CHAOS_PP_HIGHER_ORDER(8)(, CHAOS_PP_EXPR(CHAOS_PP_SEQ_FOR_EACH(__VA_ARGS__)))
# endif
#
# endif
|
#include <sys/compiler.h>
#include <sys/log.h>
#include <sys/types.h>
#include <sys/ldr.h>
#include <stdlib.h>
#include <stdio.h>
int
dladdr(void* s, Dl_info* i)
{
size_t bufSize = 40960;
struct ld_info* ldi;
void *buf;
int r;
debug4("sym at %lu", (ulong)s);
buf = (void *)malloc(bufSize);
if (!buf) {
i->dli_fname = 0;
return 0;
}
r = loadquery((int)L_GETINFO, buf, (int)bufSize);
if (r == -1) {
i->dli_fname = 0;
return 0;
}
do {
ldi = (struct ld_info*)buf;
debug4("checking %s, text %lu - %lu\n", ldi->ldinfo_filename,
(ulong)ldi->ldinfo_textorg,
(ulong)(ldi->ldinfo_textorg + ldi->ldinfo_textsize));
if ((ldi->ldinfo_textorg <= s) &&
(s < (ldi->ldinfo_textorg + ldi->ldinfo_textsize))) {
i->dli_fname = ldi->ldinfo_filename;
return 1;
}
buf += ldi->ldinfo_next;
} while (ldi->ldinfo_next);
i->dli_fname = 0;
return 0;
}
|
#include <SFML/Audio/Music.h>
void sfMusic_getDuration_helper (const sfMusic* music, sfTime* time)
{
*time = sfMusic_getDuration (music);
}
void sfMusic_getPlayingOffset_helper (const sfMusic* music, sfTime* time)
{
*time = sfMusic_getPlayingOffset (music);
}
void sfMusic_setPosition_helper (sfMusic* music, sfVector3f* position)
{
sfMusic_setPosition (music, *position);
}
void sfMusic_getPosition_helper (const sfMusic* music, sfVector3f* position)
{
*position = sfMusic_getPosition (music);
}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
/*
* =====================================================================================
*
* Filename: main.c
*
* Description: A basic little battle game, where you fight a bunch of enemies.
*
* Version: 1.0
* Created: 11/7/2014 5:36:01 PM
* Revision: none
* Compiler: gcc
*
* Author: Sapein (CC),
* Organization:
*
* =====================================================================================
*/
int main(){
//These are the variables, gameOn and battleOn are Psuedo-Booleans as 1 is True and 0 is False. Others are stats, names, formulas or input.
int x;
int playerHP, playerDef, playerAtk;
int enemyHP, enemyDef, enemyAtk;
int gameOn, battleOn;
int playerDamage, enemyDamage;
char playerName[200];
gameOn = 1;
while(gameOn == 1){
//Sets the value for Player's Stats
playerHP = 10;
playerDef = 0;
playerAtk = 3;
/* sets the value for the enemy's stats */
enemyHP = 5;
enemyDef = 0;
enemyAtk = 0;
printf("BattleArena v1.0 alpha ----- Sapein\n");
printf("Welcome to the Battle Arena!\n");
printf("Please insert your name to get started\n");
fgets(playerName, 200, stdin);
//This mainly clears the name of the newline marking
for(x = 0; x <= sizeof(playerName); x++){
if(playerName[x] == '\n'){
playerName[x] = '\0';
}
}
printf("Hello %s\n", playerName);
printf("Beggining Game...\n");
enemyDamage = enemyHP - playerAtk;
battleOn = 1;
/* The game begins */
while(battleOn == 1){
char playerInput[40];
playerInput == "";
printf("///////////////////////////////////////\n");
printf("%s - HP: %d Atk: %d Def: %d\n", playerName, playerHP, playerAtk, playerDef);
printf("Enemy = HP: %d Atk: %d Def %d\n", enemyHP, enemyAtk, enemyDef);
printf("//////////////////////////////////////\n");
printf("\n");
printf("What would you like to do?\n");
printf("1. Attack\n");
/* printf("2. Defend\n"); */
printf("2. Exit\n");
for(x = 0; x <= sizeof(playerInput) + 1; x++){
if(playerInput[x] == '\n'){
playerInput[x] = '\0';
}
}
fgets(playerInput, 40, stdin);
/* Down below simply checks user-input and sees if it machtes the predetermined inputs */
if(strcmp(playerInput, "1\n") == 0 || strcmp(playerInput, "Attk\n") == 0 || strcmp(playerInput, "Attack\n") == 0 || strcmp(playerInput, "attack\n") == 0 || strcmp(playerInput, "atk\n") == 0 || strcmp(playerInput, "atk\n") == 0 || strcmp(playerInput, "Atk\n") == 0){
enemyHP = enemyDamage;
printf("You attacked the Enemy!\n");
if(enemyHP <= 0){
enemyHP = 0;
printf("You Win! Summoning next Monster!\n");
}
}
else if(strcmp(playerInput, "2\n") == 0 || strcmp(playerInput, "exit\n") || strcmp(playerInput, "Exit\n") == 0 || strcmp(playerInput, "ext\n") == 0 || strcmp(playerInput, "Ext\n") == 0){
battleOn = 0;
gameOn = 0;
}
else{
printf("Input Unknown!\n");
}
}
}
return 0;
}
|
/*
* Created by suemi on 2016/12/7.
*/
#ifndef SLOG_CONFIGURATION_H
#define SLOG_CONFIGURATION_H
#include <string>
#include <unordered_map>
#include <memory>
#include "slog/utils/properties.h"
namespace slog {
class Filter;
class Logger;
class Appender;
class Layout;
class LogScheduler;
class Configurator {
public:
using LoggerPtr = std::shared_ptr<Logger>;
using FilterPtr = std::shared_ptr<Filter>;
using AppenderPtr = std::shared_ptr<Appender>;
using LayoutPtr = std::shared_ptr<Layout>;
using SchedulerPtr = std::shared_ptr<LogScheduler>;
using LoggerMap = std::unordered_map<std::string,LoggerPtr>;
using AppenderMap = std::unordered_map<std::string,AppenderPtr>;
std::string config_file_;
public:
Configurator(const std::string &file_path);
virtual void Configure() = 0;
virtual LoggerMap &loggers() = 0;
virtual AppenderMap &appenders() = 0;
virtual SchedulerPtr scheduler() = 0;
virtual LoggerPtr root_logger() = 0;
virtual void Reset() = 0;
};
class PropertyConfigurator : public Configurator {
public:
PropertyConfigurator(const std::string& file_path);
PropertyConfigurator(const Properties& properties);
PropertyConfigurator(std::istream& prop_stream);
virtual void Configure() override;
virtual void Reset() override;
virtual LoggerMap &loggers() override;
virtual AppenderMap &appenders() override;
virtual SchedulerPtr scheduler() override;
virtual LoggerPtr root_logger() override;
private:
void Init();
void ConfigureLoggers();
void ConfigureAppenders();
void ConfigureScheduler();
std::vector<std::string> LoggerNames(const Properties& prop) const;
std::unordered_map<std::string,std::string> AppenderNames(const Properties& prop) const;
void ConfigureLogger(LoggerPtr logger, const Properties& prop);
LoggerMap loggers_;
AppenderMap appenders_;
SchedulerPtr scheduler_;
LoggerPtr root_logger_;
Properties prop_;
};
}
#endif
|
//
// GDTUnifiedNativeAdView.h
// GDTMobSDK
//
// Created by nimomeng on 2018/10/10.
// Copyright © 2018 Tencent. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GDTLogoView.h"
#import "GDTMediaView.h"
#import "GDTUnifiedNativeAdDataObject.h"
#import "GDTSDKDefines.h"
@class GDTUnifiedNativeAdView;
//视频广告时长Key
extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration;
@protocol GDTUnifiedNativeAdViewDelegate <NSObject>
@optional
/**
广告曝光回调
@param unifiedNativeAdView GDTUnifiedNativeAdView 实例
*/
- (void)gdt_unifiedNativeAdViewWillExpose:(GDTUnifiedNativeAdView *)unifiedNativeAdView;
/**
广告点击回调
@param unifiedNativeAdView GDTUnifiedNativeAdView 实例
*/
- (void)gdt_unifiedNativeAdViewDidClick:(GDTUnifiedNativeAdView *)unifiedNativeAdView;
/**
广告详情页关闭回调
@param unifiedNativeAdView GDTUnifiedNativeAdView 实例
*/
- (void)gdt_unifiedNativeAdDetailViewClosed:(GDTUnifiedNativeAdView *)unifiedNativeAdView;
/**
当点击应用下载或者广告调用系统程序打开时调用
@param unifiedNativeAdView GDTUnifiedNativeAdView 实例
*/
- (void)gdt_unifiedNativeAdViewApplicationWillEnterBackground:(GDTUnifiedNativeAdView *)unifiedNativeAdView;
/**
广告详情页面即将展示回调
@param unifiedNativeAdView GDTUnifiedNativeAdView 实例
*/
- (void)gdt_unifiedNativeAdDetailViewWillPresentScreen:(GDTUnifiedNativeAdView *)unifiedNativeAdView;
/**
视频广告播放状态更改回调
@param nativeExpressAdView GDTUnifiedNativeAdView 实例
@param status 视频广告播放状态
@param userInfo 视频广告信息
*/
- (void)gdt_unifiedNativeAdView:(GDTUnifiedNativeAdView *)unifiedNativeAdView playerStatusChanged:(GDTMediaPlayerStatus)status userInfo:(NSDictionary *)userInfo;
@end
@interface GDTUnifiedNativeAdView:UIView
/**
绑定的数据对象
*/
@property (nonatomic, strong, readonly) GDTUnifiedNativeAdDataObject *dataObject;
/**
视频广告的媒体View,绑定数据对象后自动生成,可自定义布局
*/
@property (nonatomic, strong, readonly) GDTMediaView *mediaView;
/**
腾讯广告 LogoView,自动生成,可自定义布局
*/
@property (nonatomic, strong, readonly) GDTLogoView *logoView;
/**
广告 View 时间回调对象
*/
@property (nonatomic, weak) id<GDTUnifiedNativeAdViewDelegate> delegate;
/*
* viewControllerForPresentingModalView
* 详解:开发者需传入用来弹出目标页的ViewController,一般为当前ViewController
*/
@property (nonatomic, weak) UIViewController *viewController;
/**
自渲染2.0视图注册方法
@param dataObject 数据对象,必传字段
@param clickableViews 可点击的视图数组,此数组内的广告元素才可以响应广告对应的点击事件
*/
- (void)registerDataObject:(GDTUnifiedNativeAdDataObject *)dataObject
clickableViews:(NSArray<UIView *> *)clickableViews;
/**
注册可点击的callToAction视图的方法
建议开发者使用GDTUnifiedNativeAdDataObject中的callToAction字段来创建视图,并取代自定义的下载或打开等button,
调用此方法之前必须先调用registerDataObject:clickableViews
@param callToActionView CTA视图, 系统自动处理点击事件
*/
- (void)registerClickableCallToActionView:(UIView *)callToActionView;
/**
注销数据对象,在 tableView、collectionView 等场景需要复用 GDTUnifiedNativeAdView 时,
需要在合适的时机,例如 cell 的 prepareForReuse 方法内执行 unregisterDataObject 方法,
将广告对象与 GDTUnifiedNativeAdView 解绑,具体可参考示例 demo 的 UnifiedNativeAdBaseTableViewCell 类
*/
- (void)unregisterDataObject;
//#pragma mark - DEPRECATED
///**
// 此方法已经废弃
// 自渲染2.0视图注册方法
//
// @param dataObject 数据对象,必传字段
// @param logoView logo视图
// @param viewController 所在ViewController,必传字段。支持在register之后对其进行修改
// @param clickableViews 可点击的视图数组,此数组内的广告元素才可以响应广告对应的点击事件
// */
//- (void)registerDataObject:(GDTUnifiedNativeAdDataObject *)dataObject
// logoView:(GDTLogoView *)logoView
// viewController:(UIViewController *)viewController
// clickableViews:(NSArray<UIView *> *)clickableViews GDT_DEPRECATED_MSG_ATTRIBUTE("use registerDataObject:clickableViews: instead.");
//
//
///**
// 此方法已经废弃
// 自渲染2.0视图注册方法
//
// @param dataObject 数据对象,必传字段
// @param mediaView 媒体对象视图,此处放视频播放器的容器视图
// @param logoView logo视图
// @param viewController 所在ViewController,必传字段。支持在register之后对其进行修改
// @param clickableViews 可点击的视图数组,此数组内的广告元素才可以响应广告对应的点击事件
// */
//- (void)registerDataObject:(GDTUnifiedNativeAdDataObject *)dataObject
// mediaView:(GDTMediaView *)mediaView
// logoView:(GDTLogoView *)logoView
// viewController:(UIViewController *)viewController
// clickableViews:(NSArray<UIView *> *)clickableViews GDT_DEPRECATED_MSG_ATTRIBUTE("use registerDataObject:clickableViews: instead.");
@end
|
//
// LoginViewController.h
// StackOverFlowClient
//
// Created by Bradley Johnson on 5/11/15.
// Copyright (c) 2015 BPJ. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LoginViewController : UIViewController
@end
|
/*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_
#define MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_
#include <list>
#include <memory>
#include <unordered_map>
#include <vector>
#include BOSS_WEBRTC_U_api__optional_h //original-code:"api/optional.h"
#include BOSS_WEBRTC_U_modules__rtp_rtcp__include__rtp_receiver_h //original-code:"modules/rtp_rtcp/include/rtp_receiver.h"
#include BOSS_WEBRTC_U_modules__rtp_rtcp__include__rtp_rtcp_defines_h //original-code:"modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/rtp_receiver_strategy.h"
#include BOSS_WEBRTC_U_rtc_base__criticalsection_h //original-code:"rtc_base/criticalsection.h"
#include BOSS_WEBRTC_U_typedefs_h //original-code:"typedefs.h" // NOLINT(build/include)
namespace webrtc {
class RtpReceiverImpl : public RtpReceiver {
public:
// Callbacks passed in here may not be NULL (use Null Object callbacks if you
// want callbacks to do nothing). This class takes ownership of the media
// receiver but nothing else.
RtpReceiverImpl(Clock* clock,
RtpFeedback* incoming_messages_callback,
RTPPayloadRegistry* rtp_payload_registry,
RTPReceiverStrategy* rtp_media_receiver);
virtual ~RtpReceiverImpl();
int32_t RegisterReceivePayload(int payload_type,
const SdpAudioFormat& audio_format) override;
int32_t RegisterReceivePayload(const VideoCodec& video_codec) override;
int32_t DeRegisterReceivePayload(const int8_t payload_type) override;
bool IncomingRtpPacket(const RTPHeader& rtp_header,
const uint8_t* payload,
size_t payload_length,
PayloadUnion payload_specific) override;
bool GetLatestTimestamps(uint32_t* timestamp,
int64_t* receive_time_ms) const override;
uint32_t SSRC() const override;
int32_t CSRCs(uint32_t array_of_csrc[kRtpCsrcSize]) const override;
int32_t Energy(uint8_t array_of_energy[kRtpCsrcSize]) const override;
TelephoneEventHandler* GetTelephoneEventHandler() override;
std::vector<RtpSource> GetSources() const override;
const std::vector<RtpSource>& ssrc_sources_for_testing() const {
return ssrc_sources_;
}
const std::list<RtpSource>& csrc_sources_for_testing() const {
return csrc_sources_;
}
private:
void CheckSSRCChanged(const RTPHeader& rtp_header);
void CheckCSRC(const WebRtcRTPHeader& rtp_header);
int32_t CheckPayloadChanged(const RTPHeader& rtp_header,
const int8_t first_payload_byte,
bool* is_red,
PayloadUnion* payload);
void UpdateSources(const rtc::Optional<uint8_t>& ssrc_audio_level);
void RemoveOutdatedSources(int64_t now_ms);
Clock* clock_;
rtc::CriticalSection critical_section_rtp_receiver_;
RTPPayloadRegistry* const rtp_payload_registry_
RTC_PT_GUARDED_BY(critical_section_rtp_receiver_);
const std::unique_ptr<RTPReceiverStrategy> rtp_media_receiver_;
RtpFeedback* const cb_rtp_feedback_;
// SSRCs.
uint32_t ssrc_ RTC_GUARDED_BY(critical_section_rtp_receiver_);
uint8_t num_csrcs_ RTC_GUARDED_BY(critical_section_rtp_receiver_);
uint32_t current_remote_csrc_[kRtpCsrcSize] RTC_GUARDED_BY(
critical_section_rtp_receiver_);
// Sequence number and timestamps for the latest in-order packet.
rtc::Optional<uint16_t> last_received_sequence_number_
RTC_GUARDED_BY(critical_section_rtp_receiver_);
uint32_t last_received_timestamp_
RTC_GUARDED_BY(critical_section_rtp_receiver_);
int64_t last_received_frame_time_ms_
RTC_GUARDED_BY(critical_section_rtp_receiver_);
std::unordered_map<uint32_t, std::list<RtpSource>::iterator>
iterator_by_csrc_;
// The RtpSource objects are sorted chronologically.
std::list<RtpSource> csrc_sources_;
std::vector<RtpSource> ssrc_sources_;
};
} // namespace webrtc
#endif // MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_
|
//
// AppDelegate.h
// Lightroom Catalog Cleaner
//
// Created by Maxime Chaillou on 07/07/2015.
// Copyright (c) 2015 Maxime Chaillou. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@end
|
//
// ViewController.h
// TezButtonExample
//
// Created by Park Taesun on 2017. 2. 26..
// Copyright © 2017년 TezLab. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#pragma once
#include "config.h"
class POGLDeferredRenderContext;
class POGLDeferredUniform : public IPOGLUniform, public IPOGLSamplerState
{
public:
POGLDeferredUniform(const POGL_STRING& name, POGLDeferredRenderContext* context);
virtual ~POGLDeferredUniform();
void Flush();
public:
void SetInt32(POGL_INT32 a);
void SetInt32(POGL_INT32 a, POGL_INT32 b);
void SetInt32(POGL_INT32 a, POGL_INT32 b, POGL_INT32 c);
void SetInt32(POGL_INT32 a, POGL_INT32 b, POGL_INT32 c, POGL_INT32 d);
void SetInt32(POGL_INT32* ptr, POGL_UINT32 count);
void SetUInt32(POGL_UINT32 a);
void SetUInt32(POGL_UINT32 a, POGL_UINT32 b);
void SetUInt32(POGL_UINT32 a, POGL_UINT32 b, POGL_UINT32 c);
void SetUInt32(POGL_UINT32 a, POGL_UINT32 b, POGL_UINT32 c, POGL_UINT32 d);
void SetUInt32(POGL_UINT32* ptr, POGL_UINT32 count);
void SetFloat(POGL_FLOAT a);
void SetFloat(POGL_FLOAT a, POGL_FLOAT b);
void SetFloat(POGL_FLOAT a, POGL_FLOAT b, POGL_FLOAT c);
void SetFloat(POGL_FLOAT a, POGL_FLOAT b, POGL_FLOAT c, POGL_FLOAT d);
void SetFloat(POGL_FLOAT* ptr, POGL_UINT32 count);
void SetDouble(POGL_DOUBLE a);
void SetDouble(POGL_DOUBLE a, POGL_DOUBLE b);
void SetDouble(POGL_DOUBLE a, POGL_DOUBLE b, POGL_DOUBLE c);
void SetDouble(POGL_DOUBLE a, POGL_DOUBLE b, POGL_DOUBLE c, POGL_DOUBLE d);
void SetDouble(POGL_DOUBLE* ptr, POGL_UINT32 count);
void SetMatrix(const POGL_MAT4& mat4);
void SetVector2(const POGL_VECTOR2& vec);
void SetVector3(const POGL_VECTOR3& vec);
void SetVector4(const POGL_VECTOR4& vec);
void SetSize(const POGL_SIZE& size);
void SetRect(const POGL_RECT& rect);
IPOGLSamplerState* GetSamplerState();
void SetTexture(IPOGLTexture* texture);
void SetMinFilter(POGLMinFilter::Enum minFilter);
void SetMagFilter(POGLMagFilter::Enum magFilter);
void SetTextureWrap(POGLTextureWrap::Enum s, POGLTextureWrap::Enum t);
void SetTextureWrap(POGLTextureWrap::Enum s, POGLTextureWrap::Enum t, POGLTextureWrap::Enum r);
void SetCompareFunc(POGLCompareFunc::Enum compareFunc);
void SetCompareMode(POGLCompareMode::Enum compareMode);
private:
bool IsIntEquals(POGL_UINT32 a);
bool IsIntEquals(POGL_UINT32 a, POGL_UINT32 b);
bool IsIntEquals(POGL_UINT32 a, POGL_UINT32 b, POGL_UINT32 c);
bool IsIntEquals(POGL_UINT32 a, POGL_UINT32 b, POGL_UINT32 c, POGL_UINT32 d);
bool IsFloatEquals(POGL_FLOAT a);
bool IsFloatEquals(POGL_FLOAT a, POGL_FLOAT b);
bool IsFloatEquals(POGL_FLOAT a, POGL_FLOAT b, POGL_FLOAT c);
bool IsFloatEquals(POGL_FLOAT a, POGL_FLOAT b, POGL_FLOAT c, POGL_FLOAT d);
bool IsDoubleEquals(POGL_DOUBLE a);
bool IsDoubleEquals(POGL_DOUBLE a, POGL_DOUBLE b);
bool IsDoubleEquals(POGL_DOUBLE a, POGL_DOUBLE b, POGL_DOUBLE c);
bool IsDoubleEquals(POGL_DOUBLE a, POGL_DOUBLE b, POGL_DOUBLE c, POGL_DOUBLE d);
bool IsTextureEquals(IPOGLTexture* texture);
private:
POGL_STRING mName;
POGLDeferredRenderContext* mRenderContext;
POGL_UINT32 mInts[4];
POGL_FLOAT mFloats[4];
POGL_DOUBLE mDoubles[4];
POGL_UINT32 mCount;
IPOGLTexture* mTexture;
bool mAssigned;
};
|
#ifndef EXPORTABLETOLUA_H_
#define EXPORTABLETOLUA_H_
extern "C"
{
#include <lua-5.1/src/lua.h>
#include <lua-5.1/src/lualib.h>
#include <lua-5.1/src/lauxlib.h>
}
#include <luabind/luabind.hpp>
class ExportableToLua {
public:
ExportableToLua();
virtual ~ExportableToLua();
virtual void exportToLua(lua_State *myLuaState) = 0;
};
#endif /* EXPORTABLETOLUA_H_ */
|
//
// ROChartViewController.h
// whitewolfdemo
//
// This App has been generated using IBM Mobile UI Builder
//
#import "ROViewController.h"
#import "ROChartView.h"
#import "RODataDelegate.h"
@protocol ROChartViewDelegate <NSObject>
/**
* Configure serie at index
*
* @param index Index
*/
- (void)configureSeriesAtIndex:(NSInteger)index;
@end
@interface ROChartViewController : ROViewController <RODataDelegate>
/**
Chart view
*/
@property (nonatomic, strong) ROChartView *chartView;
/**
Chart type
*/
@property (nonatomic, assign) ROChartType chartType;
/**
Chart x axis
*/
@property (nonatomic, strong) ROChartSerie *xAxis;
/**
Chart serie 1
*/
@property (nonatomic, strong) ROChartSerie *serie1;
/**
Chart serie 2
*/
@property (nonatomic, strong) ROChartSerie *serie2;
/**
Chart serie 3
*/
@property (nonatomic, strong) ROChartSerie *serie3;
/**
Chart serie 4
*/
@property (nonatomic, strong) ROChartSerie *serie4;
/**
* Items to load
*/
@property (nonatomic, strong) NSArray *items;
/**
ROChartViewDelegate
*/
@property (nonatomic, weak) id<ROChartViewDelegate> chartViewDelegate;
@end
|
#ifndef COMPRESS_KEYWORD_ENCODING_H_
#define COMPRESS_KEYWORD_ENCODING_H_
#include "compression_algorithm.h"
///! CompressKeywordEncoding class
/*!
Keyword Encoding Compression algorithm implementation
*/
class CompressKeywordEncoding : public CompressionAlgorithm
{
virtual bool CompressImpl(const ByteBuffer& input, ByteBuffer& output) override; ///< Compress implementation
virtual bool DecompressImpl(const ByteBuffer& input, ByteBuffer& output) override; ///< Decompress implementation
virtual const std::string& GetAlgorithm() const override { static std::string str = "key"; return str; }
};
#endif // COMPRESS_KEYWORD_ENCODING_H_
|
//
// COProject.h
//
#import <Foundation/Foundation.h>
#import <Mantle/Mantle.h>
#import "COUser.h"
#define OPProjectListReloadNotification @"OPProjectListReloadNotification"
@interface COProject : MTLModel<MTLJSONSerializing>
@property (nonatomic, assign) NSInteger lastUpdated;
@property (nonatomic, assign) BOOL pin;
@property (nonatomic, assign) NSTimeInterval updatedAt;
@property (nonatomic, assign) NSInteger currentUserRoleId;
@property (nonatomic, assign) BOOL forked;
@property (nonatomic, copy) NSString *ownerUserPicture;
@property (nonatomic, assign) BOOL watched;
@property (nonatomic, assign) NSInteger projectId;
@property (nonatomic, copy) NSString *currentUserRole;
@property (nonatomic, copy) NSString *projectPath;
@property (nonatomic, assign) NSInteger starCount;
@property (nonatomic, copy) NSString *httpsUrl;
@property (nonatomic, assign) NSInteger recommended;
@property (nonatomic, copy) NSString *backendProjectPath;
@property (nonatomic, assign) NSInteger forkCount;
@property (nonatomic, assign) NSInteger type;
@property (nonatomic, assign) NSInteger ownerId;
@property (nonatomic, assign) NSInteger status;
@property (nonatomic, copy) NSString *desc;
@property (nonatomic, assign) BOOL stared;
@property (nonatomic, assign) NSInteger maxMember;
@property (nonatomic, copy) NSString *ownerUserName;
@property (nonatomic, assign) NSInteger unReadActivitiesCount;
@property (nonatomic, copy) NSString *gitUrl;
@property (nonatomic, copy) NSString *ownerUserHome;
@property (nonatomic, copy) NSString *sshUrl;
@property (nonatomic, assign) BOOL isPublic;
@property (nonatomic, assign) NSInteger groupId;
@property (nonatomic, copy) NSString *icon;
@property (nonatomic, copy) NSString *depotPath;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, assign) NSTimeInterval createdAt;
@property (nonatomic, assign) NSInteger watchCount;
// 动态中使用
@property (nonatomic, copy) NSString *path;
// 动态中使用
@property (nonatomic, copy) NSString *fullName;
+ (COProject *)project_FeedBack;
@end
@interface COProjectMember : MTLModel<MTLJSONSerializing>
@property (nonatomic, assign) NSInteger memberId;
@property (nonatomic, assign) NSInteger projectId;
@property (nonatomic, assign) NSInteger userId;
@property (nonatomic, assign) NSInteger type;
@property (nonatomic, assign) NSTimeInterval createdAt;
@property (nonatomic, strong) COUser *user;
@property (nonatomic, assign) NSTimeInterval lastVisitAt;
@end
@interface COProjectLineNote : MTLModel<MTLJSONSerializing>
@property (nonatomic, copy) NSString *noteableId;
@property (nonatomic, copy) NSString *path;
@property (nonatomic, copy) NSString *noteableTitle;
@property (nonatomic, copy) NSString *noteableType;
@property (nonatomic, assign) NSInteger lineNoteId;
@property (nonatomic, copy) NSString *noteableUrl;
@property (nonatomic, copy) NSString *content;
@end
@interface COProjectMemberTaskCount : MTLModel<MTLJSONSerializing>
@property (nonatomic, assign) NSInteger userId;
@property (nonatomic, assign) NSInteger processing;
@property (nonatomic, assign) NSInteger done;
@end
|
#ifndef _SINGLE_PLAYER_CONTROLLER_H_
#define _SINGLE_PLAYER_CONTROLLER_H_
#include <nds.h>
#include "controllerbase.h"
#include "hardware.h"
#include "pad.h"
/**
* Watches the DS' buttons and reports their states appropriately.
*/
class SinglePlayerController : public ControllerBase {
public:
/**
* Constructor.
*/
SinglePlayerController() { };
/**
* Destructor.
*/
~SinglePlayerController() { };
/**
* Is the left control active?
* @return True if the left control is active.
*/
bool left() {
const Pad& pad = Hardware::getPad();
return pad.isLeftNewPress() || pad.isLeftRepeat();
};
/**
* Is the right control active?
* @return True if the right control is active.
*/
bool right() {
const Pad& pad = Hardware::getPad();
return pad.isRightNewPress() || pad.isRightRepeat();
};
/**
* Is the down control active?
* @return True if the down control is active.
*/
bool down() {
const Pad& pad = Hardware::getPad();
return pad.isDownHeld();
};
/**
* Is the clockwise rotation control active?
* @return True if the clockwise rotation control is active.
*/
bool rotateClockwise() {
const Pad& pad = Hardware::getPad();
return pad.isANewPress();
};
/**
* Is the anticlockwise rotation control active?
* @return True if the anticlockwise rotation control is active.
*/
bool rotateAntiClockwise() {
const Pad& pad = Hardware::getPad();
return pad.isBNewPress();
};
};
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.