text stringlengths 4 6.14k |
|---|
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
NS_ASSUME_NONNULL_BEGIN
@interface UploadEvent : NSManagedObject
-(void)save;
-(void)destroy;
+(UploadEvent*)eventWithId:(NSString*)eventId;
+(NSArray*)allEvents;
+(void)setupStorage;
+(UploadEvent*)create:(NSDictionary*)info;
-(NSDictionary*)dataRepresentation;
@end
NS_ASSUME_NONNULL_END
|
#ifndef _MEMORY_H_
#define _MEMORY_H_
#include <stdint.h>
struct memory;
struct memory* memory_new();
void memory_read(struct memory* memory, uint32_t addr, int bytes,
uint8_t *data);
void memory_write(struct memory* memory, uint32_t addr, int bytes,
uint8_t *data);
#endif // _MEMORY_H_
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2010 by opensauce, 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 "TiUIView.h"
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0
#ifdef USE_TI_UIIOSADVIEW
#import <iAd/iAd.h>
@interface TiUIiOSAdView : TiUIView<ADBannerViewDelegate> {
@private
ADBannerView *adview;
}
@end
#endif
#endif
|
/* Copyright 2015 Sindre Ilebekk Johansen and Andreas Sløgedal Løvland
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "GameFramework/SpectatorPawn.h"
#include "VehicleSpectatorPawn.generated.h"
UCLASS(config = Game, Blueprintable, BlueprintType)
class AVehicleSpectatorPawn : public ASpectatorPawn
{
GENERATED_UCLASS_BODY()
virtual void SetupPlayerInputComponent(UInputComponent* InputComponent) override;
};
|
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#include <list>
#include <fstream>
using namespace std;
static const double Pi = 3.14159265358979323846264338327950288419716939937511;
const char* Ttc(const _TCHAR* str);
// TODO: reference additional headers your program requires here
|
/******************************************************************************/
/**
@file gen_bench_relations.h
@author Graeme Douglas
@brief A quick and dirty program for creating test relations for
benchmarking the database.
@details
@copyright Copyright 2013 Graeme Douglas
@license 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
@par
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 GEN_BENCH_RELATIONS_H
#define GEN_BENCH_RELATIONS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../ref.h"
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "../dbstorage/dbstorage.h"
#include "../dblogic/eet.h"
#include "../dbindex/dbindex.h"
#include "../db_ctconf.h"
#include <stdlib.h>
/* Initialize a test relation using Contiki Filesystem interface (CFS). */
/**
@brief Build a test relation for any system.
*/
db_int gen_bench_relation(char *relationname, db_int numattr,
db_int numtuples, db_int bound, db_int seed, db_int type);
#ifdef __cplusplus
}
#endif
#endif
|
// LocatorAPI.h: interface for the CLocatorAPI class.
//
//////////////////////////////////////////////////////////////////////
#ifndef LocatorAPIH
#define LocatorAPIH
#pragma once
#pragma warning(push)
#pragma warning(disable:4995)
#include <io.h>
#pragma warning(pop)
#include "LocatorAPI_defs.h"
class XRCORE_API CStreamReader;
class XRCORE_API CLocatorAPI
{
friend class FS_Path;
public:
struct file
{
LPCSTR name; // low-case name
u32 vfs; // 0xffffffff - standart file
u32 crc; // contents CRC
u32 ptr; // pointer inside vfs
u32 size_real; //
u32 size_compressed;// if (size_real==size_compressed) - uncompressed
u32 modif; // for editor
};
private:
struct file_pred: public std::binary_function<file&, file&, bool>
{
IC bool operator() (const file& x, const file& y) const
{ return xr_strcmp(x.name,y.name)<0; }
};
struct archive
{
shared_str path;
void *hSrcFile, *hSrcMap;
u32 size;
};
DEFINE_MAP_PRED (LPCSTR,FS_Path*,PathMap,PathPairIt,pred_str);
PathMap pathes;
DEFINE_SET_PRED (file,files_set,files_it,file_pred);
DEFINE_VECTOR (archive,archives_vec,archives_it);
DEFINE_VECTOR (_finddata_t,FFVec,FFIt);
FFVec rec_files;
int m_iLockRescan ;
void rescan_path (LPCSTR full_path, BOOL bRecurse);
void check_pathes ();
files_set files ;
archives_vec archives ;
BOOL bNoRecurse ;
xrCriticalSection m_auth_lock ;
u64 m_auth_code ;
void Register (LPCSTR name, u32 vfs, u32 crc, u32 ptr, u32 size_real, u32 size_compressed, u32 modif);
void ProcessArchive (LPCSTR path, LPCSTR base_path=NULL);
void ProcessOne (LPCSTR path, void* F);
bool Recurse (LPCSTR path);
// bool CheckExistance (LPCSTR path);
files_it file_find_it (LPCSTR n);
public:
enum{
flNeedRescan = (1<<0),
flBuildCopy = (1<<1),
flReady = (1<<2),
flEBuildCopy = (1<<3),
flEventNotificator = (1<<4),
flTargetFolderOnly = (1<<5),
flCacheFiles = (1<<6),
flScanAppRoot = (1<<7),
flNeedCheck = (1<<8),
flDumpFileActivity = (1<<9),
};
Flags32 m_Flags ;
u32 dwAllocGranularity;
u32 dwOpenCounter;
private:
void check_cached_files (LPSTR fname, const file &desc, LPCSTR &source_name);
void file_from_cache_impl(IReader *&R, LPSTR fname, const file &desc);
void file_from_cache_impl(CStreamReader *&R, LPSTR fname, const file &desc);
template <typename T>
void file_from_cache (T *&R, LPSTR fname, const file &desc, LPCSTR &source_name);
void file_from_archive (IReader *&R, LPCSTR fname, const file &desc);
void file_from_archive (CStreamReader *&R, LPCSTR fname, const file &desc);
void copy_file_to_build (IWriter *W, IReader *r);
void copy_file_to_build (IWriter *W, CStreamReader *r);
template <typename T>
void copy_file_to_build (T *&R, LPCSTR source_name);
bool check_for_file (LPCSTR path, LPCSTR _fname, string_path& fname, const file *&desc);
template <typename T>
IC T *r_open_impl (LPCSTR path, LPCSTR _fname);
void ProcessExternalArch ();
public:
CLocatorAPI ();
~CLocatorAPI ();
void _initialize (u32 flags, LPCSTR target_folder=0, LPCSTR fs_name=0);
void _destroy ();
CStreamReader* rs_open (LPCSTR initial, LPCSTR N);
IReader* r_open (LPCSTR initial, LPCSTR N);
IC IReader* r_open (LPCSTR N){return r_open(0,N);}
void r_close (IReader* &S);
void r_close (CStreamReader* &fs);
IWriter* w_open (LPCSTR initial, LPCSTR N);
IC IWriter* w_open (LPCSTR N){return w_open(0,N);}
IWriter* w_open_ex (LPCSTR initial, LPCSTR N);
IC IWriter* w_open_ex (LPCSTR N){return w_open_ex(0,N);}
void w_close (IWriter* &S);
const file* exist (LPCSTR N);
const file* exist (LPCSTR path, LPCSTR name);
const file* exist (string_path& fn, LPCSTR path, LPCSTR name);
const file* exist (string_path& fn, LPCSTR path, LPCSTR name, LPCSTR ext);
BOOL can_write_to_folder (LPCSTR path);
BOOL can_write_to_alias (LPCSTR path);
BOOL can_modify_file (LPCSTR fname);
BOOL can_modify_file (LPCSTR path, LPCSTR name);
BOOL dir_delete (LPCSTR path,LPCSTR nm,BOOL remove_files);
BOOL dir_delete (LPCSTR full_path,BOOL remove_files){return dir_delete(0,full_path,remove_files);}
void file_delete (LPCSTR path,LPCSTR nm);
void file_delete (LPCSTR full_path){file_delete(0,full_path);}
void file_copy (LPCSTR src, LPCSTR dest);
void file_rename (LPCSTR src, LPCSTR dest,bool bOwerwrite=true);
int file_length (LPCSTR src);
u32 get_file_age (LPCSTR nm);
void set_file_age (LPCSTR nm, u32 age);
xr_vector<LPSTR>* file_list_open (LPCSTR initial, LPCSTR folder, u32 flags=FS_ListFiles);
xr_vector<LPSTR>* file_list_open (LPCSTR path, u32 flags=FS_ListFiles);
void file_list_close (xr_vector<LPSTR>* &lst);
bool path_exist (LPCSTR path);
FS_Path* get_path (LPCSTR path);
FS_Path* append_path (LPCSTR path_alias, LPCSTR root, LPCSTR add, BOOL recursive);
LPCSTR update_path (string_path& dest, LPCSTR initial, LPCSTR src);
int file_list (FS_FileSet& dest, LPCSTR path, u32 flags=FS_ListFiles, LPCSTR mask=0);
//. void update_path (xr_string& dest, LPCSTR initial, LPCSTR src);
//
void register_archieve (LPCSTR path);
void auth_generate (xr_vector<xr_string>& ignore, xr_vector<xr_string>& important);
u64 auth_get ();
void auth_runtime (void*);
// editor functions
void rescan_pathes ();
void lock_rescan ();
void unlock_rescan ();
};
extern XRCORE_API CLocatorAPI* xr_FS;
#define FS (*xr_FS)
#endif // LocatorAPIH
|
/**
* Copyright 2012 Batis Degryll Ludo
* @file DaemonClickIH.h
* @since 2018-01-22
* @date 2018-02-25
* @author Batis Degrill Ludo
* @brief Input handler capable of run a daemon if given coords are inside a given area.
*/
#ifndef ZBE_EVENTS_HANDLERS_INPUT_DAEMONCLICKINPUTHANDLER_H
#define ZBE_EVENTS_HANDLERS_INPUT_DAEMONCLICKINPUTHANDLER_H
#include <memory>
#include <algorithm>
#include "ZBE/core/io/Input.h"
#include "ZBE/core/events/handlers/InputHandler.h"
#include "ZBE/core/tools/shared/Value.h"
#include "ZBE/core/tools/math/Region.h"
#include "ZBE/core/tools/math/math.h"
#include "ZBE/core/daemons/Daemon.h"
#include "ZBE/core/system/system.h"
namespace zbe {
/**
* brief Input handler capable of run a daemon if given coords are inside a given area.
*/
class ZBEAPI DaemonClickIH : public InputHandler {
public:
/** \brief Constructs a DaemonClickIH from its raw data
* \param area area to use.
* \param xvalue Value where mouse x will be readed.
* \param yvalue Value where mouse y will be readed.
* \param daemon daemon to be executed when condition are met.
*/
DaemonClickIH() : a(), xval(nullptr), yval(nullptr), d(nullptr) {}
/** \brief Constructs a DaemonClickIH from its raw data
* \param area area to use.
* \param xvalue Value where mouse x will be readed.
* \param yvalue Value where mouse y will be readed.
* \param daemon daemon to be executed when condition are met.
*/
DaemonClickIH(Region2D area, std::shared_ptr<Value<double> > xvalue, std::shared_ptr<Value<double> > yvalue, std::shared_ptr<Daemon> daemon) : a(area), xval(xvalue), yval(yvalue), d(daemon) {}
/** \brief Set Value<double> where x pointer coor will be found
* \param xvalue where x pointer coor will be found.
*/
void setXValue(std::shared_ptr<Value<double> > xvalue) {
this->xval = xvalue;
}
/** \brief Set Value<double> where y pointer coor will be found
* \param yvalue where y pointer coor will be found.
*/
void setYValue(std::shared_ptr<Value<double> > yvalue) {
this->yval = yvalue;
}
/** \brief Set the area where the daemon will be launch.
* \param area where the daemon will be launch.
*/
void setArea(Region2D area) {
this->a = area;
}
/** \brief Set the Daemon to run.
* \param daemon the Daemon to run.
*/
void setDaemon(std::shared_ptr<Daemon> daemon) {
this->d = daemon;
}
/** \brief exec daemon if click is inside given area.
* \param state input state.
*/
void run(uint32_t, float state) {
if(!almost_equal(state, ZBE_KEYUP)){
return;
}
double x = xval->get();
double y = yval->get();
double minx = std::min(a.p.x, a.p.x + a.v.x);
double miny = std::min(a.p.y, a.p.y + a.v.y);
double maxx = std::max(a.p.x, a.p.x + a.v.x);
double maxy = std::max(a.p.y, a.p.y + a.v.y);
if(x > minx && x < maxx && y > miny && y < maxy) {
d->run();
}
}
private:
Region2D a;
std::shared_ptr<Value<double> > xval;
std::shared_ptr<Value<double> > yval;
std::shared_ptr<Daemon> d;
};
} // namespace zbe
#endif // ZBE_EVENTS_HANDLERS_INPUT_DAEMONCLICKINPUTHANDLER_H
|
#import <Foundation/Foundation.h>
// Represents a non-blocking future value. Products, functions, and actors, given to the methods on this class, are executed concurrently, and the
// Promise serves as a handle on the result of the computation.
@interface FKPromise : NSObject {
}
// Waits if necessary for the computation to complete, and then retrieves its result.
- (id)claim;
// Waits if necessary for the computation to complete, and then retrieves its result.
- (id)claim:(NSTimeInterval)timeout;
@end
|
#ifndef PYIU_PACKED_H
#define PYIU_PACKED_H
#ifdef __cplusplus
extern "C" {
#endif
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "helpercompat.h"
typedef struct {
PyObject_HEAD
PyObject *func;
#if PyIU_USE_VECTORCALL
vectorcallfunc vectorcall;
#endif
} PyIUObject_Packed;
extern PyTypeObject PyIUType_Packed;
#ifdef __cplusplus
}
#endif
#endif
|
//
// ParseHelper.h
// NinjaRunner
//
// Created by Nikola Bozhkov on 11/8/14.
// Copyright (c) 2014 TeamOnaga. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Parse/Parse.h>
#import "Util.h"
#import "PlayerScore.h"
@interface ParseHelper : NSObject
+ (PlayerScore *) getPlayerScore;
+ (void) savePlayerScore:(PlayerScore *)playerScore;
+ (void) savePlayerScoreName:(NSString *)name;
+ (void) getTopTenPlayerScoresWithBlock:(void(^)(NSArray *playerScoreArray))block;
@end
|
/*
* =====================================================================================
*
* Filename: weixin.c
*
* Description: Function of weixin
*
* Version: 0.0.1
* Created: 2015/2/4 10:57:58
* Revision: none
*
* Author: Lin Hui (Link), linhui.568@163.com
* Organization: Nufront
*
*--------------------------------------------------------------------------------------
* ChangLog:
* version Author Date Purpose
* 0.0.1 Lin Hui 2015/2/4 Create and intialize
* 0.0.2 zhaoweixian 2015/3/2 fix light on or off fail bug
*
* =====================================================================================
*/
#include "../include/common.h"
#include "AES.h"
#define malloc OSMMalloc
#define calloc OSMCalloc
#define free OSMFree
unsigned char key[16] = {0x0};
unsigned char IV[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; // ³õʼ»¯ÏòÁ¿
int print_hex_data(unsigned char * buf, int data_len)
{
int ret = 0;
int i;
printf("\n");
for (i = 0; i < data_len; i++) {
if ((i != 0) && (i % 8 == 0)) printf("\n");
printf("0x%x\t", buf[i]);
}
printf("\n\n");
return ret;
}
int report_device_data(char *sendbuf, int data_len)
{
int ret = 0;
return ret;
}
#define AES_ENCRYPT_MAX_BUFFER (1024)
int NL6621_AES_Encrypt(const unsigned char *plaintext,
unsigned char *ciphertext,
unsigned int data_len)
{
unsigned char *tempbuf = NULL;
unsigned int templen = data_len;
if (templen == 0) {
return -1;
} else if ((templen % 16) != 0) {
tempbuf = malloc(AES_ENCRYPT_MAX_BUFFER);
memset(tempbuf, 0x0, AES_ENCRYPT_MAX_BUFFER);
memcpy(tempbuf, plaintext, data_len);
templen = (((templen / 16) + 1) * 16);
AES_Encrypt(tempbuf, ciphertext, templen, IV);
if (tempbuf != NULL) free(tempbuf);
} else {
AES_Encrypt(plaintext, ciphertext, templen, IV);
}
return templen;
}
int NL6621_AES_Decrypt(unsigned char *plaintext,
const unsigned char *ciphertext,
unsigned int data_len)
{
AES_Decrypt(plaintext, ciphertext, data_len, IV);
return 0;
}
void AESThread(void *arg)
{
unsigned char *sendbuf = "I am linhui, who are you?";
unsigned char recevbuf[64] = {'\0'};
unsigned char CipherText[64] = {0x0};
unsigned int data_len = strlen(sendbuf);
unsigned int templen = data_len;
unsigned char *mykey = "nufront123456";
log_notice("Create AES test demo process task thread.\n");
OSTimeDly(100);
while (1) {
OSTimeDly(300);
memcpy(key, '\0', sizeof(key));
memcpy(key, mykey, strlen(mykey));
printf("key:%s\n", key);
AES_Init(key);
/* AES Encrypt plain data */
templen = NL6621_AES_Encrypt(sendbuf, CipherText, data_len);
printf("plain data(len:%d):%s.\n", data_len, sendbuf);
print_hex_data(CipherText, templen);
/* AES Decrypt cipher data */
NL6621_AES_Decrypt(recevbuf, CipherText, templen);
print_hex_data(recevbuf, templen);
log_notice("Decrypt Data(len:%d):%s\n", templen, recevbuf);
}
}
|
/****************¡¶51µ¥Æ¬»úÇáËÉÈëÃÅ-»ùÓÚSTC15W4KϵÁС·ÅäÌ×Àý³Ì *************
¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï
¡¶51µ¥Æ¬»úÇáËÉÈëÃÅ-»ùÓÚSTC15W4KϵÁС· Ò»ÊéÒѾÓɱ±º½³ö°æÉçÕýʽ³ö°æ·¢ÐС£
×÷ÕßÇ×ÊÖ´´×÷µÄÓë½Ì²ÄÅäÌ×µÄ51Ë«ºËʵÑé°å(2¸öMCU)¶Ô³ÌÐòÏÂÔØ¡¢µ÷ÊÔ¡¢·ÂÕæ·½±ã£¬²»ÐèÒªÍⲿ
·ÂÕæÆ÷Óë±à³ÌÆ÷£¬ÕâÖÖÉè¼Æ·½Ê½³¹µ×½â¾öÁËϵͳÖжà¸ö×î¸ßÓÅÏȼ¶ËÒ²²»ÄÜÈÃ˵ÄÖжϾºÕùÎÊÌâ¡£
ÌÔ±¦µêµØÖ·£ºhttps://shop117387413.taobao.com
QQȺ£ºSTC51-STM32(3) £º515624099 »ò STC51-STM32(2)£º99794374¡£
ÑéÖ¤ÐÅÏ¢£ºSTC15µ¥Æ¬»ú
ÓÊÏ䣺xgliyouquan@126.com
¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï¡ï*/
#include "intrins.h" // _nop_()º¯ÊýÐèÒª
/******************************************************************
- ¹¦ÄÜÃèÊö£º½«Ò»¸ö32볤ÕûÐͱäÁ¿datתΪ×Ö·û´®£¬±ÈÈç°Ñ1234תΪ"1234"
- ²ÎÊý˵Ã÷£ºdat:´ýתµÄlongÐ͵ıäÁ¿
str:Ö¸Ïò×Ö·ûÊý×éµÄÖ¸Õ룬ת»»ºóµÄ×Ö½Ú´®·ÅÔÚÆäÖÐ
******************************************************************/
void Long_Str(unsigned long dat,char *str)
{
unsigned char temp[11]; // ³¤ÕûÊý×î´óÖµ4294967295£¬×ªASCIIÂëºóÕ¼ÓÃ10×Ö½Ú
unsigned char i=0,j=0;
while(dat) // ÊýֵתASCIIÂ룬×Ö½ÚÔÚÊý×éÖз´ÏòÅÅÁÐ
{
temp[i]=dat%10+0x30;
i++;
dat/=10;
}
j=i;
for(i=0;i<j;i++) // Êý×é½»»»ÏȺó˳Ðò£¬ÕýÏòÅÅÁÐ
{
str[i]=temp[j-i-1]; // CÓïÑÔÖÐÊý×éϱê¹Ì¶¨´Ó0¿ªÊ¼
}
if(!i) {str[i++]='0';} // º¯Êý²ÎÊýdat=0´¦Àí
str[i]=0; // ÓÉÓÚҪʹÓÃKEIL×Ô´øµÄ×Ö·û´®´¦Àíº¯Êý´¦Àí£¬±ØÐëÓнáÊø±ê¼Ç¡£
}
//void delay100ms(void) // 22.1184MHz
//{
// unsigned char i,j,k;
// for(i=19;i>0;i--) for(j=223;j>0;j--) for(k=129;k>0;k--);
//}
void Delay100ms(void) //@11.0592MHz
{
unsigned char i, j, k;
_nop_();
_nop_();
i = 5;
j = 52;
k = 195;
do
{
do
{
while (--k);
} while (--j);
} while (--i);
}
|
#include <stdio.h>
#include <setjmp.h>
#include <coroutine.h>
//#include <call_in_stack.h>
#include <gc.h>
#undef GC_LOG_BRIEF
#define GC_LOG_BRIEF false
static jmp_buf buf;
void second(void) {
xgc_debug("second\n");
longjmp(buf,1); // 跳回setjmp的调用处 - 使得setjmp返回值为1
}
void first(void) {
second();
xgc_debug("first\n");
}
extern void check_jumpbuf_nextpc();
void check_jmpbuf()
{
jmp_buf xbuf;
int x=222;
if ( ! setjmp(xbuf))
{
for (int i=0; i < sizeof(xbuf[0].__jmpbuf)/sizeof(__jmp_buf_reg_t); i++)
xgc_debug("[%d] %p\n", i, cast(void *, cast(void*, xbuf[0].__jmpbuf[i])));
printf("\n");
xgc_debug("sp = %p, %p\n", &xbuf, &x);
xgc_debug("pc = %p, next pc=%p\n", &check_jmpbuf, &check_jumpbuf_nextpc);
xgc_debug("pc = %p, next pc=%p\n", &check_jmpbuf, &&__next_pc);
printf("\n");
}
else
{
xgc_debug("main, x = %d\n",x);
}
__next_pc:
xgc_info("reg_t sizeof=%u, sizeof_uint(int)=%u, sizeof_uint(long)=%u\n", sizeof_uint(xbuf[0].__jmpbuf[0]), sizeof_uint(int), sizeof_uint(long));
xgc_info("__WORDSIZE = %d\n", __WORDSIZE );
xgc_info("__sizeof(long long) = %u\n", sizeof_uint(long long) );
}
void check_jumpbuf_nextpc()
{
}
int main()
{
volatile int x=33;
void *p = cast(void*, &main);
char *cp = cast(char*, &main);
xgc_info("%p, %p\n", p, cp+10);
xgc_info("%d\n", cast(int, sizeof(__jmp_buf_reg_t)));
check_jmpbuf();
if ( ! setjmp(buf))
{
first();
}
else
{
xgc_debug("main, x = %d\n",x);
}
return 0;
}
|
/**************************************************************************************************
* File name : test.h
* Description : Perform the test cases here.
* Creator : Frederick Hsu
* Creation date: Wed. 28 Dec. 2016
* Copyright(C) 2016 All rights reserved.
*
**************************************************************************************************/
#ifndef TEST_H
#define TEST_H
void performTestCases(void);
void performTestCases4StringModule(void);
void performTestCases4ArrayModule(void);
void performTestCases4DictionaryModule(void);
void performTestCase4NumberModule(void);
#endif /* TEST_H */
|
#ifndef _STRUCT_H_
#define _STRUCT_H_
#include <stdlib.h>
#include <cJSON.h>
#include "str.h"
typedef struct
{
str_t data;
size_t capacity;
} curl_data_t;
#define empty_curl_data {empty_str, 0}
extern void curl_data_free(curl_data_t* data);
typedef struct pair_array_s curl_header_t;
#define empty_curl_header empty_pair_array
typedef struct pair_array_s pair_array_t;
struct pair_array_s
{
str_t* keys;
str_t* vals;
size_t count;
};
extern pair_array_t static_empty_pair_array;
#define empty_pair_array {NULL, NULL, 0}
extern void pair_array_free(pair_array_t* array);
extern void pair_array_append_pointers(pair_array_t* array, const char* key, const char* val);
extern void pair_array_append_empty_value(pair_array_t* array, const char* key);
extern str_t pair_array_lookup(pair_array_t* array, str_t key);
extern int pair_array_set(pair_array_t* array, str_t key, str_t val);
typedef struct
{
enum
{
MSG_CONTENT_TYPE_NONE,
MSG_CONTENT_TYPE_STRING,
MSG_CONTENT_TYPE_FACE
} type;
union
{
str_t string;
uint face_id;
};
} msg_content_t;
typedef struct
{
msg_content_t* vals;
size_t count;
} msg_content_array_t;
#define empty_msg_content_array {NULL, 0}
#define msg_content_array_empty(array) ((array).count == 0)
extern void msg_content_array_free(msg_content_array_t* array);
extern void msg_content_array_append_string(msg_content_array_t* array, const char* val);
extern void msg_content_array_append_face(msg_content_array_t* array, uint face_id);
extern char* msg_content_array_to_json_object_string(msg_content_array_t* array, const char* key);
extern cJSON* msg_content_array_to_json_value(msg_content_array_t* array);
extern msg_content_array_t msg_content_array_from_json_value(cJSON* src);
#endif
|
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <folly/stats/TDigest.h>
#include <folly/stats/detail/BufferedStat.h>
namespace folly {
struct QuantileEstimates {
public:
double sum;
double count;
// vector of {quantile, value}
std::vector<std::pair<double, double>> quantiles;
};
/*
* A QuantileEstimator that buffers writes for 1 second.
*/
template <typename ClockT = std::chrono::steady_clock>
class SimpleQuantileEstimator {
public:
using TimePoint = typename ClockT::time_point;
SimpleQuantileEstimator();
QuantileEstimates estimateQuantiles(
Range<const double*> quantiles, TimePoint now = ClockT::now());
void addValue(double value, TimePoint now = ClockT::now());
/// Flush buffered values
void flush() { bufferedDigest_.flush(); }
// Get point-in-time TDigest
TDigest getDigest(TimePoint now = ClockT::now()) {
return bufferedDigest_.get(now);
}
private:
detail::BufferedDigest<TDigest, ClockT> bufferedDigest_;
};
/*
* A QuantileEstimator that keeps values for nWindows * windowDuration (see
* constructor). Values are buffered for windowDuration.
*/
template <typename ClockT = std::chrono::steady_clock>
class SlidingWindowQuantileEstimator {
public:
using TimePoint = typename ClockT::time_point;
using Duration = typename ClockT::duration;
SlidingWindowQuantileEstimator(Duration windowDuration, size_t nWindows = 60);
QuantileEstimates estimateQuantiles(
Range<const double*> quantiles, TimePoint now = ClockT::now());
void addValue(double value, TimePoint now = ClockT::now());
/// Flush buffered values
void flush() { bufferedSlidingWindow_.flush(); }
// Get point-in-time TDigest
TDigest getDigest(TimePoint now = ClockT::now()) {
return TDigest::merge(bufferedSlidingWindow_.get(now));
}
private:
detail::BufferedSlidingWindow<TDigest, ClockT> bufferedSlidingWindow_;
};
} // namespace folly
#include <folly/stats/QuantileEstimator-inl.h>
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include <assert.h>
#include <exception>
// System.Text.RegularExpressions.IntervalCollection/CostDelegate
struct CostDelegate_t3008899218;
// System.Object
struct Il2CppObject;
// System.IAsyncResult
struct IAsyncResult_t537683269;
// System.AsyncCallback
struct AsyncCallback_t1363551830;
#include "codegen/il2cpp-codegen.h"
#include "mscorlib_System_Object837106420.h"
#include "mscorlib_System_IntPtr676692020.h"
#include "System_System_Text_RegularExpressions_Interval63637216.h"
#include "System_System_Text_RegularExpressions_Interval63637216MethodDeclarations.h"
#include "mscorlib_System_AsyncCallback1363551830.h"
// System.Void System.Text.RegularExpressions.IntervalCollection/CostDelegate::.ctor(System.Object,System.IntPtr)
extern "C" void CostDelegate__ctor_m731467895 (CostDelegate_t3008899218 * __this, Il2CppObject * ___object, IntPtr_t ___method, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Double System.Text.RegularExpressions.IntervalCollection/CostDelegate::Invoke(System.Text.RegularExpressions.Interval)
extern "C" double CostDelegate_Invoke_m212988972 (CostDelegate_t3008899218 * __this, Interval_t63637216 ___i, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" double pinvoke_delegate_wrapper_CostDelegate_t3008899218(Il2CppObject* delegate, Interval_t63637216 ___i);
// System.IAsyncResult System.Text.RegularExpressions.IntervalCollection/CostDelegate::BeginInvoke(System.Text.RegularExpressions.Interval,System.AsyncCallback,System.Object)
extern "C" Il2CppObject * CostDelegate_BeginInvoke_m1041332600 (CostDelegate_t3008899218 * __this, Interval_t63637216 ___i, AsyncCallback_t1363551830 * ___callback, Il2CppObject * ___object, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Double System.Text.RegularExpressions.IntervalCollection/CostDelegate::EndInvoke(System.IAsyncResult)
extern "C" double CostDelegate_EndInvoke_m917297514 (CostDelegate_t3008899218 * __this, Il2CppObject * ___result, const MethodInfo* method) IL2CPP_METHOD_ATTR;
|
#include "nit.common.h"
#define COLOR_nit__location__SourceFile___filename 0
extern const char FILE_nit__location[];
#define COLOR_nit__location__SourceFile___string 1
#define COLOR_nit__location__SourceFile___stream 2
val* standard___standard__BufferedIStream___IStream__read_all(val* self);
#define COLOR_nit__location__SourceFile___line_starts 3
val* BOX_standard__Int(long);
void standard___standard__Array___standard__abstract_collection__Sequence___91d_93d_61d(val* self, long p0, val* p1);
#define COLOR_nit__location__Location___file 0
#define COLOR_nit__location__Location___line_start 1
#define COLOR_nit__location__Location___line_end 2
#define COLOR_nit__location__Location___column_start 3
#define COLOR_nit__location__Location___column_end 4
extern const struct type type_standard__Int;
extern const char FILE_standard__kernel[];
val* standard___standard__Array___standard__abstract_collection__SequenceRead___91d_93d(val* self, long p0);
#define COLOR_nit__location__Location___text_cache 5
#define COLOR_standard__kernel__Object___61d_61d 2
long nit___nit__Location___pstart(val* self);
long nit___nit__Location___pend(val* self);
#define COLOR_standard__string__Text__substring 48
extern const struct type type_nit__Location;
short int nit___nit__Location___standard__kernel__Object___61d_61d(val* self, val* p0);
val* standard___standard__NativeString___to_s_with_length(char* self, long p0);
#define COLOR_standard__string__Text__length 47
#define COLOR_standard__string__String___43d 82
val* NEW_standard__Array(const struct type* type);
extern const struct type type_standard__Array__standard__Object;
val* NEW_standard__NativeArray(int length, const struct type* type);
extern const struct type type_standard__NativeArray__standard__Object;
#define COLOR_standard__array__Array__with_native 73
#define COLOR_standard__string__Object__to_s 9
#define COLOR_standard__kernel__Comparable__OTHER 0
short int nit___nit__Location___located_in(val* self, val* p0);
val* BOX_standard__Char(char);
#define COLOR_standard__string__Text__chars 46
#define COLOR_standard__abstract_collection__SequenceRead___91d_93d 45
extern const struct class class_standard__Char;
val* NEW_standard__FlatBuffer(const struct type* type);
extern const struct type type_standard__FlatBuffer;
#define COLOR_standard___standard__FlatBuffer___standard__kernel__Object__init 96
void standard___standard__FlatBuffer___Buffer__add(val* self, char p0);
long standard___standard__Int___Discrete__successor(long self, long p0);
#define COLOR_nit___nit__Location___standard__kernel__Object__init 54
|
//
// AppDelegate.h
// Droider
//
// Created by Adam Jensen on 9/25/13.
// Copyright (c) 2013 Adam Jensen. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate, NSMenuDelegate> {
NSOperationQueue *queue;
NSStatusItem *statusItem;
}
- (void)deviceListRefreshed:(NSArray *)deviceList;
- (void)menuWillOpen:(NSMenu *)menu;
+ (id)shared;
@property (strong, nonatomic) IBOutlet NSMenu *statusMenu;
@property (strong, nonatomic) NSMutableDictionary *devices;
@end
|
/*
* Copyright (C) 2014 ZYYX, 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 <stdio.h>
#include <stdlib.h>
#include "random.h"
static unsigned long next = 1;
int dynamicApp_rand(void) {
next = next * 1103515245 + 12345;
return((unsigned)(next/65536) % 32768);
}
void dynamicApp_srand(unsigned seed) {
next = seed;
}
|
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* 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 "flash_api.h"
#include "flash_data.h"
#include "platform/mbed_critical.h"
// This file is automatically generated
#if DEVICE_FLASH
// This is a flash algo binary blob. It is PIC (position independent code) that should be stored in RAM
static uint32_t FLASH_ALGO[] = {
0x28100b00, 0x210ed302, 0x00d0eb01, 0xf44f4770, 0xfbb1707a, 0x4933f0f0, 0x60084449, 0x20014932,
0x20006408, 0x20004770, 0xe92d4770, 0xf7ff41f0, 0x4d2effe7, 0x444d4604, 0xe9c52032, 0xf1050400,
0x4e2b0114, 0x4628460f, 0x47b060ac, 0xb9686968, 0xe9c52034, 0x48230400, 0x444860ac, 0x68004639,
0x462860e8, 0x696847b0, 0xd0002800, 0xe8bd2001, 0xe92d81f0, 0x461441f0, 0xd10e0006, 0x0100e9d4,
0xe9d44408, 0x44111202, 0x69214408, 0x69614408, 0x69a14408, 0x42404408, 0x463061e0, 0xffb0f7ff,
0x21324d12, 0x4f12444d, 0x1000e9c5, 0x0114f105, 0x468860a8, 0x47b84628, 0xb9806968, 0xe9c52033,
0xf44f0600, 0xe9c56080, 0x48064002, 0x44484641, 0x61286800, 0x47b84628, 0x28006968, 0x2001d0c7,
0x0000e7c5, 0x00000004, 0x400fc000, 0x00000008, 0x1fff1ff1, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
};
static const flash_algo_t flash_algo_config = {
.init = 0xf,
.uninit = 0x27,
.erase_sector = 0x2b,
.program_page = 0x73,
.static_base = 0xf4,
.algo_blob = FLASH_ALGO
};
static const sector_info_t sectors_info[] = {
{0x0, 0x1000},
{0x10000, 0x8000},
};
static const flash_target_config_t flash_target_config = {
.page_size = 0x400,
.flash_start = 0x0,
.flash_size = 0x80000,
.sectors = sectors_info,
.sector_info_count = sizeof(sectors_info) / sizeof(sector_info_t)
};
void flash_set_target_config(flash_t *obj)
{
obj->flash_algo = &flash_algo_config;
obj->target_config = &flash_target_config;
}
#endif
|
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
/*!
* @brief SIMD like functions
*/
/*
Functions:
CGLM_INLINE void glm_vec3_broadcast(float val, vec3 d);
CGLM_INLINE void glm_vec3_fill(vec3 v, float val);
CGLM_INLINE bool glm_vec3_eq(vec3 v, float val);
CGLM_INLINE bool glm_vec3_eq_eps(vec3 v, float val);
CGLM_INLINE bool glm_vec3_eq_all(vec3 v);
CGLM_INLINE bool glm_vec3_eqv(vec3 a, vec3 b);
CGLM_INLINE bool glm_vec3_eqv_eps(vec3 a, vec3 b);
CGLM_INLINE float glm_vec3_max(vec3 v);
CGLM_INLINE float glm_vec3_min(vec3 v);
CGLM_INLINE bool glm_vec3_isnan(vec3 v);
CGLM_INLINE bool glm_vec3_isinf(vec3 v);
CGLM_INLINE bool glm_vec3_isvalid(vec3 v);
CGLM_INLINE void glm_vec3_sign(vec3 v, vec3 dest);
CGLM_INLINE void glm_vec3_abs(vec3 v, vec3 dest);
CGLM_INLINE void glm_vec3_fract(vec3 v, vec3 dest);
CGLM_INLINE float glm_vec3_hadd(vec3 v);
CGLM_INLINE void glm_vec3_sqrt(vec3 v, vec3 dest);
*/
#ifndef cglm_vec3_ext_h
#define cglm_vec3_ext_h
#include "common.h"
#include "util.h"
/*!
* @brief fill a vector with specified value
*
* @param[in] val value
* @param[out] d dest
*/
CGLM_INLINE
void
glm_vec3_broadcast(float val, vec3 d) {
d[0] = d[1] = d[2] = val;
}
/*!
* @brief fill a vector with specified value
*
* @param[out] v dest
* @param[in] val value
*/
CGLM_INLINE
void
glm_vec3_fill(vec3 v, float val) {
v[0] = v[1] = v[2] = val;
}
/*!
* @brief check if vector is equal to value (without epsilon)
*
* @param[in] v vector
* @param[in] val value
*/
CGLM_INLINE
bool
glm_vec3_eq(vec3 v, float val) {
return v[0] == val && v[0] == v[1] && v[0] == v[2];
}
/*!
* @brief check if vector is equal to value (with epsilon)
*
* @param[in] v vector
* @param[in] val value
*/
CGLM_INLINE
bool
glm_vec3_eq_eps(vec3 v, float val) {
return fabsf(v[0] - val) <= FLT_EPSILON
&& fabsf(v[1] - val) <= FLT_EPSILON
&& fabsf(v[2] - val) <= FLT_EPSILON;
}
/*!
* @brief check if vectors members are equal (without epsilon)
*
* @param[in] v vector
*/
CGLM_INLINE
bool
glm_vec3_eq_all(vec3 v) {
return v[0] == v[1] && v[0] == v[2];
}
/*!
* @brief check if vector is equal to another (without epsilon)
*
* @param[in] a vector
* @param[in] b vector
*/
CGLM_INLINE
bool
glm_vec3_eqv(vec3 a, vec3 b) {
return a[0] == b[0]
&& a[1] == b[1]
&& a[2] == b[2];
}
/*!
* @brief check if vector is equal to another (with epsilon)
*
* @param[in] a vector
* @param[in] b vector
*/
CGLM_INLINE
bool
glm_vec3_eqv_eps(vec3 a, vec3 b) {
return fabsf(a[0] - b[0]) <= FLT_EPSILON
&& fabsf(a[1] - b[1]) <= FLT_EPSILON
&& fabsf(a[2] - b[2]) <= FLT_EPSILON;
}
/*!
* @brief max value of vector
*
* @param[in] v vector
*/
CGLM_INLINE
float
glm_vec3_max(vec3 v) {
float max;
max = v[0];
if (v[1] > max)
max = v[1];
if (v[2] > max)
max = v[2];
return max;
}
/*!
* @brief min value of vector
*
* @param[in] v vector
*/
CGLM_INLINE
float
glm_vec3_min(vec3 v) {
float min;
min = v[0];
if (v[1] < min)
min = v[1];
if (v[2] < min)
min = v[2];
return min;
}
/*!
* @brief check if all items are NaN (not a number)
* you should only use this in DEBUG mode or very critical asserts
*
* @param[in] v vector
*/
CGLM_INLINE
bool
glm_vec3_isnan(vec3 v) {
return isnan(v[0]) || isnan(v[1]) || isnan(v[2]);
}
/*!
* @brief check if all items are INFINITY
* you should only use this in DEBUG mode or very critical asserts
*
* @param[in] v vector
*/
CGLM_INLINE
bool
glm_vec3_isinf(vec3 v) {
return isinf(v[0]) || isinf(v[1]) || isinf(v[2]);
}
/*!
* @brief check if all items are valid number
* you should only use this in DEBUG mode or very critical asserts
*
* @param[in] v vector
*/
CGLM_INLINE
bool
glm_vec3_isvalid(vec3 v) {
return !glm_vec3_isnan(v) && !glm_vec3_isinf(v);
}
/*!
* @brief get sign of 32 bit float as +1, -1, 0
*
* Important: It returns 0 for zero/NaN input
*
* @param v vector
*/
CGLM_INLINE
void
glm_vec3_sign(vec3 v, vec3 dest) {
dest[0] = glm_signf(v[0]);
dest[1] = glm_signf(v[1]);
dest[2] = glm_signf(v[2]);
}
/*!
* @brief absolute value of each vector item
*
* @param[in] v vector
* @param[out] dest destination vector
*/
CGLM_INLINE
void
glm_vec3_abs(vec3 v, vec3 dest) {
dest[0] = fabsf(v[0]);
dest[1] = fabsf(v[1]);
dest[2] = fabsf(v[2]);
}
/*!
* @brief fractional part of each vector item
*
* @param[in] v vector
* @param[out] dest destination vector
*/
CGLM_INLINE
void
glm_vec3_fract(vec3 v, vec3 dest) {
static union {
float f;
int32_t i;
} num;
// Equivalent to 0x1.fffffep-1f.
num.i = 0x3f7fffff;
dest[0] = fminf(v[0] - floorf(v[0]), num.f);
dest[1] = fminf(v[1] - floorf(v[1]), num.f);
dest[2] = fminf(v[2] - floorf(v[2]), num.f);
}
/*!
* @brief vector reduction by summation
* @warning could overflow
*
* @param[in] v vector
* @return sum of all vector's elements
*/
CGLM_INLINE
float
glm_vec3_hadd(vec3 v) {
return v[0] + v[1] + v[2];
}
/*!
* @brief square root of each vector item
*
* @param[in] v vector
* @param[out] dest destination vector
*/
CGLM_INLINE
void
glm_vec3_sqrt(vec3 v, vec3 dest) {
dest[0] = sqrtf(v[0]);
dest[1] = sqrtf(v[1]);
dest[2] = sqrtf(v[2]);
}
#endif /* cglm_vec3_ext_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.
*/
/**
* @author Igor V. Stolyarov
* @version $Revision$
*/
#ifndef __GDI_BLITTER__
#define __GDI_BLITTER__
#include <Windows.h>
#include <Wingdi.h>
#include <jni.h>
#include "LUTTables.h"
#include "SurfaceDataStructure.h"
#define BIT_BLT 0
#define TRANSPARENT_BLT 1
#define ALPHA_BLEND 2
#define NULL_BLT 3
void findNonExistColor(DWORD &, DWORD *, UINT);
BOOL isRepeatColor(UINT , DWORD *, UINT);
BOOL initBlitData(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, UINT compType,
UCHAR srcConstAlpha, BLITSTRUCT *blitStruct);
BOOL initBitmap(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, BOOL alphaPre);
#endif
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2011 by ListAndPicker, 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.
*/
#if defined(USE_TI_XML) || defined(USE_TI_NETWORK)
#import "TiProxy.h"
#import "TiDOMNodeProxy.h"
@interface TiDOMCharacterDataProxy : TiDOMNodeProxy {
@private
}
@property(nonatomic,copy,readwrite) NSString * data;
@property(nonatomic,readonly) NSNumber * length;
-(NSString *) substringData:(id)args;
-(void) appendData:(id)args;
-(void) insertData:(id)args;
-(void) deleteData:(id)args;
-(void) replaceData:(id)args;
@end
#endif
|
/*
* @(#)dds_cpp_flowcontroller.h generated by: makeheader Mon Dec 3 23:08:33 2007
*
* built from: flowcontroller.ifcxx
*/
#ifndef dds_cpp_flowcontroller_h
#define dds_cpp_flowcontroller_h
#ifndef dds_cpp_infrastructure_h
#include "dds_cpp/dds_cpp_infrastructure.h"
#endif
#ifndef dds_c_flowcontroller_h
#include "dds_c/dds_c_flowcontroller.h"
#endif
#ifndef dds_cpp_dll_h
#include "dds_cpp/dds_cpp_dll.h"
#endif
class DDSFlowController_impl;
class DDSDomainParticipant;
class DDSCPPDllExport DDSFlowController {
public:
/*i
@brief Get the underlying implementation class object.
*/
virtual DDSFlowController_impl* get_impl_FlowControllerI()
= 0;
public:
/*e \dref_FlowController_set_property
*/
virtual DDS_ReturnCode_t set_property(
const struct DDS_FlowControllerProperty_t &property)
= 0;
/*e \dref_FlowController_get_property
*/
virtual DDS_ReturnCode_t get_property(
struct DDS_FlowControllerProperty_t &property)
= 0;
/*e \dref_FlowController_trigger_flow
*/
virtual DDS_ReturnCode_t trigger_flow()
= 0;
/*e \dref_FlowController_get_name
*/
virtual const char* get_name()
= 0;
/*e \dref_FlowController_get_participant
*/
virtual DDSDomainParticipant* get_participant()
= 0;
protected:
virtual ~DDSFlowController();
};
#endif /* dds_cpp_flowcontroller_h */
|
#define alpha( i,j ) A[ (j)*ldA + (i) ] // map alpha( i,j ) to array A
#define beta( i,j ) B[ (j)*ldB + (i) ] // map beta( i,j ) to array B
#define gamma( i,j ) C[ (j)*ldC + (i) ] // map gamma( i,j ) to array C
#include<immintrin.h>
void Gemm_MRxNRKernel( int k, double *A, int ldA, double *B, int ldB,
double *C, int ldC )
{
/* Declare vector registers to hold 8x6 C and load them */
__m256d gamma_0123_0 = _mm256_loadu_pd( &gamma( 0,0 ) );
__m256d gamma_0123_1 = _mm256_loadu_pd( &gamma( 0,1 ) );
__m256d gamma_0123_2 = _mm256_loadu_pd( &gamma( 0,2 ) );
__m256d gamma_0123_3 = _mm256_loadu_pd( &gamma( 0,3 ) );
__m256d gamma_0123_4 = _mm256_loadu_pd( &gamma( 0,4 ) );
__m256d gamma_0123_5 = _mm256_loadu_pd( &gamma( 0,5 ) );
__m256d gamma_4567_0 = _mm256_loadu_pd( &gamma( 4,0 ) );
__m256d gamma_4567_1 = _mm256_loadu_pd( &gamma( 4,1 ) );
__m256d gamma_4567_2 = _mm256_loadu_pd( &gamma( 4,2 ) );
__m256d gamma_4567_3 = _mm256_loadu_pd( &gamma( 4,3 ) );
__m256d gamma_4567_4 = _mm256_loadu_pd( &gamma( 4,4 ) );
__m256d gamma_4567_5 = _mm256_loadu_pd( &gamma( 4,5 ) );
for ( int p=0; p<k; p++ ){
/* Declare vector register for load/broadcasting beta( p,j ) */
__m256d beta_p_j;
/* Declare vector registersx to hold the current column of A and load
them with the eight elements of that column. */
__m256d alpha_0123_p = _mm256_loadu_pd( &alpha( 0,p ) );
__m256d alpha_4567_p = _mm256_loadu_pd( &alpha( 4,p ) );
/* Load/broadcast beta( p,0 ). */
beta_p_j = _mm256_broadcast_sd( &beta( p, 0) );
/* update the first column of C with the current column of A times
beta ( p,0 ) */
gamma_0123_0 = _mm256_fmadd_pd( alpha_0123_p, beta_p_j, gamma_0123_0 );
gamma_4567_0 = _mm256_fmadd_pd( alpha_4567_p, beta_p_j, gamma_4567_0 );
/* REPEAT for second, third, and fourth columns of C. Notice that the
current column of A needs not be reloaded. */
/* Load/broadcast beta( p,1 ). */
beta_p_j = _mm256_broadcast_sd( &beta( p, 1) );
/* update the second column of C with the current column of A times
beta ( p,1 ) */
gamma_0123_1 = _mm256_fmadd_pd( alpha_0123_p, beta_p_j, gamma_0123_1 );
gamma_4567_1 = _mm256_fmadd_pd( alpha_4567_p, beta_p_j, gamma_4567_1 );
/* Load/broadcast beta( p,2 ). */
beta_p_j = _mm256_broadcast_sd( &beta( p, 2) );
/* update the third column of C with the current column of A times
beta ( p,2 ) */
gamma_0123_2 = _mm256_fmadd_pd( alpha_0123_p, beta_p_j, gamma_0123_2 );
gamma_4567_2 = _mm256_fmadd_pd( alpha_4567_p, beta_p_j, gamma_4567_2 );
/* Load/broadcast beta( p,3 ). */
beta_p_j = _mm256_broadcast_sd( &beta( p, 3) );
/* update the fourth column of C with the current column of A times
beta ( p,3 ) */
gamma_0123_3 = _mm256_fmadd_pd( alpha_0123_p, beta_p_j, gamma_0123_3 );
gamma_4567_3 = _mm256_fmadd_pd( alpha_4567_p, beta_p_j, gamma_4567_3 );
/* Load/broadcast beta( p,4 ). */
beta_p_j = _mm256_broadcast_sd( &beta( p, 4) );
/* update the fifth column of C with the current column of A times
beta ( p,4 ) */
gamma_0123_4 = _mm256_fmadd_pd( alpha_0123_p, beta_p_j, gamma_0123_4 );
gamma_4567_4 = _mm256_fmadd_pd( alpha_4567_p, beta_p_j, gamma_4567_4 );
/* Load/broadcast beta( p,5 ). */
beta_p_j = _mm256_broadcast_sd( &beta( p, 5) );
/* update the sixth column of C with the current column of A times
beta ( p,5 ) */
gamma_0123_5 = _mm256_fmadd_pd( alpha_0123_p, beta_p_j, gamma_0123_5 );
gamma_4567_5 = _mm256_fmadd_pd( alpha_4567_p, beta_p_j, gamma_4567_5 );
}
/* Store the updated results */
_mm256_storeu_pd( &gamma(0,0), gamma_0123_0 );
_mm256_storeu_pd( &gamma(0,1), gamma_0123_1 );
_mm256_storeu_pd( &gamma(0,2), gamma_0123_2 );
_mm256_storeu_pd( &gamma(0,3), gamma_0123_3 );
_mm256_storeu_pd( &gamma(0,4), gamma_0123_4 );
_mm256_storeu_pd( &gamma(0,5), gamma_0123_5 );
_mm256_storeu_pd( &gamma(4,0), gamma_4567_0 );
_mm256_storeu_pd( &gamma(4,1), gamma_4567_1 );
_mm256_storeu_pd( &gamma(4,2), gamma_4567_2 );
_mm256_storeu_pd( &gamma(4,3), gamma_4567_3 );
_mm256_storeu_pd( &gamma(4,4), gamma_4567_4 );
_mm256_storeu_pd( &gamma(4,5), gamma_4567_5 );
}
|
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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 LOCATION_NEARBY_CPP_EXPOSURENOTIFICATION_JNI_CONSTANTS_H_
#define LOCATION_NEARBY_CPP_EXPOSURENOTIFICATION_JNI_CONSTANTS_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef __ANDROID__
#include <android/log.h>
#define LOG_TAG "ExposureNotificationJni"
#define LOG_V(...) \
__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
#define LOG_I(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOG_W(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
#define LOG_E(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
#else
#include <cstdio>
#define LOG_V(...) fprintf(stderr, __VA_ARGS__)
#define LOG_I(...) fprintf(stderr, __VA_ARGS__)
#define LOG_W(...) fprintf(stderr, __VA_ARGS__)
#define LOG_E(...) fprintf(stderr, __VA_ARGS__)
#endif
namespace exposure {
constexpr static const int kRpikLength = 16;
constexpr static const int kTekLength = 16;
constexpr static const int kIdLength = 16;
constexpr static const int kIdPerKey = 144;
constexpr static const int kHkdfInfoLength = 7;
constexpr static const char kHkdfInfo[] = u8"EN-RPIK";
constexpr static const int kRpiPaddedDataLength = 12;
constexpr static const char kRpiPaddedData[] = u8"EN-RPI\0\0\0\0\0\0";
} // namespace exposure
#endif // LOCATION_NEARBY_CPP_EXPOSURENOTIFICATION_JNI_CONSTANTS_H_
|
/*
This file is part of:
NoahFrame
https://github.com/ketoo/NoahGameFrame
Copyright 2009 - 2018 NoahFrame(NoahGameFrame)
File creator: lvsheng.huang
NoahFrame is open-source software and you can redistribute it and/or modify
it under the terms of the License; besides, anyone who use this file/software must include this copyright announcement.
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 NFI_PROXYLOGIC_MODULE_H
#define NFI_PROXYLOGIC_MODULE_H
#include "NFIModule.h"
/*
A user's attributes and the length of the table is fixed in this module,
and all of the data of the user only attribute data and table data.
*/
class NFIProxyLogicModule
: public NFIModule
{
public:
protected:
private:
};
#endif |
/* $NetBSD: dsn_print.c,v 1.1.1.1 2009/06/23 10:08:45 tron Exp $ */
/*++
/* NAME
/* dsn_print
/* SUMMARY
/* write DSN structure to stream
/* SYNOPSIS
/* #include <dsn_print.h>
/*
/* int dsn_print(print_fn, stream, flags, ptr)
/* ATTR_PRINT_MASTER_FN print_fn;
/* VSTREAM *stream;
/* int flags;
/* void *ptr;
/* DESCRIPTION
/* dsn_print() writes a DSN structure to the named stream using
/* the specified attribute print routine. dsn_print() is meant
/* to be passed as a call-back to attr_print(), thusly:
/*
/* ... ATTR_TYPE_FUNC, dsn_print, (void *) dsn, ...
/* DIAGNOSTICS
/* Fatal: out of memory.
/* LICENSE
/* .ad
/* .fi
/* The Secure Mailer license must be distributed with this software.
/* AUTHOR(S)
/* Wietse Venema
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*--*/
/* System library. */
#include <sys_defs.h>
/* Utility library. */
#include <attr.h>
/* Global library. */
#include <mail_proto.h>
#include <dsn_print.h>
/* dsn_print - write DSN to stream */
int dsn_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
int flags, void *ptr)
{
DSN *dsn = (DSN *) ptr;
int ret;
/*
* The attribute order is determined by backwards compatibility. It can
* be sanitized after all the ad-hoc DSN read/write code is replaced.
*/
ret = print_fn(fp, flags | ATTR_FLAG_MORE,
ATTR_TYPE_STR, MAIL_ATTR_DSN_STATUS, dsn->status,
ATTR_TYPE_STR, MAIL_ATTR_DSN_DTYPE, dsn->dtype,
ATTR_TYPE_STR, MAIL_ATTR_DSN_DTEXT, dsn->dtext,
ATTR_TYPE_STR, MAIL_ATTR_DSN_MTYPE, dsn->mtype,
ATTR_TYPE_STR, MAIL_ATTR_DSN_MNAME, dsn->mname,
ATTR_TYPE_STR, MAIL_ATTR_DSN_ACTION, dsn->action,
ATTR_TYPE_STR, MAIL_ATTR_WHY, dsn->reason,
ATTR_TYPE_END);
return (ret);
}
|
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Joystick.rc
//
#define IDI_MAIN 102
#define IDD_JOYST_IMM 103
#define IDR_ACCELERATOR1 103
#define IDC_CLOSE 1001
#define IDC_X_AXIS 1010
#define IDC_Y_AXIS 1011
#define IDC_Z_AXIS 1012
#define IDC_X_AXIS_TEXT 1013
#define IDC_Y_AXIS_TEXT 1014
#define IDC_Z_AXIS_TEXT 1015
#define IDC_X_ROT_TEXT 1016
#define IDC_Y_ROT_TEXT 1017
#define IDC_Z_ROT_TEXT 1018
#define IDC_SLIDER0_TEXT 1019
#define IDC_X_ROT 1020
#define IDC_Y_ROT 1021
#define IDC_Z_ROT 1022
#define IDC_SLIDER1_TEXT 1023
#define IDC_POV0_TEXT 1024
#define IDC_POV1_TEXT 1025
#define IDC_POV2_TEXT 1026
#define IDC_POV3_TEXT 1027
#define IDC_SLIDER0 1030
#define IDC_SLIDER1 1031
#define IDC_POV 1040
#define IDC_POV0 1040
#define IDC_BUTTONS 1041
#define IDC_POV1 1042
#define IDC_POV2 1043
#define IDC_POV3 1044
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1025
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|
// NOTE: This file was generated by the ServiceGenerator.
// ----------------------------------------------------------------------------
// API:
// Version History API (versionhistory/v1)
// Description:
// Version History API - Prod
// Documentation:
// https://developers.chrome.com/versionhistory
#if SWIFT_PACKAGE || GTLR_USE_MODULAR_IMPORT
@import GoogleAPIClientForRESTCore;
#elif GTLR_BUILT_AS_FRAMEWORK
#import "GTLR/GTLRService.h"
#else
#import "GTLRService.h"
#endif
#if GTLR_RUNTIME_VERSION != 3000
#error This file was generated by a different version of ServiceGenerator which is incompatible with this GTLR library source.
#endif
// Generated comments include content from the discovery document; avoid them
// causing warnings since clang's checks are some what arbitrary.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
NS_ASSUME_NONNULL_BEGIN
/**
* Service for executing Version History API queries.
*
* Version History API - Prod
*/
@interface GTLRVersionHistoryService : GTLRService
// No new methods
// Clients should create a standard query with any of the class methods in
// GTLRVersionHistoryQuery.h. The query can the be sent with GTLRService's
// execute methods,
//
// - (GTLRServiceTicket *)executeQuery:(GTLRQuery *)query
// completionHandler:(void (^)(GTLRServiceTicket *ticket,
// id object, NSError *error))handler;
// or
// - (GTLRServiceTicket *)executeQuery:(GTLRQuery *)query
// delegate:(id)delegate
// didFinishSelector:(SEL)finishedSelector;
//
// where finishedSelector has a signature of:
//
// - (void)serviceTicket:(GTLRServiceTicket *)ticket
// finishedWithObject:(id)object
// error:(NSError *)error;
//
// The object passed to the completion handler or delegate method
// is a subclass of GTLRObject, determined by the query method executed.
@end
NS_ASSUME_NONNULL_END
#pragma clang diagnostic pop
|
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
/**
*
* create the files in batch
*
**/
int
createWRFileInBatch (int fileHandlerArray[], int fileHandlerArraySize)
{
int retValue = 0;
if (fileHandlerArray != NULL && fileHandlerArraySize > 0)
{
for (int i = 0; i < fileHandlerArraySize; i++)
{
fileHandlerArray[i] = -1;
}
for (int i = 0; i < fileHandlerArraySize; i++)
{
char buffer[64];
int n = sprintf (buffer, "tmp.%03d", i);
fileHandlerArray[i] = open (buffer, O_CREAT | O_WRONLY | O_TRUNC, S_IRWXU);
}
}
return retValue;
}
/**
*
* create the files in batch
*
**/
int
createRDFileInBatch (int fileHandlerArray[], int fileHandlerArraySize)
{
int retValue = 0;
if (fileHandlerArray != NULL && fileHandlerArraySize > 0)
{
for (int i = 0; i < fileHandlerArraySize; i++)
{
fileHandlerArray[i] = -1;
}
for (int i = 0; i < fileHandlerArraySize; i++)
{
char buffer[64];
int n = sprintf (buffer, "tmp.%03d", i);
fileHandlerArray[i] = open (buffer, O_RDONLY);
}
}
return retValue;
}
/**
*
* close the files in batch
*
**/
int
closeFileInBatch (int fileHandlerArray[], int fileHandlerArraySize)
{
int retValue = 0;
if (fileHandlerArray != NULL && fileHandlerArraySize > 0)
{
for (int i = 0; i < fileHandlerArraySize; i++)
{
int fd = fileHandlerArray[i];
if (fd >= 0)
{
close (fd);
fileHandlerArray[i] = -1;
}
}
}
return retValue;
}
/**
*
* create target file (parent file)
*
**/
int
createTargetFile (char *fileName)
{
int retValue = -1;
retValue = open (fileName, O_WRONLY | O_CREAT | O_APPEND, S_IRWXU);
return retValue;
}
int
closeTargetfile (int fd)
{
int retValue = 0;
if (fd > -1)
{
close (fd);
}
return retValue;
}
/**
*
* copy all children file to a parent file in sequence.
*
**/
int
mergeFile (int targetFileHandler, int fileHandlerArray[],
int fileHandlerArraySize, int useWindowsStyle)
{
int retValue = 0;
printf("\nmerging");
if (fileHandlerArray != NULL && fileHandlerArraySize > 0
&& targetFileHandler > 0)
{
char buffer[8096];
for (int i = 0; i < fileHandlerArraySize; i++)
{
int childFd = fileHandlerArray[i];
long writeCount = 0;
if (childFd >= 0)
{
char buf[8192];
int foundNewLine = 0;
while (1)
{
ssize_t result = read (childFd, &buf[0], sizeof (buf));
if (!result)
break;
//fprintf(stderr, " the read result is %d \n", result);
if(foundNewLine) {
int count = write (targetFileHandler, &buf[0], result);
writeCount += count;
printf(".");
} else {
for(size_t j=0; j< result -4 ; j++) {
if(useWindowsStyle) {
if(buf[j] == '\r' && buf[j+1] == '\n' && buf[j+2] == '\r' && buf[j+3] == '\n') {
//printf ("windows %d found end at %d \n", i, j);
int count = write(targetFileHandler, &buf[j+4], (result - j - 4));
foundNewLine = 1;
writeCount += count;
break;
}
} else {
if(buf[j] == '\n' && buf[j+1] == '\n') {
//printf (" linux %d found end at %d \n", i, j);
int count = write(targetFileHandler, &buf[j+2], (result - j - 2));
foundNewLine = 1;
writeCount += count;
break;
}
}
}
}
}
//printf (" %d => %ld \n", i, writeCount);
}
}
}
return retValue;
}
|
/* main.c - Application main entry point */
/*
* Copyright (c) 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 <stdint.h>
#include <stddef.h>
#include <string.h>
#include <errno.h>
#include <misc/printk.h>
#include <misc/byteorder.h>
#include <zephyr.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/conn.h>
#include <bluetooth/uuid.h>
#include <bluetooth/gatt.h>
#include <gatt/gap.h>
#include <gatt/dis.h>
#include <gatt/bas.h>
#include <gatt/hog.h>
#define DEVICE_NAME "Test HoG mouse"
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define HOG_APPEARANCE 0x03c2
static const struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA_BYTES(BT_DATA_UUID16_ALL,
0x12, 0x18, /* HID Service */
0x0f, 0x18), /* Battery Service */
};
static const struct bt_data sd[] = {
BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
};
static void connected(struct bt_conn *conn, uint8_t err)
{
char addr[BT_ADDR_LE_STR_LEN];
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
if (err) {
printk("Failed to connect to %s (%u)\n", addr, err);
return;
}
printk("Connected %s\n", addr);
if (bt_conn_security(conn, BT_SECURITY_MEDIUM)) {
printk("Failed to set security\n");
}
}
static void disconnected(struct bt_conn *conn, uint8_t reason)
{
char addr[BT_ADDR_LE_STR_LEN];
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
printk("Disconnected from %s (reason %u)\n", addr, reason);
}
static void security_changed(struct bt_conn *conn, bt_security_t level)
{
char addr[BT_ADDR_LE_STR_LEN];
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
printk("Security changed: %s level %u\n", addr, level);
}
static struct bt_conn_cb conn_callbacks = {
.connected = connected,
.disconnected = disconnected,
.security_changed = security_changed,
};
static void bt_ready(int err)
{
if (err) {
printk("Bluetooth init failed (err %d)\n", err);
return;
}
printk("Bluetooth initialized\n");
gap_init(DEVICE_NAME, HOG_APPEARANCE);
bas_init();
dis_init(CONFIG_SOC, "Manufacturer");
hog_init();
err = bt_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad),
sd, ARRAY_SIZE(sd));
if (err) {
printk("Advertising failed to start (err %d)\n", err);
return;
}
printk("Advertising successfully started\n");
}
static void auth_passkey_display(struct bt_conn *conn, unsigned int passkey)
{
char addr[BT_ADDR_LE_STR_LEN];
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
printk("Passkey for %s: %u\n", addr, passkey);
}
static void auth_cancel(struct bt_conn *conn)
{
char addr[BT_ADDR_LE_STR_LEN];
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
printk("Pairing cancelled: %s\n", addr);
}
static struct bt_conn_auth_cb auth_cb_display = {
.passkey_display = auth_passkey_display,
.passkey_entry = NULL,
.cancel = auth_cancel,
};
void main(void)
{
int err;
err = bt_enable(bt_ready);
if (err) {
printk("Bluetooth init failed (err %d)\n", err);
return;
}
bt_conn_cb_register(&conn_callbacks);
bt_conn_auth_cb_register(&auth_cb_display);
}
|
//
// WMCommentViewController.h
// 百思不得姐
//
// Created by 王蒙 on 15/8/2.
// Copyright (c) 2015年 wm. All rights reserved.
//
#import <UIKit/UIKit.h>
@class WMWordToip;
@interface WMCommentViewController : UIViewController
/**帖子模型*/
@property (nonatomic,strong) WMWordToip *wordToip;
@end
|
// TTTOrdinalNumberFormatter.h
//
// Copyright (c) 2011 Mattt Thompson (http://mattt.me)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
typedef enum {
TTTOrdinalNumberFormatterMaleGender = 1,
TTTOrdinalNumberFormatterFemaleGender = 2,
TTTOrdinalNumberFormatterNeuterGender = 3,
} TTTOrdinalNumberFormatterPredicateGrammaticalGender;
typedef enum {
TTTOrdinalNumberFormatterSingular = 1,
TTTOrdinalNumberFormatterDual = 2,
TTTOrdinalNumberFormatterTrial = 3,
TTTOrdinalNumberFormatterQuadral = 4,
TTTOrdinalNumberFormatterSingularCollective,
TTTOrdinalNumberFormatterPlural,
} TTTOrdinalNumberFormatterPredicateGrammaticalNumber;
@interface TTTOrdinalNumberFormatter : NSNumberFormatter {
@private
NSString *ordinalIndicator;
TTTOrdinalNumberFormatterPredicateGrammaticalGender grammaticalGender;
TTTOrdinalNumberFormatterPredicateGrammaticalNumber grammaticalNumber;
}
- (NSString *)ordinalIndicator;
- (void)setOrdinalIndicator:(NSString *)indicator;
- (TTTOrdinalNumberFormatterPredicateGrammaticalGender)grammaticalGender;
- (void)setGrammaticalGender:(TTTOrdinalNumberFormatterPredicateGrammaticalGender)gender;
- (TTTOrdinalNumberFormatterPredicateGrammaticalNumber)grammaticalNumber;
- (void)setGrammaticalNumber:(TTTOrdinalNumberFormatterPredicateGrammaticalNumber)number;
@end
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/core/client/AWSError.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/amplifyuibuilder/AmplifyUIBuilder_EXPORTS.h>
namespace Aws
{
namespace AmplifyUIBuilder
{
enum class AmplifyUIBuilderErrors
{
//From Core//
//////////////////////////////////////////////////////////////////////////////////////////
INCOMPLETE_SIGNATURE = 0,
INTERNAL_FAILURE = 1,
INVALID_ACTION = 2,
INVALID_CLIENT_TOKEN_ID = 3,
INVALID_PARAMETER_COMBINATION = 4,
INVALID_QUERY_PARAMETER = 5,
INVALID_PARAMETER_VALUE = 6,
MISSING_ACTION = 7, // SDK should never allow
MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
MISSING_PARAMETER = 9, // SDK should never allow
OPT_IN_REQUIRED = 10,
REQUEST_EXPIRED = 11,
SERVICE_UNAVAILABLE = 12,
THROTTLING = 13,
VALIDATION = 14,
ACCESS_DENIED = 15,
RESOURCE_NOT_FOUND = 16,
UNRECOGNIZED_CLIENT = 17,
MALFORMED_QUERY_STRING = 18,
SLOW_DOWN = 19,
REQUEST_TIME_TOO_SKEWED = 20,
INVALID_SIGNATURE = 21,
SIGNATURE_DOES_NOT_MATCH = 22,
INVALID_ACCESS_KEY_ID = 23,
REQUEST_TIMEOUT = 24,
NETWORK_CONNECTION = 99,
UNKNOWN = 100,
///////////////////////////////////////////////////////////////////////////////////////////
INTERNAL_SERVER= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1,
INVALID_PARAMETER,
RESOURCE_CONFLICT,
SERVICE_QUOTA_EXCEEDED
};
class AWS_AMPLIFYUIBUILDER_API AmplifyUIBuilderError : public Aws::Client::AWSError<AmplifyUIBuilderErrors>
{
public:
AmplifyUIBuilderError() {}
AmplifyUIBuilderError(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<AmplifyUIBuilderErrors>(rhs) {}
AmplifyUIBuilderError(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<AmplifyUIBuilderErrors>(rhs) {}
AmplifyUIBuilderError(const Aws::Client::AWSError<AmplifyUIBuilderErrors>& rhs) : Aws::Client::AWSError<AmplifyUIBuilderErrors>(rhs) {}
AmplifyUIBuilderError(Aws::Client::AWSError<AmplifyUIBuilderErrors>&& rhs) : Aws::Client::AWSError<AmplifyUIBuilderErrors>(rhs) {}
template <typename T>
T GetModeledError();
};
namespace AmplifyUIBuilderErrorMapper
{
AWS_AMPLIFYUIBUILDER_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
}
} // namespace AmplifyUIBuilder
} // namespace Aws
|
//===--- lib/CodeGen/DebugLocStream.h - DWARF debug_loc stream --*- C++ -*-===//
//
// Part of the LLVM Project, 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 LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCSTREAM_H
#define LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCSTREAM_H
#include "ByteStreamer.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
namespace llvm {
class AsmPrinter;
class DbgVariable;
class DwarfCompileUnit;
class MachineInstr;
class MCSymbol;
/// Byte stream of .debug_loc entries.
///
/// Stores a unified stream of .debug_loc entries. There's \a List for each
/// variable/inlined-at pair, and an \a Entry for each \a DebugLocEntry.
///
/// FIXME: Do we need all these temp symbols?
/// FIXME: Why not output directly to the output stream?
class DebugLocStream {
public:
struct List {
DwarfCompileUnit *CU;
MCSymbol *Label = nullptr;
size_t EntryOffset;
List(DwarfCompileUnit *CU, size_t EntryOffset)
: CU(CU), EntryOffset(EntryOffset) {}
};
struct Entry {
const MCSymbol *Begin;
const MCSymbol *End;
size_t ByteOffset;
size_t CommentOffset;
};
private:
SmallVector<List, 4> Lists;
SmallVector<Entry, 32> Entries;
SmallString<256> DWARFBytes;
std::vector<std::string> Comments;
MCSymbol *Sym;
/// Only verbose textual output needs comments. This will be set to
/// true for that case, and false otherwise.
bool GenerateComments;
public:
DebugLocStream(bool GenerateComments) : GenerateComments(GenerateComments) { }
size_t getNumLists() const { return Lists.size(); }
const List &getList(size_t LI) const { return Lists[LI]; }
ArrayRef<List> getLists() const { return Lists; }
MCSymbol *getSym() const {
return Sym;
}
void setSym(MCSymbol *Sym) {
this->Sym = Sym;
}
class ListBuilder;
class EntryBuilder;
private:
/// Start a new .debug_loc entry list.
///
/// Start a new .debug_loc entry list. Return the new list's index so it can
/// be retrieved later via \a getList().
///
/// Until the next call, \a startEntry() will add entries to this list.
size_t startList(DwarfCompileUnit *CU) {
size_t LI = Lists.size();
Lists.emplace_back(CU, Entries.size());
return LI;
}
/// Finalize a .debug_loc entry list.
///
/// If there are no entries in this list, delete it outright. Otherwise,
/// create a label with \a Asm.
///
/// \return false iff the list is deleted.
bool finalizeList(AsmPrinter &Asm);
/// Start a new .debug_loc entry.
///
/// Until the next call, bytes added to the stream will be added to this
/// entry.
void startEntry(const MCSymbol *BeginSym, const MCSymbol *EndSym) {
assert(&BeginSym->getSection() == &EndSym->getSection() &&
"debug_loc entries cannot span across multiple sections");
Entries.push_back({BeginSym, EndSym, DWARFBytes.size(), Comments.size()});
}
/// Finalize a .debug_loc entry, deleting if it's empty.
void finalizeEntry();
public:
BufferByteStreamer getStreamer() {
return BufferByteStreamer(DWARFBytes, Comments, GenerateComments);
}
ArrayRef<Entry> getEntries(const List &L) const {
size_t LI = getIndex(L);
return makeArrayRef(Entries)
.slice(Lists[LI].EntryOffset, getNumEntries(LI));
}
ArrayRef<char> getBytes(const Entry &E) const {
size_t EI = getIndex(E);
return makeArrayRef(DWARFBytes.begin(), DWARFBytes.end())
.slice(Entries[EI].ByteOffset, getNumBytes(EI));
}
ArrayRef<std::string> getComments(const Entry &E) const {
size_t EI = getIndex(E);
return makeArrayRef(Comments)
.slice(Entries[EI].CommentOffset, getNumComments(EI));
}
private:
size_t getIndex(const List &L) const {
assert(&Lists.front() <= &L && &L <= &Lists.back() &&
"Expected valid list");
return &L - &Lists.front();
}
size_t getIndex(const Entry &E) const {
assert(&Entries.front() <= &E && &E <= &Entries.back() &&
"Expected valid entry");
return &E - &Entries.front();
}
size_t getNumEntries(size_t LI) const {
if (LI + 1 == Lists.size())
return Entries.size() - Lists[LI].EntryOffset;
return Lists[LI + 1].EntryOffset - Lists[LI].EntryOffset;
}
size_t getNumBytes(size_t EI) const {
if (EI + 1 == Entries.size())
return DWARFBytes.size() - Entries[EI].ByteOffset;
return Entries[EI + 1].ByteOffset - Entries[EI].ByteOffset;
}
size_t getNumComments(size_t EI) const {
if (EI + 1 == Entries.size())
return Comments.size() - Entries[EI].CommentOffset;
return Entries[EI + 1].CommentOffset - Entries[EI].CommentOffset;
}
};
/// Builder for DebugLocStream lists.
class DebugLocStream::ListBuilder {
DebugLocStream &Locs;
AsmPrinter &Asm;
DbgVariable &V;
const MachineInstr &MI;
size_t ListIndex;
Optional<uint8_t> TagOffset;
public:
ListBuilder(DebugLocStream &Locs, DwarfCompileUnit &CU, AsmPrinter &Asm,
DbgVariable &V, const MachineInstr &MI)
: Locs(Locs), Asm(Asm), V(V), MI(MI), ListIndex(Locs.startList(&CU)),
TagOffset(None) {}
void setTagOffset(uint8_t TO) {
TagOffset = TO;
}
/// Finalize the list.
///
/// If the list is empty, delete it. Otherwise, finalize it by creating a
/// temp symbol in \a Asm and setting up the \a DbgVariable.
~ListBuilder();
DebugLocStream &getLocs() { return Locs; }
};
/// Builder for DebugLocStream entries.
class DebugLocStream::EntryBuilder {
DebugLocStream &Locs;
public:
EntryBuilder(ListBuilder &List, const MCSymbol *Begin, const MCSymbol *End)
: Locs(List.getLocs()) {
Locs.startEntry(Begin, End);
}
/// Finalize the entry, deleting it if it's empty.
~EntryBuilder() { Locs.finalizeEntry(); }
BufferByteStreamer getStreamer() { return Locs.getStreamer(); }
};
} // namespace llvm
#endif
|
#ifndef LIBWEBP_NO_SRC
#include "../../libwebp_src/src/dsp/dsp.h"
#endif
|
//
// KLSubmitOrderViewController.h
// siRuiLogistics
//
// Created by desunire on 2017/9/27.
// Copyright © 2017年 desunire. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface KLSubmitOrderViewController : UIViewController
@end
|
// bslstl_badweakptr.h -*-C++-*-
#ifndef INCLUDED_BSLSTL_BADWEAKPTR
#define INCLUDED_BSLSTL_BADWEAKPTR
#include <bsls_ident.h>
BSLS_IDENT("$Id: $")
//@PURPOSE: Provide an exception class to indicate a weak_ptr has expired.
//
//@CLASSES:
// bslstl::BadWeakPtr: exception class derived from 'native_std' classes
// bsl::bad_weak_ptr: alias to an exception type thrown by the 'bsl' library
//
//@SEE_ALSO: bslstl_sharedptr, bslstl_stdexceptionutil
//
//@DESCRIPTION: This component provides ...
//
///Usage
///-----
// This section illustrates intended use of this component.
//
///Example 1: TBD
/// - - - - - - -
// Prevent 'bslstl' headers from being included directly in 'BSL_OVERRIDES_STD'
// mode. Doing so is unsupported, and is likely to cause compilation errors.
#if defined(BSL_OVERRIDES_STD) && !defined(BOS_STDHDRS_PROLOGUE_IN_EFFECT)
#error "include <bsl_memory.h> instead of <bslstl_badweakptr.h> in \
BSL_OVERRIDES_STD mode"
#endif
#include <bslscm_version.h>
#include <bsls_exceptionutil.h>
#include <bsls_keyword.h>
#include <bsls_nativestd.h>
#include <exception>
#include <memory> // 'std::bad_weak_ptr' if defined
namespace BloombergLP {
namespace bslstl { class BadWeakPtr; }
} // close enterprise namespace
namespace bsl {
#if 0
typedef native_std::bad_weak_ptr bad_weak_ptr;
#else
typedef ::BloombergLP::bslstl::BadWeakPtr bad_weak_ptr;
#endif
} // close namespace bsl
namespace BloombergLP {
namespace bslstl {
// ================
// class BadWeakPtr
// ================
class BadWeakPtr : public native_std::exception {
public:
BadWeakPtr() BSLS_KEYWORD_NOEXCEPT;
// Create a 'BadWeakPtr' object. Note that this function is explicitly
// user-declared, to make it simple to declare 'const' objects of this
// type.
// ACCESSORS
const char *what() const BSLS_EXCEPTION_WHAT_NOTHROW BSLS_KEYWORD_OVERRIDE;
// Return a pointer to the string literal "bad_weak_ptr", with a
// storage duration of the lifetime of the program. Note that the
// caller should *not* attempt to free this memory. Note that the
// 'bsls_exceptionutil' macro 'BSLS_NOTHROW_SPEC' is deliberately not
// used here, as a number of standard libraries declare 'what' in the
// base 'exception' class explicitly with the no-throw specification,
// even in a build that may not recognize exceptions.
};
// ============================================================================
// INLINE DEFINITIONS
// ============================================================================
// ----------------
// class BadWeakPtr
// ----------------
inline
BadWeakPtr::BadWeakPtr() BSLS_KEYWORD_NOEXCEPT
: native_std::exception()
{
}
inline
const char *BadWeakPtr::what() const BSLS_EXCEPTION_WHAT_NOTHROW
{
return "bad_weak_ptr";
}
} // close package namespace
} // close enterprise namespace
#endif
// ----------------------------------------------------------------------------
// Copyright 2013 Bloomberg Finance L.P.
//
// 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.
// ----------------------------- END-OF-FILE ----------------------------------
|
//
// AppDelegate.h
// LZThreadPro04GCD
//
// Created by comst on 15/10/7.
// Copyright (c) 2015年 com.comst1314. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_ValueType3507792607.h"
// System.Collections.Generic.List`1<UnityEngine.EventSystems.IEventSystemHandler>
struct List_1_t2110309450;
// UnityEngine.EventSystems.IEventSystemHandler
struct IEventSystemHandler_t2741188318;
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Collections.Generic.List`1/Enumerator<UnityEngine.EventSystems.IEventSystemHandler>
struct Enumerator_t1645039124
{
public:
// System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::l
List_1_t2110309450 * ___l_0;
// System.Int32 System.Collections.Generic.List`1/Enumerator::next
int32_t ___next_1;
// System.Int32 System.Collections.Generic.List`1/Enumerator::ver
int32_t ___ver_2;
// T System.Collections.Generic.List`1/Enumerator::current
Il2CppObject * ___current_3;
public:
inline static int32_t get_offset_of_l_0() { return static_cast<int32_t>(offsetof(Enumerator_t1645039124, ___l_0)); }
inline List_1_t2110309450 * get_l_0() const { return ___l_0; }
inline List_1_t2110309450 ** get_address_of_l_0() { return &___l_0; }
inline void set_l_0(List_1_t2110309450 * value)
{
___l_0 = value;
Il2CppCodeGenWriteBarrier(&___l_0, value);
}
inline static int32_t get_offset_of_next_1() { return static_cast<int32_t>(offsetof(Enumerator_t1645039124, ___next_1)); }
inline int32_t get_next_1() const { return ___next_1; }
inline int32_t* get_address_of_next_1() { return &___next_1; }
inline void set_next_1(int32_t value)
{
___next_1 = value;
}
inline static int32_t get_offset_of_ver_2() { return static_cast<int32_t>(offsetof(Enumerator_t1645039124, ___ver_2)); }
inline int32_t get_ver_2() const { return ___ver_2; }
inline int32_t* get_address_of_ver_2() { return &___ver_2; }
inline void set_ver_2(int32_t value)
{
___ver_2 = value;
}
inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t1645039124, ___current_3)); }
inline Il2CppObject * get_current_3() const { return ___current_3; }
inline Il2CppObject ** get_address_of_current_3() { return &___current_3; }
inline void set_current_3(Il2CppObject * value)
{
___current_3 = value;
Il2CppCodeGenWriteBarrier(&___current_3, value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#ifndef LIGHTH
#define LIGHTH
struct Wall
{
Wall (sf::Vector2f p1,sf::Vector2f p2)
{
pt1=p1;
pt2=p2;
}
// Pt1 et Pt2 sont les deux extrémités du mur
sf::Vector2f pt1;
sf::Vector2f pt2;
};
// Wall_Entity est une variable qui permet de représenter dans le programme un mur
struct Wall_Entity
{
Wall_Entity (int id)
{
m_ID=id;
}
int ID() { return m_ID; }
private:
int m_ID;
};
// Light_Entity est une variable qui permet de représenter dans le programme une lumière
struct Light_Entity
{
Light_Entity (){m_Dynamic=false,m_ID=0;}
Light_Entity (int id,bool d)
{
m_ID=id;
m_Dynamic=d;
}
int ID() { return m_ID; }
bool Dynamic() { return m_Dynamic; }
private:
int m_ID;
bool m_Dynamic;
};
class Light
{
public :
// Constructeur et destructeur
Light();
Light(sf::Vector2f position, float intensity, float radius, int quality, sf::Color color);
~Light();
// Afficher la lumière
void Draw(sf::RenderTarget *App);
// Calculer la lumière
virtual void Generate(std::vector <Wall> &m_wall);
// Ajouter un triangle à la lumière, en effet, les lumières sont composée de triangles
void AddTriangle(sf::Vector2f pt1,sf::Vector2f pt2, int minimum_wall,std::vector <Wall> &m_wall);
// Changer différents attributs de la lumière
void SetIntensity(float);
void SetRadius(float);
void SetQuality(int);
void SetColor(sf::Color);
void SetPosition(sf::Vector2f);
virtual void SetOtherParameter(unsigned, float);
// Retourner différents attributs de la lumière
float GetIntensity();
float GetRadius();
int GetQuality();
sf::Color GetColor();
sf::Vector2f GetPosition();
// Une petite bool pour savoir si la lumière est allumée ou éteinte
bool m_actif;
protected :
//Position à l'écran
sf::Vector2f m_position;
//Intensité, gère la transparence ( entre 0 et 255 )
float m_intensity;
//Rayon de la lumière
float m_radius;
//Couleur de la lumière
sf::Color m_color;
//Tableau dynamique de Shape, ce sont ces shapes de type triangle qui compose la lumière
std::vector <sf::VertexArray> m_shape;
private :
//Qualité de la lumière, c'est à dire le nombre de triangles par défaut qui la compose.
int m_quality;
};
#endif
|
/*
*
* Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/NoticeExplan/
*
*/
// -*- C++ -*-
/*
* Copyright (C) 1990,91 Silicon Graphics, Inc.
*
_______________________________________________________________________
______________ S I L I C O N G R A P H I C S I N C . ____________
|
| $Revision: 1.1.1.1 $
|
| Description:
| This file defines the SoGLCoordinateElement class.
|
| Author(s) : Paul S. Strauss
|
______________ S I L I C O N G R A P H I C S I N C . ____________
_______________________________________________________________________
*/
#ifndef _SO_GL_COORDINATE_ELEMENT
#define _SO_GL_COORDINATE_ELEMENT
#include <Inventor/elements/SoCoordinateElement.h>
//////////////////////////////////////////////////////////////////////////////
//
// Class: SoGLCoordinateElement
//
// Element that stores the current coordinates. Adds methods to
// send the surface coordinate to GL on demand. The coordinates are
// sent in the appropriate form, depending on whether they are stored
// as 3-D or 4-D values.
//
// Note that this class relies on SoCoordinateElement to store the
// coordinates in the instance.
//
//////////////////////////////////////////////////////////////////////////////
SoEXTENDER class INVENTOR_API SoGLCoordinateElement : public SoCoordinateElement {
SO_ELEMENT_HEADER(SoGLCoordinateElement);
public:
// Sends indexed coordinate to GL
void send(int index) const;
SoINTERNAL public:
// Initializes the SoGLCoordinateElement class
static void initClass();
protected:
virtual ~SoGLCoordinateElement();
};
#endif /* _SO_GL_COORDINATE_ELEMENT */
|
/*
* Copyright (c) 1999-2000 Image Power, Inc. and the University of
* British Columbia.
* Copyright (c) 2001-2004 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") 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, 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:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "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 OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
/*
* Tree-Structured Filter Bank (TSFB) Library
*
* $Id$
*/
#ifndef JPC_TSFB_H
#define JPC_TSFB_H
/******************************************************************************\
* Includes.
\******************************************************************************/
#include "jasper/jas_seq.h"
#include "jpc_fix.h"
#include "jpc_qmfb.h"
/******************************************************************************\
* Constants.
\******************************************************************************/
#define JPC_TSFB_MAXBANDS (JPC_TSFB_MAXDEPTH * 3 + 1)
#define JPC_TSFB_MAXDEPTH 32
#define JPC_TSFB_RITIMODE JPC_QMFB1D_RITIMODE
#define JPC_TSFB_LL 0
#define JPC_TSFB_LH 1
#define JPC_TSFB_HL 2
#define JPC_TSFB_HH 3
/******************************************************************************\
* Types.
\******************************************************************************/
typedef struct {
int xstart;
int ystart;
int xend;
int yend;
int orient;
int locxstart;
int locystart;
int locxend;
int locyend;
jpc_fix_t synenergywt;
} jpc_tsfb_band_t;
typedef struct {
int numlvls;
jpc_qmfb2d_t *qmfb;
} jpc_tsfb_t;
/******************************************************************************\
* Functions.
\******************************************************************************/
/* Create a TSFB. */
jpc_tsfb_t *jpc_cod_gettsfb(int qmfbid, int numlevels);
/* Destroy a TSFB. */
void jpc_tsfb_destroy(jpc_tsfb_t *tsfb);
/* Perform analysis. */
int jpc_tsfb_analyze(jpc_tsfb_t *tsfb, jas_seq2d_t *x);
/* Perform synthesis. */
int jpc_tsfb_synthesize(jpc_tsfb_t *tsfb, jas_seq2d_t *x);
int jpc_tsfb_analyze2(jpc_tsfb_t *tsfb, jpc_fix_t *a, int xstart, int ystart,
int width, int height, int stride, int numlvls);
int jpc_tsfb_synthesize2(jpc_tsfb_t *tsfb, jpc_fix_t *a, int xstart, int ystart,
int width, int height, int stride, int numlvls);
/* Get band information for a TSFB. */
int jpc_tsfb_getbands(jpc_tsfb_t *tsfb, uint_fast32_t xstart,
uint_fast32_t ystart, uint_fast32_t xend, uint_fast32_t yend,
jpc_tsfb_band_t *bands);
#endif
|
#ifndef DEF_GLUT_MGT
#define DEF_GLUT_MGT
#include <iostream>
#include <GL/gl.h>
#include <GL/glut.h>
#include <boost/thread/thread.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#define KEY_ESCAPE 27
#define CHKERR if (glGetError() != GL_NO_ERROR) printf("** I screwed up something\n");
typedef struct {
int width;
int height;
std::string title;
float view_angle;
float z_near;
float z_far;
} glutWindow;
typedef struct {
float eye_x;
float eye_y;
float eye_z;
float observed_x;
float observed_y;
float observed_z;
float sky_x;
float sky_y;
float sky_z;
} glutGlass;
typedef struct {
float x;
float y;
float z;
float r;
float g;
float b;
} point3D;
/**
*
*/
class GlutManager
{
public:
GlutManager();
~GlutManager();
static void keyboardHandler(unsigned char key, int x, int y);
static void mouseHandler(int button, int state, int x, int y);
static void pMouseMotionHandler(int x, int y);
static void idle(void);
static void reshape(int x, int y);
static void display(void);
void initialize();
void mainLoop(int argc, char** argv);
protected:
static int windowId;
int pressed;
glutWindow win;
glutGlass glass;
};
#endif
|
/*
* 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/ec2/EC2_EXPORTS.h>
#include <aws/ec2/EC2Request.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/ec2/model/NewDhcpConfiguration.h>
#include <utility>
namespace Aws
{
namespace EC2
{
namespace Model
{
/**
* <p>Contains the parameters for CreateDhcpOptions.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDhcpOptionsRequest">AWS
* API Reference</a></p>
*/
class AWS_EC2_API CreateDhcpOptionsRequest : public EC2Request
{
public:
CreateDhcpOptionsRequest();
Aws::String SerializePayload() const override;
protected:
void DumpBodyToUrl(Aws::Http::URI& uri ) const override;
public:
/**
* <p>A DHCP configuration option.</p>
*/
inline const Aws::Vector<NewDhcpConfiguration>& GetDhcpConfigurations() const{ return m_dhcpConfigurations; }
/**
* <p>A DHCP configuration option.</p>
*/
inline void SetDhcpConfigurations(const Aws::Vector<NewDhcpConfiguration>& value) { m_dhcpConfigurationsHasBeenSet = true; m_dhcpConfigurations = value; }
/**
* <p>A DHCP configuration option.</p>
*/
inline void SetDhcpConfigurations(Aws::Vector<NewDhcpConfiguration>&& value) { m_dhcpConfigurationsHasBeenSet = true; m_dhcpConfigurations = std::move(value); }
/**
* <p>A DHCP configuration option.</p>
*/
inline CreateDhcpOptionsRequest& WithDhcpConfigurations(const Aws::Vector<NewDhcpConfiguration>& value) { SetDhcpConfigurations(value); return *this;}
/**
* <p>A DHCP configuration option.</p>
*/
inline CreateDhcpOptionsRequest& WithDhcpConfigurations(Aws::Vector<NewDhcpConfiguration>&& value) { SetDhcpConfigurations(std::move(value)); return *this;}
/**
* <p>A DHCP configuration option.</p>
*/
inline CreateDhcpOptionsRequest& AddDhcpConfigurations(const NewDhcpConfiguration& value) { m_dhcpConfigurationsHasBeenSet = true; m_dhcpConfigurations.push_back(value); return *this; }
/**
* <p>A DHCP configuration option.</p>
*/
inline CreateDhcpOptionsRequest& AddDhcpConfigurations(NewDhcpConfiguration&& value) { m_dhcpConfigurationsHasBeenSet = true; m_dhcpConfigurations.push_back(std::move(value)); return *this; }
/**
* <p>Checks whether you have the required permissions for the action, without
* actually making the request, and provides an error response. If you have the
* required permissions, the error response is <code>DryRunOperation</code>.
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
*/
inline bool GetDryRun() const{ return m_dryRun; }
/**
* <p>Checks whether you have the required permissions for the action, without
* actually making the request, and provides an error response. If you have the
* required permissions, the error response is <code>DryRunOperation</code>.
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
*/
inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; }
/**
* <p>Checks whether you have the required permissions for the action, without
* actually making the request, and provides an error response. If you have the
* required permissions, the error response is <code>DryRunOperation</code>.
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
*/
inline CreateDhcpOptionsRequest& WithDryRun(bool value) { SetDryRun(value); return *this;}
private:
Aws::Vector<NewDhcpConfiguration> m_dhcpConfigurations;
bool m_dhcpConfigurationsHasBeenSet;
bool m_dryRun;
bool m_dryRunHasBeenSet;
};
} // namespace Model
} // namespace EC2
} // namespace Aws
|
#ifndef LPC_INCL_H
#define LPC_INCL_H
#include "std.h"
#include "include/function.h"
#include "include/origin.h"
#include "config.h"
#include "applies.h"
#include "main.h"
#include "program.h"
#include "buffer.h"
#include "interpret.h"
#include "simulate.h"
#include "file.h"
#include "stralloc.h"
#endif
|
/*
* 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/elasticloadbalancing/ElasticLoadBalancing_EXPORTS.h>
#include <aws/elasticloadbalancing/ElasticLoadBalancingRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/elasticloadbalancing/model/Instance.h>
#include <utility>
namespace Aws
{
namespace ElasticLoadBalancing
{
namespace Model
{
/**
* <p>Contains the parameters for DescribeInstanceHealth.</p><p><h3>See Also:</h3>
* <a
* href="http://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeEndPointStateInput">AWS
* API Reference</a></p>
*/
class AWS_ELASTICLOADBALANCING_API DescribeInstanceHealthRequest : public ElasticLoadBalancingRequest
{
public:
DescribeInstanceHealthRequest();
// 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 "DescribeInstanceHealth"; }
Aws::String SerializePayload() const override;
protected:
void DumpBodyToUrl(Aws::Http::URI& uri ) const override;
public:
/**
* <p>The name of the load balancer.</p>
*/
inline const Aws::String& GetLoadBalancerName() const{ return m_loadBalancerName; }
/**
* <p>The name of the load balancer.</p>
*/
inline bool LoadBalancerNameHasBeenSet() const { return m_loadBalancerNameHasBeenSet; }
/**
* <p>The name of the load balancer.</p>
*/
inline void SetLoadBalancerName(const Aws::String& value) { m_loadBalancerNameHasBeenSet = true; m_loadBalancerName = value; }
/**
* <p>The name of the load balancer.</p>
*/
inline void SetLoadBalancerName(Aws::String&& value) { m_loadBalancerNameHasBeenSet = true; m_loadBalancerName = std::move(value); }
/**
* <p>The name of the load balancer.</p>
*/
inline void SetLoadBalancerName(const char* value) { m_loadBalancerNameHasBeenSet = true; m_loadBalancerName.assign(value); }
/**
* <p>The name of the load balancer.</p>
*/
inline DescribeInstanceHealthRequest& WithLoadBalancerName(const Aws::String& value) { SetLoadBalancerName(value); return *this;}
/**
* <p>The name of the load balancer.</p>
*/
inline DescribeInstanceHealthRequest& WithLoadBalancerName(Aws::String&& value) { SetLoadBalancerName(std::move(value)); return *this;}
/**
* <p>The name of the load balancer.</p>
*/
inline DescribeInstanceHealthRequest& WithLoadBalancerName(const char* value) { SetLoadBalancerName(value); return *this;}
/**
* <p>The IDs of the instances.</p>
*/
inline const Aws::Vector<Instance>& GetInstances() const{ return m_instances; }
/**
* <p>The IDs of the instances.</p>
*/
inline bool InstancesHasBeenSet() const { return m_instancesHasBeenSet; }
/**
* <p>The IDs of the instances.</p>
*/
inline void SetInstances(const Aws::Vector<Instance>& value) { m_instancesHasBeenSet = true; m_instances = value; }
/**
* <p>The IDs of the instances.</p>
*/
inline void SetInstances(Aws::Vector<Instance>&& value) { m_instancesHasBeenSet = true; m_instances = std::move(value); }
/**
* <p>The IDs of the instances.</p>
*/
inline DescribeInstanceHealthRequest& WithInstances(const Aws::Vector<Instance>& value) { SetInstances(value); return *this;}
/**
* <p>The IDs of the instances.</p>
*/
inline DescribeInstanceHealthRequest& WithInstances(Aws::Vector<Instance>&& value) { SetInstances(std::move(value)); return *this;}
/**
* <p>The IDs of the instances.</p>
*/
inline DescribeInstanceHealthRequest& AddInstances(const Instance& value) { m_instancesHasBeenSet = true; m_instances.push_back(value); return *this; }
/**
* <p>The IDs of the instances.</p>
*/
inline DescribeInstanceHealthRequest& AddInstances(Instance&& value) { m_instancesHasBeenSet = true; m_instances.push_back(std::move(value)); return *this; }
private:
Aws::String m_loadBalancerName;
bool m_loadBalancerNameHasBeenSet;
Aws::Vector<Instance> m_instances;
bool m_instancesHasBeenSet;
};
} // namespace Model
} // namespace ElasticLoadBalancing
} // namespace Aws
|
//
// MRDPCursor.h
// MacFreeRDP
//
// Created by Laxmikant Rashinkar
// Copyright (c) 2012 FreeRDP.org All rights reserved.
//
#import <Cocoa/Cocoa.h>
#include "freerdp/graphics.h"
@interface MRDPCursor : NSObject
{
@public
rdpPointer *pointer;
uint8 *cursor_data; // bitmapped pixel data
NSBitmapImageRep *bmiRep;
NSCursor *nsCursor;
NSImage *nsImage;
}
@end
|
/*
* Copyright (c) 2018 Arm Limited
*
* 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.
*/
/**
* \file gfc100_process_specific_api.h
*
* \brief Header file for the process specific part of the
* GFC100 flash controller
*/
#ifndef __GFC100_PROCESS_SPEC_API_H__
#define __GFC100_PROCESS_SPEC_API_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/**
* \brief Sets timing parameters on the process specific part
*
* \param[in] reg_map_base Process specific register map base
* \param[in] sys_clk System clock in Hz
*/
void gfc100_proc_spec_set_eflash_timing(uint32_t reg_map_base,
uint32_t sys_clk);
/**
* \brief Gets flash memory size
*
* \param[in] reg_map_base Process specific register map base
*
* \return Returns the size of the flash memory
*/
uint32_t gfc100_proc_spec_get_eflash_size(uint32_t reg_map_base);
/**
* \brief Gets flash page size
*
* \param[in] reg_map_base Process specific register map base
*
* \return Returns the page size of the flash memory
*/
uint32_t gfc100_proc_spec_get_eflash_page_size(uint32_t reg_map_base);
/**
* \brief Gets word width of the process specific part
*
* \param[in] reg_map_base Process specific register map base
*
* \return Returns word width of the process specific part
*/
uint32_t gfc100_proc_spec_get_eflash_word_width(uint32_t reg_map_base);
/**
* \brief Gets number of info pages
*
* \param[in] reg_map_base Process specific register map base
*
* \return Returns the number of info pages from the extended area
*/
uint32_t gfc100_proc_spec_get_num_of_info_pages(uint32_t reg_map_base);
/**
* \brief Gets process specific error bits
*
* \param[in] reg_map_base Process specific register map base
*
* \return Returns the error bits specified by the process specific part
* of the controller.
*/
uint32_t gfc100_proc_spec_get_error_cause(uint32_t reg_map_base);
#ifdef __cplusplus
}
#endif
#endif /* __GFC100_PROCESS_SPEC_API_H__ */
|
//---------------------------------------------------------- -*- Mode: C++ -*-
// $Id: ChunkServer.h 385 2010-05-27 15:58:30Z sriramsrao $
//
// Created 2006/03/16
//
// Copyright 2008 Quantcast Corp.
// Copyright 2006-2008 Kosmix Corp.
//
// This file is part of Kosmos File System (KFS).
//
// 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 _CHUNKSERVER_H
#define _CHUNKSERVER_H
#include "libkfsIO/TelemetryClient.h"
#include "ChunkManager.h"
#include "ClientManager.h"
#include "ClientSM.h"
#include "MetaServerSM.h"
#include "RemoteSyncSM.h"
namespace KFS
{
class ChunkServer {
public:
ChunkServer() : mOpCount(0), mKickNetThread(false) { };
void Init();
void MainLoop(int clientAcceptPort, const std::string & serverHostname);
bool IsLocalServer(const ServerLocation &location) const {
return mLocation == location;
}
RemoteSyncSMPtr FindServer(const ServerLocation &location,
bool connect = true);
void RemoveServer(RemoteSyncSM *target);
std::string GetMyLocation() const {
return mLocation.ToString();
}
void ToggleNetThreadKicking (bool v) {
mKickNetThread = v;
}
bool NeedToKickNetThread() {
return mKickNetThread;
}
void OpInserted() {
mOpCount++;
}
void OpFinished() {
mOpCount--;
if (mOpCount < 0)
mOpCount = 0;
}
int GetNumOps() const {
return mOpCount;
}
void SendTelemetryReport(KfsOp_t op, double timeSpent);
private:
int mClientAcceptPort;
// # of ops in the system
int mOpCount;
bool mKickNetThread;
ServerLocation mLocation;
std::list<RemoteSyncSMPtr> mRemoteSyncers;
// telemetry reporter...used for notifying slow writes thru this node
TelemetryClient mTelemetryReporter;
};
extern void verifyExecutingOnNetProcessor();
extern void verifyExecutingOnEventProcessor();
extern void StopNetProcessor(int status);
extern ChunkServer gChunkServer;
}
#endif // _CHUNKSERVER_H
|
#pragma once
#include <memory>
#include "extensions/filters/http/jwt_authn/authenticator.h"
#include "extensions/filters/http/jwt_authn/verifier.h"
#include "test/mocks/upstream/mocks.h"
#include "gmock/gmock.h"
using ::google::jwt_verify::Status;
namespace Envoy {
namespace Extensions {
namespace HttpFilters {
namespace JwtAuthn {
class MockAuthFactory : public AuthFactory {
public:
MOCK_METHOD(AuthenticatorPtr, create,
(const ::google::jwt_verify::CheckAudience*, const absl::optional<std::string>&, bool,
bool),
(const));
};
class MockAuthenticator : public Authenticator {
public:
MOCK_METHOD(void, doVerify,
(Http::HeaderMap & headers, Tracing::Span& parent_span,
std::vector<JwtLocationConstPtr>* tokens, SetPayloadCallback set_payload_cb,
AuthenticatorCallback callback));
void verify(Http::HeaderMap& headers, Tracing::Span& parent_span,
std::vector<JwtLocationConstPtr>&& tokens, SetPayloadCallback set_payload_cb,
AuthenticatorCallback callback) override {
doVerify(headers, parent_span, &tokens, std::move(set_payload_cb), std::move(callback));
}
MOCK_METHOD(void, onDestroy, ());
};
class MockVerifierCallbacks : public Verifier::Callbacks {
public:
MOCK_METHOD(void, setPayload, (const ProtobufWkt::Struct& payload));
MOCK_METHOD(void, onComplete, (const Status& status));
};
class MockVerifier : public Verifier {
public:
MOCK_METHOD(void, verify, (ContextSharedPtr context), (const));
};
class MockExtractor : public Extractor {
public:
MOCK_METHOD(std::vector<JwtLocationConstPtr>, extract, (const Http::HeaderMap& headers), (const));
MOCK_METHOD(void, sanitizePayloadHeaders, (Http::HeaderMap & headers), (const));
};
// A mock HTTP upstream with response body.
class MockUpstream {
public:
MockUpstream(Upstream::MockClusterManager& mock_cm, const std::string& response_body)
: request_(&mock_cm.async_client_), response_body_(response_body) {
ON_CALL(mock_cm.async_client_, send_(_, _, _))
.WillByDefault(
Invoke([this](Http::RequestMessagePtr&, Http::AsyncClient::Callbacks& cb,
const Http::AsyncClient::RequestOptions&) -> Http::AsyncClient::Request* {
Http::ResponseMessagePtr response_message(
new Http::ResponseMessageImpl(Http::ResponseHeaderMapPtr{
new Http::TestResponseHeaderMapImpl{{":status", "200"}}}));
response_message->body() = std::make_unique<Buffer::OwnedImpl>(response_body_);
cb.onSuccess(std::move(response_message));
called_count_++;
return &request_;
}));
}
int called_count() const { return called_count_; }
private:
Http::MockAsyncClientRequest request_;
std::string response_body_;
int called_count_{};
};
} // namespace JwtAuthn
} // namespace HttpFilters
} // namespace Extensions
} // namespace Envoy
|
/**
* Copyright 2016 BitTorrent 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.
*/
#pragma once
#include <scraps/config.h>
#include <scraps/net/Address.h>
#include <scraps/net/UDPReceiver.h>
#include <scraps/net/UDPSender.h>
#include <array>
#include <mutex>
#include <thread>
#include <atomic>
namespace scraps::net {
/**
* Thread-safe.
*/
class UDPSocket : public UDPSender {
public:
using Protocol = Address::Protocol;
static constexpr size_t kEthernetMTU = 1500;
static constexpr size_t kIPv4HeaderSize = 20;
static constexpr size_t kIPv6HeaderSize = 40;
static constexpr size_t kUDPHeaderSize = 8;
static constexpr size_t kMaxIPv4UDPPayloadSize = kEthernetMTU - kIPv4HeaderSize - kUDPHeaderSize;
static constexpr size_t kMaxIPv6UDPPayloadSize = kEthernetMTU - kIPv6HeaderSize - kUDPHeaderSize;
/**
* Creates a new UDP socket.
*
* @param receiver must outlive the socket. if null, should be given via setReceiver
*/
UDPSocket(Protocol protocol, std::weak_ptr<UDPReceiver> receiver = std::weak_ptr<UDPReceiver>());
~UDPSocket() { close(); }
/**
* Returns the native socket.
*/
int native() const { return _socket; }
/**
* Sets the receiver for the socket. The receiver should outlive the socket and
* should not be changed once set.
*/
void setReceiver(std::weak_ptr<UDPReceiver> receiver);
/**
* Binds the socket to any interface on the given port.
*/
bool bind(uint16_t port);
/**
* Binds the socket to the given interface and port.
*/
bool bind(const char* interface, uint16_t port);
/**
* Binds the socket, joining the given multicast group address.
*/
bool bindMulticast(const char* groupAddress, uint16_t port);
/**
* Sends data on the socket.
*/
virtual bool send(const Endpoint& destination, const void* data, size_t length) override;
/**
* Attempts to receive data on the socket and dispatch it to its receiver.
*/
void receive();
/**
* Explicitly closes the socket.
*/
void close();
/**
* Get total number of bytes sent and received.
*/
uint64_t totalSentBytes() { return _totalSentBytes; }
uint64_t totalReceivedBytes() { return _totalReceivedBytes; }
private:
std::mutex _mutex;
int _socket = -1;
Protocol _protocol;
std::weak_ptr<UDPReceiver> _receiver;
std::array<unsigned char, 4096> _buffer;
std::atomic_uint_fast64_t _totalSentBytes{0};
std::atomic_uint_fast64_t _totalReceivedBytes{0};
bool _bind(const char* interface, uint16_t port);
};
} // namespace scraps::net
|
/*! \brief Header for SPI.c.
* \details Header for SPI communication library.
* \author Raphael Lauber, NTB
* \date 01.12.2015
*/
#ifndef SPI_H_
#define SPI_H_
#include <avr/io.h>
/* Prototypes */
void SPI_Write(uint8_t*, uint8_t);
void SPI_Read(uint8_t*, uint8_t);
void SPI_WriteRead(uint8_t*, uint8_t, uint8_t*, uint8_t);
#endif /* SPI_H_ */ |
//
// XJRLoginRegisterViewController.h
// DSBuDeJie
//
// Created by 邢京荣 on 16/7/4.
// Copyright © 2016年 邢京荣. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface XJRLoginRegisterViewController : UIViewController
@end
|
//catalan数的应用 形如f(n) = f(n-1) + f(n-2)f(1) + f(n-3)f(2) + … + f(1)f(n-2) + f(n-1)的特征结构
int numTrees(int n) {
int a = n+1;
int b = n;
long ret = 1;
for(int i = 1; i <= b; i++)
{
ret = ret * a;
ret = ret / i;
a++;
}
return ret / (n+1);
}
|
/*
Copyright (c) 2017 TOSHIBA Digital Solutions 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 _PARTITIONCONTROLLER_H_
#define _PARTITIONCONTROLLER_H_
#include "gridstore.h"
#include "GSException.h"
#include <vector>
namespace griddb {
class PartitionController {
GSPartitionController *mController;
public:
PartitionController(GSPartitionController *controller);
~PartitionController();
int32_t get_partition_count();
int64_t get_partition_container_count(int32_t partitionIndex);
void get_partition_container_names(int32_t partitionIndex, int64_t start,
const GSChar * const ** stringList, size_t *size, int64_t limit=-1);
void get_partition_hosts(int32_t partitionIndex,
const GSChar * const **stringList, size_t *size);
int32_t get_partition_index_of_container(const GSChar *containerName);
string get_partition_owner_host(int32_t partitionIndex);
void get_partition_backup_hosts(int32_t partitionIndex,
const GSChar * const ** stringList, size_t *size);
void assign_partition_preferable_host(int32_t partitionIndex,
const GSChar *host);
};
} /* namespace griddb */
#endif /* _PARTITIONCONTROLLER_H_ */
|
#include "lunkwill.h"
struct _fifo *Sighandler=NULL;
struct module_info Modules[256];
/**
* \brief Where it all begins
*/
int main(int argc, char** argv)
{
char *err=NULL;
int pipe1[2];
int pipe2[2];
pid_t pid;
int opt;
int log_level=0;
char *log_file=NULL;
int conf;
char *config_path=NULL;
config_t config;
config_setting_t *config_prop;
memset(Modules, 0, 256*sizeof(struct module_info));
//Parse args
while((opt=getopt(argc,argv,"c:f"))!=-1)
{
switch(opt)
{
case 'c':
if(config_path==NULL)
{
config_path=malloc(strlen(optarg)+10);
strcpy(config_path, optarg);
}
break;
case 'f':
switch((int)fork())
{
case -1:
err="Unable to fork worker";
nfree(config_path);
goto _fail;
break;
case 0:
log_level=99;
break;
default:
nfree(config_path);
return 0;
break;
}
break;
default:
err=argv[0];
nfree(config_path);
goto argv_fail;
break;
}
}
//Load configuration
if(config_path!=NULL)
{
log_write("Initializing lunkwill", LOG_DBG);
log_write("Using config: %s", LOG_DBG, config_path);
if(load_config(&config, config_path)!=0)
{
err="Failed to load configuration";
nfree(config_path);
goto _fail;
}
nfree(config_path);
}
else
{
log_write("Initializing lunkwill", LOG_DBG);
if(load_config(&config,"lunkwill.cfg")!=0)
{
log_write("Creating default config", LOG_DBG);
if(create_config(&config, "lunkwill.cfg")!=0)
{
err="Failed to create default configuration";
goto _fail;
}
}
log_write("Using default config", LOG_DBG);
}
if((config_prop=config_lookup(&config, "LOG"))==NULL)
{
config_prop=config_root_setting(&config);
}
if(config_setting_lookup_int(config_prop, "LOGLEVEL", &conf)&&log_level==0) log_level=conf;
if(!config_setting_lookup_string(config_prop, "LOGFILE", (const char**)&log_file)) return 1;
init_logger(log_file,log_level);
init_sighndlr();
fflush(stdout);
if(pipe(pipe1) == 0 && pipe(pipe2)==0)
{
pid = fork();
if(pid == (pid_t)-1)
{
err="Unable to fork worker";
goto _fail;
}
else if(pid == (pid_t)0)
{
//Child process
close(pipe2[0]);
close(pipe1[1]);
fclose(stdin);
//Read config
//Modules_init;
if(login_init_module(0)!=0) return 1;
int max_num_threads=0;
if((config_prop=config_lookup(&config, "WORKER"))==NULL)
{
config_prop=config_root_setting(&config);
}
if(config_setting_lookup_int(config_prop, "MAX_NUM_THREADS", &conf)) max_num_threads=conf;
if(max_num_threads<=0||max_num_threads>0xFFFF) max_num_threads=15;
if((config_prop=config_lookup(&config, "MODULES"))==NULL)
{
config_prop=config_root_setting(&config);
}
int x,n=0;
n=config_setting_length(config_prop);
for(x=0; x<n; x++)
{
const char *varName;
if((varName = config_setting_get_string_elem(config_prop, x))==NULL) continue;
load_module(varName, x);
}
config_destroy(&config);
start_worker(max_num_threads, pipe1[0], pipe2[1]);
}
else
{
//Parent process
close(pipe1[0]);
close(pipe2[1]);
//Read config
int conf, port=0;
int listen_queue=0;
int timeout=0;
config_setting_t *config_prop;
if((config_prop=config_lookup(&config, "SOCKET"))==NULL)
{
config_prop=config_root_setting(&config);
}
if(config_setting_lookup_int(config_prop, "PORT", &conf)) port=conf;
if(port<=0||port>0xFFFF) port=3000;
if(config_setting_lookup_int(config_prop, "PEND_CONNECTIONS", &conf)) listen_queue=conf;
if(listen_queue<=0||listen_queue>0xFF) listen_queue=20;
if(config_setting_lookup_int(config_prop, "RCV_TIMEOUT", &conf)) timeout=conf;
if(timeout<=0||timeout>0xFF) timeout=1;
config_destroy(&config);
log_write("Server started. Enter 'quit' to shutdown the server (Port: %d)", LOG_WARN, port);
start_server(port, listen_queue, timeout, pipe2[0], pipe1[1]);
}
}
sighndlr_safe_exit(0);
return 0;
argv_fail:
log_write("Usage: %s [-c CONFIG_FILE] [-f]", LOG_FATAL, err);
nfree(config_path);
return 1;
_fail:
log_write(err, LOG_ERR);
return 2;
}
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2011 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
/** This is generated, do not edit by hand. **/
#include <jni.h>
#include "Proxy.h"
namespace titanium {
namespace media {
class CameraProxy : public titanium::Proxy
{
public:
explicit CameraProxy(jobject javaObject);
static void bindProxy(v8::Handle<v8::Object> exports);
static v8::Handle<v8::FunctionTemplate> getProxyTemplate();
static void dispose();
static v8::Persistent<v8::FunctionTemplate> proxyTemplate;
static jclass javaClass;
private:
// Methods -----------------------------------------------------------
static v8::Handle<v8::Value> getPreview(const v8::Arguments&);
// Dynamic property accessors ----------------------------------------
};
} // namespace media
} // titanium
|
/*
FreeRDP: A Remote Desktop Protocol client.
Video Redirection Virtual Channel
Copyright 2010-2011 Vic Lee
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 __TSMF_TYPES_H
#define __TSMF_TYPES_H
typedef struct _TS_AM_MEDIA_TYPE
{
int MajorType;
int SubType;
int FormatType;
uint32 Width;
uint32 Height;
uint32 BitRate;
struct
{
uint32 Numerator;
uint32 Denominator;
} SamplesPerSecond;
uint32 Channels;
uint32 BitsPerSample;
uint32 BlockAlign;
const uint8 * ExtraData;
uint32 ExtraDataSize;
} TS_AM_MEDIA_TYPE;
#endif
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et ft=cpp : */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef __HAL_SENSOR_H_
#define __HAL_SENSOR_H_
#include "mozilla/Observer.h"
namespace mozilla {
namespace hal {
/**
* Enumeration of sensor types. They are used to specify type while
* register or unregister an observer for a sensor of given type.
*/
enum SensorType {
SENSOR_UNKNOWN = -1,
SENSOR_ORIENTATION,
SENSOR_ACCELERATION,
SENSOR_PROXIMITY,
SENSOR_LINEAR_ACCELERATION,
SENSOR_GYROSCOPE,
SENSOR_LIGHT,
NUM_SENSOR_TYPE
};
class SensorData;
typedef Observer<SensorData> ISensorObserver;
/**
* Enumeration of sensor accuracy types.
*/
enum SensorAccuracyType {
SENSOR_ACCURACY_UNKNOWN = -1,
SENSOR_ACCURACY_UNRELIABLE,
SENSOR_ACCURACY_LOW,
SENSOR_ACCURACY_MED,
SENSOR_ACCURACY_HIGH,
NUM_SENSOR_ACCURACY_TYPE
};
class SensorAccuracy;
typedef Observer<SensorAccuracy> ISensorAccuracyObserver;
}
}
#include "IPC/IPCMessageUtils.h"
namespace IPC {
/**
* Serializer for SensorType
*/
template <>
struct ParamTraits<mozilla::hal::SensorType>:
public EnumSerializer<mozilla::hal::SensorType,
mozilla::hal::SENSOR_UNKNOWN,
mozilla::hal::NUM_SENSOR_TYPE> {
};
template <>
struct ParamTraits<mozilla::hal::SensorAccuracyType>:
public EnumSerializer<mozilla::hal::SensorAccuracyType,
mozilla::hal::SENSOR_ACCURACY_UNKNOWN,
mozilla::hal::NUM_SENSOR_ACCURACY_TYPE> {
};
} // namespace IPC
#endif /* __HAL_SENSOR_H_ */
|
/*
* Copyright (C) 2015 University of Oregon
*
* You may distribute under the terms of either the GNU General Public
* License or the Apache License, as specified in the LICENSE file.
*
* For more information, see the LICENSE file.
*/
#ifndef LINT
#endif
/*
*/
/* tndqcosy - double quantum filtered cosy experiment
using obs xmtr for presaturation during presat period
and d2, if desired
TRANSMITTER MUST BY AT SOLVENT FREQUENCY
Parameters:
pw = 90 excitation pulse (at power level tpwr)
phase = 0: P-type non-phase-sensitive experiment
1,2: hypercomplex phase-sensitive experiment
3: TPPI phase-sensitive experiment
satmode = 'yn' for saturation during relaxation period
'ny' for saturation during d2
'yy' for both
satdly = presaturation period -uses obs xmtr at tof with satpwr;
sspul = 'y': selects for Trim(x)-Trim(y)
sequence at start of pulse sequence
(highly recommended to eliminate "long T1" artifacts)
revised from dqcosy.c Sept 1991 g.gray
P.A.Keifer 940916 - modified d2 and rlpower
*/
#include <standard.h>
void pulsesequence()
{
char sspul[MAXSTR];
/* LOAD VARIABLES AND CHECK CONDITIONS */
getstr("sspul", sspul);
if (satpwr > 40)
{
printf("satpwr too large - acquisition aborted.\n");
psg_abort(1);
}
if ((rof1 < 9.9e-6) && (ix== 1))
fprintf(stdout,"Warning: ROF1 is less than 10 us\n");
/* STEADY-STATE PHASECYCLING */
/* This section determines if the phase calculations trigger off of (SS - SSCTR)
or off of CT */
ifzero(ssctr);
hlv(ct, v4);
mod4(ct, v3);
elsenz(ssctr);
sub(ssval, ssctr, v12); /* v12 = 0,...,ss-1 */
hlv(v12, v4);
mod4(v12, v3);
endif(ssctr);
/* CALCULATE PHASECYCLE */
/* The phasecycle first performs a 4-step cycle on the third pulse in order
to select for DQC. Second, the 2-step QIS cycle is added in. Third, a
2-step cycle for axial peak suppression is performed on the second pulse.
Fourth, a 2-step cycle for axial peak suppression is performed on the
first pulse. If P-type peaks only are being selected, the 2-step cycle
for P-type peak selection is performed on the first pulse immediately
after the 4-step cycle on the third pulse. */
hlv(v4, v4);
if (phase1 == 0)
{
assign(v4, v6);
hlv(v4, v4);
mod2(v6, v6); /* v6 = P-type peak selection in w1 */
}
hlv(v4, v2);
mod4(v4, v4); /* v4 = quadrature image suppression */
hlv(v2, v1);
mod2(v1, v1);
dbl(v1, v1);
mod2(v2, v2);
dbl(v2, v2);
dbl(v3, v5);
add(v3, v5, v5);
add(v1, v5, v5);
add(v2, v5, v5);
add(v4, v5, v5);
add(v4, v1, v1);
add(v4, v2, v2);
add(v4, v3, v3);
if (phase1 == 0)
{
add(v6, v1, v1);
add(v6, v5, v5);
}
if (phase1 == 2)
incr(v1);
if (phase1 == 3)
add(id2, v1, v1); /* adds TPPI increment to the phase of the
* first pulse */
assign(v5, oph);
/* FOR HYPERCOMPLEX, USE REDFIED TRICK TO MOVE AXIALS TO EDGE */
if ((phase1==2)||(phase1==1))
{
initval(2.0*(double)(d2_index%2),v9); /* moves axials */
add(v1,v9,v1); add(oph,v9,oph);
}
/* BEGIN ACTUAL PULSE SEQUENCE CODE */
status(A);
if (sspul[0] == 'y')
{
obspower(tpwr-12);
rgpulse(200*pw, one, 10.0e-6, 0.0e-6);
rgpulse(200*pw, zero, 0.0e-6, 1.0e-6);
obspower(tpwr);
}
hsdelay(d1);
if (satmode[A] == 'y')
{
obspower(satpwr);
rgpulse(satdly,zero,rof1,rof1);
obspower(tpwr);
}
status(B);
rgpulse(pw, v1, rof1, 1.0e-6);
if (satmode[B] == 'y')
{
obspower(satpwr);
if (d2>100.0e-6)
rgpulse(d2-(2*POWER_DELAY)-1.0e-6-rof1-(4*pw)/3.14159,zero,0.0,0.0);
obspower(tpwr);
}
else if (d2>0.0)
{
delay(d2 - rof1 - 1.0e-6 -(4*pw)/3.1416);
}
rgpulse(pw, v2, rof1, 0.0);
rgpulse(pw, v3, 1.0e-6, rof2);
status(C);
}
|
/**
* Copyright 2013 Yahoo! 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. See accompanying LICENSE file.
*/
/**
* @file compose.h
* @addtogroup Compose
* @brief Composition
*/
#ifndef _YMAGINE_DESIGN_H
#define _YMAGINE_DESIGN_H 1
#include "ymagine/ymagine.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup Design Design
*
* This module provides API for some basic design components
*
* @{
*/
/**
* @brief Create a Vbitmap with an orb mask
* @ingroup Design
*
* @param canvas Vbitmap to render the orb into
* @param sz size (width and height) of bitmap
* @return If succesfully return Vbitmap with orb mask rendered as solid black on transparent background
*/
int VbitmapOrbLoad(Vbitmap *canvas, int sz);
/**
* @brief Render group orb
* @ingroup Design
*
* @param canvas Vbitmap to render into
* @param ntiles total number of images to compose into canvas
* @param tileid index of the tile to render
* @param channelin input channel for the image to render
* @return If succesfully return YMAGINE_OK
*/
int
VbitmapOrbRenderTile(Vbitmap *canvas, int ntiles, int tileid, Ychannel* channelin);
/**
* @brief Render group orb
* @ingroup Design
*
* @param canvas Vbitmap to render into
* @param ntiles total number of images to compose into canvas
* @param tileid index of the tile to render
* @param srcbitmap source bitmap to render into tile
* @return If succesfully return YMAGINE_OK
*/
int
VbitmapOrbRenderTileBitmap(Vbitmap *canvas, int ntiles, int tileid, Vbitmap *srcbitmap);
/**
* @}
*/
#ifdef __cplusplus
};
#endif
#endif /* _YMAGINE_DESIGN_H */
|
// Copyright 2016 InnerFunction Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Created by Julian Goacher on 07/12/2015.
// Copyright © 2015 InnerFunction. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface IFLogger : NSObject {
NSString *_tag;
}
- (id)initWithTag:(NSString *)tag;
- (void)debug:(NSString *)message, ...;
- (void)info:(NSString *)message, ...;
- (void)warn:(NSString *)message, ...;
- (void)error:(NSString *)message, ...;
+ (void)withTag:(NSString *)tag error:(NSString *)message, ...;
+ (void)withTag:(NSString *)tag warn:(NSString *)message, ...;
@end |
//
// TestIndexViewController.h
// SimpleApp
//
// Created by 邬勇鹏 on 2018/5/10.
// Copyright © 2018年 wuyp. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TestIndexViewController : UIViewController
@end
|
//
// DoraemonMockApiCell.h
// DoraemonKit
//
// Created by didi on 2019/11/15.
//
#import "DoraemonMockBaseCell.h"
NS_ASSUME_NONNULL_BEGIN
@interface DoraemonMockApiCell : DoraemonMockBaseCell
@end
NS_ASSUME_NONNULL_END
|
// -*- c++ -*-
//
// Copyright 2011 A.N.M. Imroz Choudhury
//
// NewCache.h
#ifndef NEW_CACHE_H
#define NEW_CACHE_H
// #define USE_STRING_INFO
// MTV headers.
#include <Core/Dataflow/BlockStream/BlockStreamReader.h>
#include <Core/Dataflow/TraceReader.h>
#include <Core/Util/BoostPointers.h>
#include <Tools/CacheSimulator/Cache.h>
#include <Tools/NewCacheSimulator/CacheLevel.h>
using Daly::CacheEntranceRecord;
using Daly::CacheEvictionRecord;
using Daly::CacheHitRecord;
// Boost headers.
#include <boost/enable_shared_from_this.hpp>
#include <boost/unordered_map.hpp>
// System headers.
#include <iostream>
#include <stdexcept>
#include <stdint.h>
#include <sstream>
#include <vector>
namespace MTV{
class AllocateExisting : public std::logic_error {
public:
AllocateExisting()
: std::logic_error("Attempt to allocate a block already present in the cache.")
{}
};
class UninitializedBlockstreamReader : public std::logic_error {
public:
UninitializedBlockstreamReader()
: std::logic_error("OPT or PES policy requested with uninitialized blockstream reader.")
{}
};
class UninitializedTraceReader : public std::logic_error {
public:
UninitializedTraceReader()
: std::logic_error("OPT or PES policy requested with uninitialized trace reader.")
{}
};
class NewCache : public boost::enable_shared_from_this<NewCache> {
friend class CacheLevel;
public:
BoostPointers(NewCache);
public:
class UnevenSets {};
public:
enum WriteMissPolicy{
WriteAllocate,
WriteNoAllocate
};
public:
static NewCache::ptr create(uint64_t blocksize, WriteMissPolicy write_miss_pol){
NewCache::ptr p(new NewCache(blocksize, write_miss_pol));
return p;
}
static NewCache::ptr newFromSpec(const std::string& specfile, TraceReader::ptr trace, BlockStreamReader::ptr bsreader, std::string& error);
static NewCache::ptr dummy(TraceReader::ptr trace, BlockStreamReader::ptr bsreader){
NewCache::ptr p(new NewCache(0, NewCache::WriteAllocate));
p->set_trace_reader(trace);
p->set_blockstream_reader(bsreader);
return p;
}
public:
WriteMissPolicy write_miss_policy() const {
return write_miss_pol;
}
uint64_t block_size() const {
return blocksize;
}
unsigned num_levels() const {
return levels.size();
}
CacheLevel::const_ptr level(unsigned i) const {
return levels[i];
}
void set_trace_reader(TraceReader::const_ptr _trace){
trace = _trace;
}
void set_blockstream_reader(BlockStreamReader::ptr _bs_reader){
bs_reader = _bs_reader;
}
CacheLevel::ptr add_level(CacheLevel::ptr level){
levels.push_back(level);
return level;
}
CacheLevel::ptr add_level(unsigned num_blocks, unsigned num_sets, CacheLevel::WritePolicy write_policy, CacheLevel::ReplacementPolicy repl_policy);
const std::vector<CacheHitRecord>& hitInfo() const {
return hit_info;
}
const std::vector<CacheEvictionRecord>& evictionInfo() const {
return eviction_info;
}
const std::vector<CacheEntranceRecord>& entranceInfo() const {
return entrance_info;
}
void load(const uint64_t addr);
void store(const uint64_t addr);
void print(std::ostream& out) const {
for(unsigned L=0; L<levels.size(); L++){
out << "L" << (L+1) << ":" << std::endl;
levels[L]->print(out, "\t");
}
}
#ifdef USE_STRING_INFO
const std::vector<std::string>& hits_string() const {
return hit_info_string;
}
const std::vector<std::string>& evictions_string() const {
return eviction_info_string;
}
const std::vector<std::string>& entrances_string() const {
return entrance_info_string;
}
#endif
const std::vector<Daly::CacheHitRecord>& hits() const {
return hit_info;
}
const std::vector<Daly::CacheEvictionRecord>& evictions() const {
return eviction_info;
}
const std::vector<Daly::CacheEntranceRecord>& entrances() const {
return entrance_info;
}
private:
NewCache(uint64_t blocksize, WriteMissPolicy write_miss_pol)
: blocksize(blocksize),
write_miss_pol(write_miss_pol)
{}
private:
void write_at_level(const unsigned level, const uint64_t addr);
private:
std::vector<CacheLevel::ptr> levels;
const unsigned blocksize;
const WriteMissPolicy write_miss_pol;
BlockStreamReader::ptr bs_reader;
TraceReader::const_ptr trace;
std::vector<Daly::CacheHitRecord> hit_info;
std::vector<Daly::CacheEvictionRecord> eviction_info;
std::vector<Daly::CacheEntranceRecord> entrance_info;
#ifdef USE_STRING_INFO
// String versions of the info records (to be obsoleted).
std::vector<std::string> hit_info_string;
std::vector<std::string> eviction_info_string;
std::vector<std::string> entrance_info_string;
#endif
};
}
#endif
|
// FileRobotDlg.h : Header-Datei
//
#pragma once
/////////////////////////////////////////////////////////////////////////////
// CFileRobotDlg Dialogfeld
class CFileRobotDlg : public CDialog
{
// Konstruktion
public:
CFileRobotDlg(CWnd* pParent = NULL); // Standard-Konstructor
~CFileRobotDlg ();
// Dialogfelddaten
enum { IDD = IDD_FILEROBOT_DIALOG };
CString m_strURL;
CString m_strFileName;
CString m_strStatus;
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung
// Implementierung
protected:
HICON m_hIcon;
// Generierte Message-Map-Funktionen
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnButtonAddFile();
afx_msg void OnButtonRemoveFile();
afx_msg void OnButtonStart();
DECLARE_MESSAGE_MAP()
private:
bool GetURLFile (const CString& strURL);
CInternetSession* m_pSession;
CString CreateURL (const CString& strURL, const CString& strFile) const;
};
|
#include <SFML/Graphics.hpp>
#include <iostream>
#pragma once
/**
*\file unit.h
*
*\brief deze library bevat de klasse unit
*
* \class unit
*
* \brief de klasse unit is de hoofd klasse van de verschillende eenheden
*
* \author Olaf van der Kruk
* \author Ben Meulenberg
* \author Peter Markotic
*
* \version 1.0
*
* \date 2013/11/07
*/
class unit {
protected:
int health, damage, range, speed, castle_damage;
float factor;
enum Direction { Left, Right, attackLeft, attackRight };
float frameCounter, switchFrame, frameSpeed;
sf::Vector2i source;
sf::Texture pTexture;
sf::Sprite playerImage;
sf::RectangleShape health_bar_back;
sf::RectangleShape health_bar;
sf::Clock clock;
public:
/** \brief maakt een unit object aan */
unit();
/** \brief deze methode is virtual omdat de eenheden verschillende dingen doen bij het doodgaan */
virtual ~unit(){};
/** \brief verandert de hoeveelheid health van de eenheid
* \param val de hoeveelheid health om er af te halen
* \return void
*/
void health_down(int val) {
health=health-val;
}
/** \brief geeft de hoeveelheid health terug van de eenheid
* \return int health
*/
int get_health(){
return health*factor;
}
/** \brief geeft de hoeveelheid damage terug van de eenheid
* \return int damage
*/
int get_damage(){
return damage;
}
/** \brief geeft de hoeveelheid damage die de eenheid aan een kasteel kan doen
* \return int castle_damage
*/
int get_castle_damage(){
return castle_damage;
}
/** \brief geeft de afstand waarover een eenheid schade kan doen
* \return int afstand
*/
int get_range(){
return range;
}
/** \brief geeft de x positie terug van de eenheid
* \return int roept de get position methode aan van de afbeelding
*/
int get_x() {
return playerImage.getPosition().x;
}
/** \brief bepaald de x positie terug van de eenheid
* \return void
*/
void set_x(int pos){
playerImage.setPosition(sf::Vector2f(pos, 468));
}
/** \brief geeft de x positie terug van de eenheid
* \param &Window de window waarnaar deze draw functie moet schrijven
* \param direction bepaald de richting van de eenheid
* \param movement bepaald of de eenheid moet bewegen
* \param attack bepaald of de eenheid moet aanvallen
* \return void
*/
void draw(sf::RenderWindow &Window, int direction, bool movement, bool attack);
};
|
#ifndef MISCELLANEOUS_H
#define MISCELLANEOUS_H
#if defined(_WIN32)
#include <dirent.h>
#else
#include <sys/stat.h>
#endif
int createDirectory(string name) {
#if defined(_WIN32)
return mkdir(name.c_str());
#else
return mkdir(name.c_str(), 0777);
#endif
}
#endif // MISCELLANEOUS_H
|
// Copyright (c) 2018 PaddlePaddle 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.
#pragma once
#include <map>
#include <vector>
#include "paddle/fluid/framework/op_kernel_type.h"
#include "paddle/fluid/framework/tensor.h"
#include "paddle/fluid/framework/variable.h"
namespace paddle {
namespace framework {
#ifdef PADDLE_WITH_MKLDNN
using MKLDNNFormat = mkldnn::memory::format;
using MKLDNNDataType = mkldnn::memory::data_type;
inline MKLDNNFormat ToMKLDNNFormat(const DataLayout& layout) {
switch (layout) {
case DataLayout::kNHWC:
return MKLDNNFormat::nhwc;
case DataLayout::kNCHW:
return MKLDNNFormat::nchw;
default:
PADDLE_THROW("Fail to convert layout %s to MKLDNN format",
DataLayoutToString(layout));
}
}
inline DataLayout ToPaddleLayout(const MKLDNNFormat& format) {
switch (format) {
case MKLDNNFormat::nhwc:
return DataLayout::kNHWC;
case MKLDNNFormat::nchw:
return DataLayout::kNCHW;
default:
PADDLE_THROW("Fail to convert MKLDNN format to paddle layout");
}
}
inline MKLDNNDataType ToMKLDNNDataType(const std::type_index type) {
static const std::map<std::type_index, MKLDNNDataType> dict{
{std::type_index(typeid(float)), MKLDNNDataType::f32}, // NOLINT
{std::type_index(typeid(char)), MKLDNNDataType::s8}, // NOLINT
{std::type_index(typeid(unsigned char)), MKLDNNDataType::u8},
{std::type_index(typeid(int16_t)), MKLDNNDataType::s16},
{std::type_index(typeid(int32_t)), MKLDNNDataType::s32}};
auto iter = dict.find(type);
if (iter != dict.end()) return iter->second;
return MKLDNNDataType::data_undef;
}
#endif
void TransDataLayoutFromMKLDNN(const OpKernelType& kernel_type_for_var,
const OpKernelType& expected_kernel_type,
const Tensor& in, Tensor* out);
std::vector<int> GetAxis(const DataLayout& from, const DataLayout& to);
void TransDataLayout(const OpKernelType& kernel_type_for_var,
const OpKernelType& expected_kernel_type, const Tensor& in,
Tensor* out);
} // namespace framework
} // namespace paddle
|
/*
* 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/alexaforbusiness/AlexaForBusiness_EXPORTS.h>
#include <aws/core/AmazonSerializableWebServiceRequest.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <aws/core/http/HttpRequest.h>
namespace Aws
{
namespace AlexaForBusiness
{
class AWS_ALEXAFORBUSINESS_API AlexaForBusinessRequest : public Aws::AmazonSerializableWebServiceRequest
{
public:
virtual ~AlexaForBusinessRequest () {}
virtual Aws::String SerializePayload() const override = 0;
void AddParametersToRequest(Aws::Http::HttpRequest& httpRequest) const { AWS_UNREFERENCED_PARAM(httpRequest); }
inline Aws::Http::HeaderValueCollection GetHeaders() const override
{
auto headers = GetRequestSpecificHeaders();
if(headers.size() == 0 || (headers.size() > 0 && headers.count(Aws::Http::CONTENT_TYPE_HEADER) == 0))
{
headers.insert(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, Aws::AMZN_JSON_CONTENT_TYPE_1_1 ));
}
return headers;
}
protected:
virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); }
};
} // namespace AlexaForBusiness
} // namespace Aws
|
/*
* fifo.h
*
* Created on: 2014-09-25
* Author: QiuWeibo
*/
#ifndef FIFO_H_
#define FIFO_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifdef FIFO_GLOBALS
#define FIFO_EXT
#else
#define FIFO_EXT extern
#endif
#include "stm32f10x.h"
typedef struct
{
u8 *write_ptr; // дָÕë
u8 *read_ptr; // ¶ÁÖ¸Õë
u8 *buffer; // Ö¸ÏòFIFOÊ×ÔªËØµØÖ·
u32 data_size; // FIFOÔªËØµÄ´óС
u32 fifo_size; // FIFO´óС
char fifo_empty; // FIFO¿Õ±êÖ¾
char fifo_full; // FIFOÂú±êÖ¾
} GP_FIFO_StructDef;
typedef struct
{
int *write_ptr; // дָÕë
int *read_ptr; // ¶ÁÖ¸Õë
int *buffer; // Ö¸ÏòFIFOÊ×ÔªËØµØÖ·
u32 fifo_size; // FIFO´óС(ints)
char fifo_empty; // FIFO¿Õ±êÖ¾
char fifo_full; // FIFOÂú±êÖ¾
} INT_FIFO_StructDef;
typedef struct
{
char *write_ptr; // дָÕë
char *read_ptr; // ¶ÁÖ¸Õë
char *buffer; // Ö¸ÏòFIFOÊ×ÔªËØµØÖ·
u32 fifo_size; // FIFO´óС(bytes)
char fifo_empty; // FIFO¿Õ±êÖ¾
char fifo_full; // FIFOÂú±êÖ¾
} CHAR_FIFO_StructDef;
//genery purpuse fifo
FIFO_EXT void gp_fifo_init( GP_FIFO_StructDef *fifo_ptr,
void *buffer_ptr,
u32 data_size,
u32 fifo_size );
FIFO_EXT int gp_fifo_push(GP_FIFO_StructDef *fifo_ptr, void *buffer_ptr);
FIFO_EXT int gp_fifo_pop(GP_FIFO_StructDef* fifo_ptr, void* buffer_ptr);
FIFO_EXT u32 gp_fifo_count(GP_FIFO_StructDef *fifo_ptr);
FIFO_EXT void gp_fifo_reset(GP_FIFO_StructDef *fifo_ptr);
FIFO_EXT void int_fifo_init( INT_FIFO_StructDef *fifo_ptr, int *buffer_ptr, u32 fifo_size );
FIFO_EXT int int_fifo_push(INT_FIFO_StructDef *fifo_ptr, int *buffer_ptr);
FIFO_EXT int int_fifo_pop(INT_FIFO_StructDef* fifo_ptr, int* buffer_ptr);
FIFO_EXT u32 int_fifo_count(INT_FIFO_StructDef *fifo_ptr);
FIFO_EXT void int_fifo_reset(INT_FIFO_StructDef *fifo_ptr);
FIFO_EXT void char_fifo_init( CHAR_FIFO_StructDef *fifo_ptr, char *buffer_ptr, u32 fifo_size );
FIFO_EXT int char_fifo_push(CHAR_FIFO_StructDef *fifo_ptr, char *buffer_ptr);
FIFO_EXT int char_fifo_pop(CHAR_FIFO_StructDef* fifo_ptr, char* buffer_ptr);
FIFO_EXT u32 char_fifo_count(CHAR_FIFO_StructDef *fifo_ptr);
FIFO_EXT void char_fifo_reset(CHAR_FIFO_StructDef *fifo_ptr);
#ifdef __cplusplus
}
#endif
#endif /* FIFO_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/ssm/SSM_EXPORTS.h>
#include <aws/ssm/model/S3OutputUrl.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace SSM
{
namespace Model
{
/**
* <p>The URL of Amazon S3 bucket where you want to store the results of this
* request.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/InstanceAssociationOutputUrl">AWS
* API Reference</a></p>
*/
class AWS_SSM_API InstanceAssociationOutputUrl
{
public:
InstanceAssociationOutputUrl();
InstanceAssociationOutputUrl(Aws::Utils::Json::JsonView jsonValue);
InstanceAssociationOutputUrl& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The URL of Amazon S3 bucket where you want to store the results of this
* request.</p>
*/
inline const S3OutputUrl& GetS3OutputUrl() const{ return m_s3OutputUrl; }
/**
* <p>The URL of Amazon S3 bucket where you want to store the results of this
* request.</p>
*/
inline void SetS3OutputUrl(const S3OutputUrl& value) { m_s3OutputUrlHasBeenSet = true; m_s3OutputUrl = value; }
/**
* <p>The URL of Amazon S3 bucket where you want to store the results of this
* request.</p>
*/
inline void SetS3OutputUrl(S3OutputUrl&& value) { m_s3OutputUrlHasBeenSet = true; m_s3OutputUrl = std::move(value); }
/**
* <p>The URL of Amazon S3 bucket where you want to store the results of this
* request.</p>
*/
inline InstanceAssociationOutputUrl& WithS3OutputUrl(const S3OutputUrl& value) { SetS3OutputUrl(value); return *this;}
/**
* <p>The URL of Amazon S3 bucket where you want to store the results of this
* request.</p>
*/
inline InstanceAssociationOutputUrl& WithS3OutputUrl(S3OutputUrl&& value) { SetS3OutputUrl(std::move(value)); return *this;}
private:
S3OutputUrl m_s3OutputUrl;
bool m_s3OutputUrlHasBeenSet;
};
} // namespace Model
} // namespace SSM
} // namespace Aws
|
#ifndef r_constantsH
#define r_constantsH
#pragma once
#include "xrcore/xr_resource.h"
#if defined(USE_DX10) || defined(USE_DX11)
#include "../xrRenderDX10/dx10ConstantBuffer.h"
#endif // USE_DX10
class ECORE_API R_constant_setup;
enum {
RC_float = 0,
RC_int = 1,
RC_bool = 2,
RC_sampler = 99, // DX9 shares index for sampler and texture
RC_dx10texture = 100, // For DX10 sampler and texture are different resources
RC_dx11UAV = 101
};
enum {
RC_1x1 = 0, // vector1, or scalar
RC_1x4, // vector4
RC_1x3, // vector3
RC_1x2, // vector2
RC_2x4, // 4x2 matrix, transpose
RC_3x4, // 4x3 matrix, transpose
RC_4x4, // 4x4 matrix, transpose
RC_1x4a, // array: vector4
RC_3x4a, // array: 4x3 matrix, transpose
RC_4x4a // array: 4x4 matrix, transpose
};
enum {
// Don't change this since some code relies on magic numbers
RC_dest_pixel = (1 << 0),
RC_dest_vertex = (1 << 1),
RC_dest_sampler = (1 << 2), // For DX10 it's either sampler or texture
RC_dest_geometry = (1 << 3), // DX10 only
RC_dest_hull = (1 << 4), // DX11 only
RC_dest_domain = (1 << 5), // DX11 only
RC_dest_compute = (1 << 6), // DX11 only
RC_dest_compute_cb_index_mask = 0xF0000000, // Buffer index == 0..14
RC_dest_compute_cb_index_shift = 28,
RC_dest_domain_cb_index_mask = 0x0F000000, // Buffer index == 0..14
RC_dest_domain_cb_index_shift = 24,
RC_dest_hull_cb_index_mask = 0x00F00000, // Buffer index == 0..14
RC_dest_hull_cb_index_shift = 20,
RC_dest_pixel_cb_index_mask = 0x000F0000, // Buffer index == 0..14
RC_dest_pixel_cb_index_shift = 16,
RC_dest_vertex_cb_index_mask = 0x0000F000, // Buffer index == 0..14
RC_dest_vertex_cb_index_shift = 12,
RC_dest_geometry_cb_index_mask = 0x00000F00, // Buffer index == 0..14
RC_dest_geometry_cb_index_shift = 8,
};
enum // Constant buffer index masks
{ CB_BufferIndexMask = 0xF, // Buffer index == 0..14
CB_BufferTypeMask = 0x70,
CB_BufferPixelShader = 0x10,
CB_BufferVertexShader = 0x20,
CB_BufferGeometryShader = 0x30,
CB_BufferHullShader = 0x40,
CB_BufferDomainShader = 0x50,
CB_BufferComputeShader = 0x60,
};
struct ECORE_API R_constant_load {
u16 index; // linear index (pixel)
u16 cls; // element class
R_constant_load() : index(u16(-1)), cls(u16(-1)){};
IC BOOL equal(R_constant_load& C) { return (index == C.index) && (cls == C.cls); }
};
struct ECORE_API R_constant : public xr_resource {
shared_str name; // HLSL-name
u16 type; // float=0/integer=1/boolean=2
u32 destination; // pixel/vertex/(or both)/sampler
R_constant_load ps;
R_constant_load vs;
#if defined(USE_DX10) || defined(USE_DX11)
R_constant_load gs;
#ifdef USE_DX11
R_constant_load hs;
R_constant_load ds;
R_constant_load cs;
#endif
#endif // USE_DX10
R_constant_load samp;
R_constant_setup* handler;
R_constant() : type(u16(-1)), destination(0), handler(NULL){};
IC R_constant_load& get_load(u32 destination) {
static R_constant_load fake;
switch (destination & 0xFF) {
case RC_dest_vertex:
return vs;
case RC_dest_pixel:
return ps;
#if defined(USE_DX10) || defined(USE_DX11)
case RC_dest_geometry:
return gs;
#ifdef USE_DX11
case RC_dest_hull:
return hs;
case RC_dest_domain:
return ds;
case RC_dest_compute:
return cs;
#endif
#endif
default:
FATAL("invalid enumeration for shader");
}
return fake;
}
IC BOOL equal(R_constant& C) {
return (0 == xr_strcmp(name, C.name)) && (type == C.type) &&
(destination == C.destination) && ps.equal(C.ps) && vs.equal(C.vs) &&
samp.equal(C.samp) && handler == C.handler;
}
IC BOOL equal(R_constant* C) { return equal(*C); }
};
typedef resptr_core<R_constant, resptr_base<R_constant>> ref_constant;
// Automatic constant setup
class ECORE_API R_constant_setup {
public:
virtual void setup(R_constant* C) = 0;
virtual ~R_constant_setup() {}
};
class ECORE_API R_constant_table : public xr_resource_flagged {
public:
typedef xr_vector<ref_constant> c_table;
c_table table;
#if defined(USE_DX10) || defined(USE_DX11)
typedef std::pair<u32, ref_cbuffer> cb_table_record;
typedef xr_vector<cb_table_record> cb_table;
cb_table m_CBTable;
#endif // USE_DX10
private:
void fatal(LPCSTR s);
#if defined(USE_DX10) || defined(USE_DX11)
BOOL parseConstants(ID3DShaderReflectionConstantBuffer* pTable, u32 destination);
BOOL parseResources(ID3DShaderReflection* pReflection, int ResNum, u32 destination);
#endif // USE_DX10
public:
~R_constant_table();
void clear();
BOOL parse(void* desc, u32 destination);
void merge(R_constant_table* C);
ref_constant get(LPCSTR name); // slow search
ref_constant get(shared_str& name); // fast search
BOOL equal(R_constant_table& C);
BOOL equal(R_constant_table* C) { return equal(*C); }
BOOL empty() { return 0 == table.size(); }
private:
};
typedef resptr_core<R_constant_table, resptr_base<R_constant_table>> ref_ctable;
#if defined(USE_DX10) || defined(USE_DX11)
#include "../xrRenderDX10/dx10ConstantBuffer_impl.h"
#endif // USE_DX10
#endif
|
#ifndef BABYLON_MATHS_POSITION_NORMAL_VERTEX_H
#define BABYLON_MATHS_POSITION_NORMAL_VERTEX_H
#include <memory>
#include <ostream>
#include <babylon/babylon_api.h>
#include <babylon/maths/vector3.h>
namespace BABYLON {
/**
* @brief Contains position and normal vectors for a vertex
*/
class BABYLON_SHARED_EXPORT PositionNormalVertex {
public:
/**
* @brief Creates a PositionNormalVertex.
* @param position the position of the vertex (defaut: 0,0,0)
* @param normal the normal of the vertex (defaut: 0,1,0)
*/
PositionNormalVertex();
PositionNormalVertex(const Vector3& position, const Vector3& normal);
PositionNormalVertex(const PositionNormalVertex& other);
PositionNormalVertex(PositionNormalVertex&& other);
PositionNormalVertex& operator=(const PositionNormalVertex& other);
PositionNormalVertex& operator=(PositionNormalVertex&& other);
~PositionNormalVertex(); // = default
[[nodiscard]] PositionNormalVertex copy() const;
/**
* @brief Clones the PositionNormalVertex.
* @returns the cloned PositionNormalVertex
*/
[[nodiscard]] std::unique_ptr<PositionNormalVertex> clone() const;
friend std::ostream& operator<<(std::ostream& os,
const PositionNormalVertex& positionNormalVertex);
public:
/**
* the position of the vertex (defaut: 0,0,0)
*/
Vector3 position;
/**
* the normal of the vertex (defaut: 0,1,0)
*/
Vector3 normal;
}; // end of class PositionNormalVertex
std::ostream& operator<<(std::ostream& os, const PositionNormalVertex& positionNormalVertex);
} // end of namespace BABYLON
#endif // end of BABYLON_MATHS_POSITION_NORMAL_VERTEX_H
|
/* $NetBSD: proforma.c,v 1.3 2012/06/05 00:42:14 christos Exp $ */
/*
* Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* Id: proforma.c,v 1.38 2009/12/04 22:06:37 tbox Exp */
#ifndef RDATA_GENERIC_#_#_C
#define RDATA_GENERIC_#_#_C
#define RRTYPE_#_ATTRIBUTES (0)
static inline isc_result_t
fromtext_#(ARGS_FROMTEXT) {
isc_token_t token;
REQUIRE(type == #);
REQUIRE(rdclass == #);
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
return (ISC_R_NOTIMPLEMENTED);
}
static inline isc_result_t
totext_#(ARGS_TOTEXT) {
REQUIRE(rdata->type == #);
REQUIRE(rdata->rdclass == #);
REQUIRE(rdata->length != 0); /* XXX */
return (ISC_R_NOTIMPLEMENTED);
}
static inline isc_result_t
fromwire_#(ARGS_FROMWIRE) {
REQUIRE(type == #);
REQUIRE(rdclass == #);
/* NONE or GLOBAL14 */
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
return (ISC_R_NOTIMPLEMENTED);
}
static inline isc_result_t
towire_#(ARGS_TOWIRE) {
REQUIRE(rdata->type == #);
REQUIRE(rdata->rdclass == #);
REQUIRE(rdata->length != 0); /* XXX */
/* NONE or GLOBAL14 */
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
return (ISC_R_NOTIMPLEMENTED);
}
static inline int
compare_#(ARGS_COMPARE) {
isc_region_t r1;
isc_region_t r2;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == #);
REQUIRE(rdata1->rdclass == #);
REQUIRE(rdata1->length != 0); /* XXX */
REQUIRE(rdata2->length != 0); /* XXX */
dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2);
return (isc_region_compare(&r1, &r2));
}
static inline isc_result_t
fromstruct_#(ARGS_FROMSTRUCT) {
dns_rdata_#_t *# = source;
REQUIRE(type == #);
REQUIRE(rdclass == #);
REQUIRE(source != NULL);
REQUIRE(#->common.rdtype == type);
REQUIRE(#->common.rdclass == rdclass);
return (ISC_R_NOTIMPLEMENTED);
}
static inline isc_result_t
tostruct_#(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == #);
REQUIRE(rdata->rdclass == #);
REQUIRE(rdata->length != 0); /* XXX */
return (ISC_R_NOTIMPLEMENTED);
}
static inline void
freestruct_#(ARGS_FREESTRUCT) {
dns_rdata_#_t *# = source;
REQUIRE(source != NULL);
REQUIRE(#->common.rdtype == #);
REQUIRE(#->common.rdclass == #);
}
static inline isc_result_t
additionaldata_#(ARGS_ADDLDATA) {
REQUIRE(rdata->type == #);
REQUIRE(rdata->rdclass == #);
(void)add;
(void)arg;
return (ISC_R_SUCCESS);
}
static inline isc_result_t
digest_#(ARGS_DIGEST) {
isc_region_t r;
REQUIRE(rdata->type == #);
REQUIRE(rdata->rdclass == #);
dns_rdata_toregion(rdata, &r);
return ((digest)(arg, &r));
}
static inline isc_boolean_t
checkowner_#(ARGS_CHECKOWNER) {
REQUIRE(type == #);
REQUIRE(rdclass == #);
UNUSED(name);
UNUSED(type);
UNUSED(rdclass);
UNUSED(wildcard);
return (ISC_TRUE);
}
static inline isc_boolean_t
checknames_#(ARGS_CHECKNAMES) {
REQUIRE(rdata->type == #);
REQUIRE(rdata->rdclass == #);
UNUSED(rdata);
UNUSED(owner);
UNUSED(bad);
return (ISC_TRUE);
}
static inline int
casecompare_#(ARGS_COMPARE) {
isc_region_t r1;
isc_region_t r2;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == #);
REQUIRE(rdata1->rdclass == #);
REQUIRE(rdata1->length != 0); /* XXX */
REQUIRE(rdata2->length != 0); /* XXX */
dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2);
return (isc_region_compare(&r1, &r2));
}
#endif /* RDATA_GENERIC_#_#_C */
|
//
// CBJSONEncoder.h
// CBJSON
//
// Created by Jens Alfke on 12/27/13.
// Copyright (c) 2013 Couchbase. All rights reserved.
//
#import <Foundation/Foundation.h>
/** Encodes Cocoa objects to JSON. Supports canonical encoding. */
@interface CBJSONEncoder : NSObject
- (instancetype) init;
- (BOOL) encode: (id)object;
/** If YES, JSON will be generated in canonical form, with consistently-ordered dictionary keys. */
@property BOOL canonical;
@property (readonly, nonatomic) NSError* error;
@property (readonly, nonatomic) NSData* encodedData;
+ (NSData*) encode: (id)object error: (NSError**)outError;
+ (NSData*) canonicalEncoding: (id)object error: (NSError**)outError;
/** Returns the dictionary's keys in the canonical order. */
+ (NSArray*) orderedKeys: (NSDictionary*)dict;
// PROTECTED:
@property (readonly, nonatomic) NSMutableData* output;
- (BOOL) encodeKey: (id)key value: (id)value;
- (BOOL) encodeNestedObject: (id)object;
@end
extern NSString* const CBJSONEncoderErrorDomain;
|
/*
*
* ZDCFormCellSingleLine.h
* ZDCChat
*
* Created by Zendesk on 29/01/2015.
*
* Copyright (c) 2016 Zendesk. All rights reserved.
*
* By downloading or using the Zendesk Mobile SDK, You agree to the Zendesk Master
* Subscription Agreement https://www.zendesk.com/company/customers-partners/#master-subscription-agreement and Application Developer and API License
* Agreement https://www.zendesk.com/company/customers-partners/#application-developer-api-license-agreement and
* acknowledge that such terms govern Your use of and access to the Mobile SDK.
*
*/
#import "ZDCFormCell.h"
/**
* Single line text entry cell for pre chat form fields which presents rows for name,
* email and phone.
*/
@interface ZDCFormCellSingleLine : ZDCFormCell <UITextFieldDelegate>
/**
* The text field providing text entry.
*/
@property (nonatomic, strong) UITextField *textField;
@end
|
/*!
\file main.c
\brief master send and slave receive data use interrupt mode
*/
/*
Copyright (C) 2016 GigaDevice
2014-12-26, V1.0.0, firmware for GD32F1x0(x=3,5)
2016-01-15, V2.0.0, firmware for GD32F1x0(x=3,5,7,9)
2016-04-30, V3.0.0, firmware update for GD32F1x0(x=3,5,7,9)
*/
#include "gd32f1x0.h"
#include "gd32f1x0_it.h"
#include "gd32f1x0_eval.h"
#define arraysize 10
uint32_t send_n = 0, receive_n = 0;
uint8_t spi0_send_array[arraysize] = {0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA };
uint8_t spi1_receive_array[arraysize];
ErrStatus memory_compare(uint8_t* src, uint8_t* dst, uint8_t length);
void rcu_config(void);
void gpio_config(void);
void spi_config(void);
/*!
\brief main function
\param[in] none
\param[out] none
\retval none
*/
int main(void)
{
/* init led1 */
gd_eval_ledinit (LED1);
/* NVIC config */
nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3);
nvic_irq_enable(SPI0_IRQn,1,1);
nvic_irq_enable(SPI1_IRQn,0,1);
/* peripheral clock enable */
rcu_config();
/* GPIO config */
gpio_config();
/* SPI config */
spi_config();
/* SPI int enable */
spi_i2s_interrupt_enable(SPI0, SPI_I2S_INT_TBE);
spi_i2s_interrupt_enable(SPI1, SPI_I2S_INT_RBNE);
/* SPI enable */
spi_enable(SPI1);
spi_enable(SPI0);
/* wait transmit complete */
while(receive_n < arraysize);
/* compare receive data with send data */
if(memory_compare(spi1_receive_array, spi0_send_array, arraysize))
gd_eval_ledon(LED1);
else
gd_eval_ledoff(LED1);
while(1);
}
/*!
\brief configure different peripheral clocks
\param[in] none
\param[out] none
\retval none
*/
void rcu_config(void)
{
rcu_periph_clock_enable(RCU_GPIOA);
rcu_periph_clock_enable(RCU_GPIOB);
rcu_periph_clock_enable(RCU_SPI0);
rcu_periph_clock_enable(RCU_SPI1);
}
/*!
\brief configure the GPIO peripheral
\param[in] none
\param[out] none
\retval none
*/
void gpio_config(void)
{
/* SPI0 GPIO config */
gpio_af_set(GPIOA, GPIO_AF_0, GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
/* SPI1 GPIO config */
gpio_af_set(GPIOB, GPIO_AF_0, GPIO_PIN_13 | GPIO_PIN_14 |GPIO_PIN_15);
gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_13 | GPIO_PIN_14 |GPIO_PIN_15);
gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_13 | GPIO_PIN_14 |GPIO_PIN_15);
}
/*!
\brief configure the SPI peripheral
\param[in] none
\param[out] none
\retval none
*/
void spi_config(void)
{
spi_parameter_struct spi_init_struct;
/* SPI0 parameter config */
spi_init_struct.spi_transmode = SPI_TRANSMODE_FULLDUPLEX;
spi_init_struct.spi_devicemode = SPI_MASTER;;
spi_init_struct.spi_framesize = SPI_FRAMESIZE_8BIT;;
spi_init_struct.spi_ck_pl_ph = SPI_CK_PL_HIGH_PH_2EDGE;
spi_init_struct.spi_nss = SPI_NSS_SOFT;
spi_init_struct.spi_psc = SPI_PSC_4 ;
spi_init_struct.spi_endian = SPI_ENDIAN_MSB;;
spi_init(SPI0, &spi_init_struct);
/* SPI1 parameter config */
spi_init_struct.spi_devicemode = SPI_SLAVE;
spi_init_struct.spi_nss = SPI_NSS_SOFT;
spi_init(SPI1, &spi_init_struct);
}
/*!
\brief memory compare function
\param[in] src : source data pointer
\param[in] dst : destination data pointer
\param[in] length : the compare data length
\param[out] none
\retval ErrStatus : ERROR or SUCCESS
*/
ErrStatus memory_compare(uint8_t* src, uint8_t* dst, uint8_t length)
{
while (length--){
if (*src++ != *dst++)
return ERROR;
}
return SUCCESS;
}
|
/*
* 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/s3/S3_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/s3/model/Tag.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace S3
{
namespace Model
{
class AWS_S3_API Tagging
{
public:
Tagging();
Tagging(const Aws::Utils::Xml::XmlNode& xmlNode);
Tagging& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
inline const Aws::Vector<Tag>& GetTagSet() const{ return m_tagSet; }
inline void SetTagSet(const Aws::Vector<Tag>& value) { m_tagSetHasBeenSet = true; m_tagSet = value; }
inline void SetTagSet(Aws::Vector<Tag>&& value) { m_tagSetHasBeenSet = true; m_tagSet = std::move(value); }
inline Tagging& WithTagSet(const Aws::Vector<Tag>& value) { SetTagSet(value); return *this;}
inline Tagging& WithTagSet(Aws::Vector<Tag>&& value) { SetTagSet(std::move(value)); return *this;}
inline Tagging& AddTagSet(const Tag& value) { m_tagSetHasBeenSet = true; m_tagSet.push_back(value); return *this; }
inline Tagging& AddTagSet(Tag&& value) { m_tagSetHasBeenSet = true; m_tagSet.push_back(std::move(value)); return *this; }
private:
Aws::Vector<Tag> m_tagSet;
bool m_tagSetHasBeenSet;
};
} // namespace Model
} // namespace S3
} // namespace Aws
|
#pragma once
#include <exception>
#include <string>
#if defined DLL_EXPORT
#define SILENCE_EXPORT __declspec(dllexport)
#else
#define SILENCE_EXPORT __declspec(dllimport)
#endif
#pragma warning(disable: 4290)
#pragma warning(disable: 4275)
#pragma warning(disable: 4251)
enum class Component { Label, Texture, Network, Game, Window, Renderer, Audio, FileIO, System };
enum class Author { William };
class SILENCE_EXPORT Error : public std::exception
{
std::string errorMessage;
Component system;
Author owner;
public:
Error(Component sys, std::string msg, Author user = Author::William);
virtual ~Error() throw();
const char * title() const;
const char * what() const override;
}; |
/*
*
* Copyright (c) 2021 Project CHIP 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.
*/
#pragma once
#include <app-common/zap-generated/cluster-objects.h>
#include <app-common/zap-generated/enums.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/data-model/DecodableList.h>
#include <app/util/af.h>
#include <lib/core/Optional.h>
namespace chip {
namespace app {
namespace Clusters {
// TODO: Should this be OTAProvider::Delegate?
/** @brief
* Defines methods for implementing application-specific logic for the OTA Provider Cluster.
*/
class OTAProviderDelegate
{
public:
virtual EmberAfStatus HandleQueryImage(CommandHandler * commandObj, const ConcreteCommandPath & commandPath,
const OtaSoftwareUpdateProvider::Commands::QueryImage::DecodableType & commandData) = 0;
virtual EmberAfStatus
HandleApplyUpdateRequest(CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
const OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::DecodableType & commandData) = 0;
virtual EmberAfStatus
HandleNotifyUpdateApplied(CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
const OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::DecodableType & commandData) = 0;
virtual ~OTAProviderDelegate() = default;
};
} // namespace Clusters
} // namespace app
} // namespace chip
|
/* LzFind.h -- Match finder for LZ algorithms
2009-04-22 : Igor Pavlov : Public domain */
/* Modified by Felix Hanau*/
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned char Byte;
typedef unsigned UInt32;
typedef struct _CMatchFinder
{
const Byte *buffer;
const Byte *bufend;
UInt32 pos;
UInt32 cyclicBufferPos;
UInt32 *hash;
UInt32 *son;
} CMatchFinder;
void MatchFinder_Create(CMatchFinder *p);
void MatchFinder_Free(CMatchFinder *p);
unsigned short Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, unsigned short* distances);
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
void CopyMF(const CMatchFinder *p, CMatchFinder* copy);
static const unsigned crc[256] = {
0u, 1996959894u, 3993919788u, 2567524794u, 124634137u, 1886057615u, 3915621685u, 2657392035u,
249268274u, 2044508324u, 3772115230u, 2547177864u, 162941995u, 2125561021u, 3887607047u, 2428444049u,
498536548u, 1789927666u, 4089016648u, 2227061214u, 450548861u, 1843258603u, 4107580753u, 2211677639u,
325883990u, 1684777152u, 4251122042u, 2321926636u, 335633487u, 1661365465u, 4195302755u, 2366115317u,
997073096u, 1281953886u, 3579855332u, 2724688242u, 1006888145u, 1258607687u, 3524101629u, 2768942443u,
901097722u, 1119000684u, 3686517206u, 2898065728u, 853044451u, 1172266101u, 3705015759u, 2882616665u,
651767980u, 1373503546u, 3369554304u, 3218104598u, 565507253u, 1454621731u, 3485111705u, 3099436303u,
671266974u, 1594198024u, 3322730930u, 2970347812u, 795835527u, 1483230225u, 3244367275u, 3060149565u,
1994146192u, 31158534u, 2563907772u, 4023717930u, 1907459465u, 112637215u, 2680153253u, 3904427059u,
2013776290u, 251722036u, 2517215374u, 3775830040u, 2137656763u, 141376813u, 2439277719u, 3865271297u,
1802195444u, 476864866u, 2238001368u, 4066508878u, 1812370925u, 453092731u, 2181625025u, 4111451223u,
1706088902u, 314042704u, 2344532202u, 4240017532u, 1658658271u, 366619977u, 2362670323u, 4224994405u,
1303535960u, 984961486u, 2747007092u, 3569037538u, 1256170817u, 1037604311u, 2765210733u, 3554079995u,
1131014506u, 879679996u, 2909243462u, 3663771856u, 1141124467u, 855842277u, 2852801631u, 3708648649u,
1342533948u, 654459306u, 3188396048u, 3373015174u, 1466479909u, 544179635u, 3110523913u, 3462522015u,
1591671054u, 702138776u, 2966460450u, 3352799412u, 1504918807u, 783551873u, 3082640443u, 3233442989u,
3988292384u, 2596254646u, 62317068u, 1957810842u, 3939845945u, 2647816111u, 81470997u, 1943803523u,
3814918930u, 2489596804u, 225274430u, 2053790376u, 3826175755u, 2466906013u, 167816743u, 2097651377u,
4027552580u, 2265490386u, 503444072u, 1762050814u, 4150417245u, 2154129355u, 426522225u, 1852507879u,
4275313526u, 2312317920u, 282753626u, 1742555852u, 4189708143u, 2394877945u, 397917763u, 1622183637u,
3604390888u, 2714866558u, 953729732u, 1340076626u, 3518719985u, 2797360999u, 1068828381u, 1219638859u,
3624741850u, 2936675148u, 906185462u, 1090812512u, 3747672003u, 2825379669u, 829329135u, 1181335161u,
3412177804u, 3160834842u, 628085408u, 1382605366u, 3423369109u, 3138078467u, 570562233u, 1426400815u,
3317316542u, 2998733608u, 733239954u, 1555261956u, 3268935591u, 3050360625u, 752459403u, 1541320221u,
2607071920u, 3965973030u, 1969922972u, 40735498u, 2617837225u, 3943577151u, 1913087877u, 83908371u,
2512341634u, 3803740692u, 2075208622u, 213261112u, 2463272603u, 3855990285u, 2094854071u, 198958881u,
2262029012u, 4057260610u, 1759359992u, 534414190u, 2176718541u, 4139329115u, 1873836001u, 414664567u,
2282248934u, 4279200368u, 1711684554u, 285281116u, 2405801727u, 4167216745u, 1634467795u, 376229701u,
2685067896u, 3608007406u, 1308918612u, 956543938u, 2808555105u, 3495958263u, 1231636301u, 1047427035u,
2932959818u, 3654703836u, 1088359270u, 936918000u, 2847714899u, 3736837829u, 1202900863u, 817233897u,
3183342108u, 3401237130u, 1404277552u, 615818150u, 3134207493u, 3453421203u, 1423857449u, 601450431u,
3009837614u, 3294710456u, 1567103746u, 711928724u, 3020668471u, 3272380065u, 1510334235u, 755167117u
};
#ifdef __cplusplus
}
#endif
|
#include <stdio.h>
#include <stdlib.h>
#include "../common/matrix.h"
#include "../common/file_io.h"
#include "../common/vector.h"
#define FILENAME_IN "in.txt"
// TODO: reuse it from lab6
double getA(Matrix *matrix, int ai) {
return matrix->data[ai][matrix->w - 1];
}
double getB(Matrix *matrix, int bj) {
return matrix->data[matrix->h - 1][bj];
}
void setA(Matrix *matrix, int ai, double value) {
matrix->data[ai][matrix->w - 1] = value;
}
void setB(Matrix *matrix, int bj, double value) {
matrix->data[matrix->h - 1][bj] = value;
}
double min(double a, double b) {
return a > b ? b : a;
}
// maybe we should move it out from here to common lib
double sum(DVector *vector) {
double sum = 0;
for (int i = 0; i < vector->size; i++) {
sum += vector->data[i];
}
return sum;
}
int main(int argc, char const *argv[]) {
// reading ..
Matrix *c = matrix_readFile(FILENAME_IN);
printf("matrix in c:\n");
matrix_print(c);
printf("\n");
// pt 1
// TODO: make matrix balanced if needed here
// should be reused (and renamed) method fix_ab() from lab6
// pt 2
// matrix used to store data of matrix c', c0, x0
Matrix* matrix = matrix_copy(c);
for (int j = 0; j< c->w; j++) {
double min = c->data[0][j];
for (int i = 1; i < c->h; i++) {
if (min > c->data[i][j]) {
min = c->data[i][j];
}
}
for (int i = 0;i < c->h; i++) {
matrix->data[i][j] -= min;
}
}
printf("c' :\n");
matrix_print(matrix);
printf("\n");
// pt 3
for (int i = 0; i< c->h; i++) {
double min = c->data[i][0];
for (int j = 1; j < c->w; j++) {
if (min > c->data[i][j]) {
min = c->data[i][j];
}
}
for (int j = 0; j < c->w; j++) {
matrix->data[i][j] -= min;
}
}
printf("c0 :\n");
matrix_print(matrix);
printf("\n");
// // pt 4-5
for (int i = 0; i < matrix->h; i++) {
for (int j = 0; j< matrix->w; j++) {
if (matrix->data[i][j] != 0)
continue;
double ai = getA(matrix, i);
double bj = getB(matrix, j);
matrix->data[i][j] = min(ai, bj);
setA(matrix, i, ai - matrix->data[i][j]);
setB(matrix, j, bj - matrix->data[i][j]);
}
}
// pt 6
// n - нев'язка
// nA - по рядках, nB - по стовпцях
DVector *nA = DVector_allocate(matrix->h);
DVector *nB = DVector_allocate(matrix->w);
for (int i = 0; i < matrix->h; i++) {
nA->data[i] = getA(matrix, i) - sum(matrix_get_row(matrix, i));
}
for (int j = 0; j < matrix->w; j++) {
nB->data[j] = getB(matrix, j) - sum(matrix_get_col(matrix, j));
}
printf("nA: ");
DVector_print(nA);
printf("nB: ");
DVector_print(nB);
double nAB = sum(nA) + sum(nB);
printf("nAB = %lf\n", nAB);
// free memory
matrix_free(c);
matrix_free(matrix);
DVector_free(nA);
DVector_free(nB);
return 0;
} |
//
// BakeMutton.h
// Command
//
// Created by btw on 15/2/26.
// Copyright (c) 2015年 Nihility. All rights reserved.
//
#import "Command.h"
@interface BakeMutton : Command <Command>
@end
|
// Protocol Buffers for Objective C
//
// Copyright 2010 Booyah Inc.
// Copyright 2008 Google 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 OBJC_ENUM_H
#define OBJC_ENUM_H
#include <string>
#include <set>
#include <vector>
#include <google/protobuf/descriptor.h>
namespace google {
namespace protobuf {
namespace io {
class Printer; // printer.h
}
}
namespace protobuf {
namespace compiler {
namespace objectivec {
class EnumGenerator {
public:
explicit EnumGenerator(const EnumDescriptor* descriptor, const FileDescriptor* file);
~EnumGenerator();
void GenerateHeader(io::Printer* printer);
void GenerateSource(io::Printer* printer);
private:
const EnumDescriptor* descriptor_;
const FileDescriptor* file_;
vector<const EnumValueDescriptor*> canonical_values_;
struct Alias {
const EnumValueDescriptor* value;
const EnumValueDescriptor* canonical_value;
};
vector<Alias> aliases_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator);
};
} // namespace objectivec
} // namespace compiler
} // namespace protobuf
} // namespace google
#endif // OBJC_ENUM_H
|
void a() {
return 1;
}
void b() {
return 2;
}
void c() {
return 3;
}
void d() {
return 4;
}
void e() {
return 5;
}
void f() {
return 6;
}
int main( int argc, char** argv ) {
int i;
motion_append_after_call( c, z );
motion_append_after_call( d, z );
motion_append_after_call( e, z );
i = pointcut( z );
return i;
}
|
/* ------------------------------------------------------------------------- */
/*
* Copyright 2007-2018 GRAHAM DUMPLETON
*
* 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 "wsgi_server.h"
#include "wsgi_daemon.h"
/* ------------------------------------------------------------------------- */
/* Base server object. */
server_rec *wsgi_server = NULL;
apr_pool_t *wsgi_daemon_pool = NULL;
const char *wsgi_daemon_group = "";
/* Process information. */
pid_t wsgi_parent_pid = 0;
pid_t wsgi_worker_pid = 0;
pid_t wsgi_daemon_pid = 0;
apr_time_t wsgi_restart_time = 0;
/* New Relic monitoring agent. */
const char *wsgi_newrelic_config_file = NULL;
const char *wsgi_newrelic_environment = NULL;
/* Python interpreter state. */
PyThreadState *wsgi_main_tstate = NULL;
/* Configuration objects. */
WSGIServerConfig *wsgi_server_config = NULL;
WSGIScriptFile *newWSGIScriptFile(apr_pool_t *p)
{
WSGIScriptFile *object = NULL;
object = (WSGIScriptFile *)apr_pcalloc(p, sizeof(WSGIScriptFile));
object->handler_script = NULL;
object->application_group = NULL;
object->process_group = NULL;
return object;
}
WSGIServerConfig *newWSGIServerConfig(apr_pool_t *p)
{
WSGIServerConfig *object = NULL;
object = (WSGIServerConfig *)apr_pcalloc(p, sizeof(WSGIServerConfig));
object->pool = p;
object->alias_list = NULL;
object->socket_prefix = NULL;
#if defined(MOD_WSGI_WITH_DAEMONS)
object->socket_prefix = DEFAULT_REL_RUNTIMEDIR "/wsgi";
object->socket_prefix = ap_server_root_relative(p, object->socket_prefix);
#endif
object->socket_rotation = 1;
object->verbose_debugging = 0;
object->python_warnings = NULL;
object->py3k_warning_flag = -1;
object->python_optimize = -1;
object->dont_write_bytecode = -1;
object->lang = NULL;
object->locale = NULL;
object->python_home = NULL;
object->python_path = NULL;
object->python_eggs = NULL;
object->python_hash_seed = NULL;
object->restrict_embedded = -1;
object->restrict_stdin = -1;
object->restrict_stdout = -1;
object->restrict_signal = -1;
#if defined(WIN32) || defined(DARWIN)
object->case_sensitivity = 0;
#else
object->case_sensitivity = 1;
#endif
object->restrict_process = NULL;
object->process_group = NULL;
object->application_group = NULL;
object->callable_object = NULL;
object->dispatch_script = NULL;
object->pass_apache_request = -1;
object->pass_authorization = -1;
object->script_reloading = -1;
object->error_override = -1;
object->chunked_request = -1;
object->ignore_activity = -1;
object->enable_sendfile = -1;
object->server_metrics = -1;
object->newrelic_config_file = NULL;
object->newrelic_environment = NULL;
return object;
}
/* ------------------------------------------------------------------------- */
/* vi: set sw=4 expandtab : */
|
//#import <UIKit/UIKit.h>
#import "ZMBaseViewController.h"
#import "JHPopoverViewController.h"
#import "UIExpandingTextView.h"
@interface ZMMdlBbsVCtrl : ZMBaseViewController<UITableViewDataSource,UITableViewDelegate,UITextViewDelegate>
{
UIExpandingTextView * TV_Draft_Content ;
UIScrollView * forumTitleScrollView;
//datasource
//NSMutableArray * Course_Arr;
NSMutableArray * Forum_Arr_User;
NSMutableArray * Forum_Arr_Course;
NSMutableArray * Bbs_Arr;
UIPopoverController * popoverViewController;
//int selectCourseIndex;
int selectForumIndex;
int selectForumIndex2;
//BOOL isGetForumByCourse;
}
@property (nonatomic, strong)UIPanGestureRecognizer *panGestureRecognizer;
@property (nonatomic, strong)UIButton *panBtn;
@property (nonatomic, strong)UIButton *gousiBtn;
@property (nonatomic, strong)UIButton *luntanBtn;
@property (nonatomic, strong)UIButton *shijuanBtn;
@property (nonatomic, strong)UIButton *zuoyeBtn;
@property (nonatomic, strong)UIButton *toupiaoBtn;
@property (nonatomic, strong)UIButton *qiangdaBtn;
@property (nonatomic, strong)UIButton *hezuoBtn;
@end
|
#if !defined(AFX_PCXEXPORT_H__083C40D4_C400_4AAD_B145_5178DFACB86E__INCLUDED_)
#define AFX_PCXEXPORT_H__083C40D4_C400_4AAD_B145_5178DFACB86E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
// NOTE: Do not modify the contents of this file. If this class is regenerated by
// Microsoft Visual C++, your modifications will be overwritten.
/////////////////////////////////////////////////////////////////////////////
// CPCXExport wrapper class
class CPCXExport : public COleDispatchDriver
{
public:
CPCXExport() {} // Calls COleDispatchDriver default constructor
CPCXExport(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
CPCXExport(const CPCXExport& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
long GetWidth();
void SetWidth(long nNewValue);
long GetHeight();
void SetHeight(long nNewValue);
void SaveToFile(LPCTSTR FileName);
VARIANT SaveToStream();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PCXEXPORT_H__083C40D4_C400_4AAD_B145_5178DFACB86E__INCLUDED_)
|
/* newmail, version 1.0 ©2006 Robert Lillack, burningsoda.com */
#include <dirent.h>
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef HAVE_NAMLEN
#define NAMLEN(x) x->d_namlen
#else
#define NAMLEN(x) strlen(x->d_name)
#endif
struct dirnode {
char *name;
int unreadmails;
};
int compare_dirnodes(const void *n1, const void *n2) {
return strcmp((*(struct dirnode**)n1)->name, (*(struct dirnode**)n2)->name);
}
int is_maildir(const char *pathname) {
DIR *dir;
struct dirent *e;
struct stat sb;
int found = 0;
dir = opendir(pathname);
if (!dir) return 0;
while ((e = readdir(dir)) != NULL) {
if (NAMLEN(e) == 3 &&
((strncmp(e->d_name, "cur", 3) == 0) ||
(strncmp(e->d_name, "new", 3) == 0) ||
(strncmp(e->d_name, "tmp", 3) == 0))) {
char subdir[MAXPATHLEN + 1];
snprintf(subdir, sizeof(subdir), "%s/%s", pathname, e->d_name);
if ((stat(subdir, &sb) == 0) && S_ISDIR(sb.st_mode)) found++;
}
}
closedir(dir);
if (found == 3) return 1;
else return 0;
}
int get_file_count(char *pathname, int checkflags) {
DIR *dir;
struct dirent *entry;
int found = 0;
char *comma;
dir = opendir(pathname);
if (!dir) return -1;
while ((entry = readdir(dir)) != NULL) {
/* since we don't want to stat() here, we loose
* the ability to check for d_type == DT_DIR
* to stay ANSI conform. */
if (NAMLEN(entry) < 10) continue;
if (checkflags) {
/* make sure the SEEN flag is not there */
comma = rindex(entry->d_name, ',');
if (comma && strchr(comma, 'S') == NULL)
found++;
} else {
found++;
}
}
closedir(dir);
return found;
}
void error_quit(char *message) {
if (message) {
fprintf(stderr, "%s\n", message);
} else {
fprintf(stderr, "Unable to allocate more memory. Exiting...\n");
}
exit(1);
}
int main(int argc, char **argv) {
DIR* maildir;
struct dirent *entry;
struct dirnode *dp = NULL;
struct dirnode **dirlist = NULL;
int dirlist_count = 0;
char maildirname[MAXPATHLEN + 1] = "";
int showonlynew = 0;
int muttmode = 0;
int showtotal = 0;
int showall = 0;
int i, j;
static struct option long_options[] = {
{"all", 0, 0, 'a'},
{"mutt", 0, 0, 'm'},
{"total", 0, 0, 't'},
{"no-unseen", 0, 0, 'n'},
{0, 0, 0, 0}
};
while ((i = getopt_long(argc, argv, "amnt", long_options, NULL)) != -1) {
switch (i) {
case 'a': showall = 1; break;
case 'm': muttmode = 1; break;
case 'n': showonlynew = 1; break;
case 't': showtotal = 1; break;
default: break;
}
}
if (optind < argc) {
if (optind + 1 < argc) {
fprintf(stderr, "%s: Only one directory structure allowed. "
"Using: %s\n", argv[0], argv[optind]);
}
snprintf(maildirname, sizeof(maildirname), argv[optind]);
} else {
if (!getenv("HOME")) error_quit("Unable to determine $HOME directory");
snprintf(maildirname, sizeof(maildirname), "%s/Maildir", getenv("HOME"));
}
if (!is_maildir(maildirname) && !muttmode) {
fprintf(stderr, "warning: %s itself is not a Maildir."
" Continuing anyway...\n",
maildirname);
}
maildir = opendir(maildirname);
if (!maildir) {
fprintf(stderr, "Directory %s does not exist.\n", maildirname);
return -1;
}
/* step through the directory and find subdirs which are Maildirs */
while ((entry = readdir(maildir)) != NULL) {
if (!entry->d_name) continue;
if (NAMLEN(entry) == 2 && strncmp(entry->d_name, "..", 2) == 0) continue;
char fullname[MAXPATHLEN + 1];
snprintf(fullname, sizeof(fullname), "%s/%s", maildirname, entry->d_name);
if (is_maildir(fullname)) {
int mailcount = 0;
int pnamelen = strlen(fullname);
if (pnamelen + 4 >= sizeof(fullname)) {
fprintf(stderr, "Path name too long to access subdirs: %s\n", fullname);
exit(-1);
}
strncpy(fullname + pnamelen, "/new", 4);
fullname[pnamelen + 4] = '\0';
mailcount = get_file_count(fullname, 0);
if (showall || (!showall && !showonlynew)) {
strncpy(fullname + pnamelen, "/cur", 4);
fullname[pnamelen + 4] = '\0';
mailcount += get_file_count(fullname, 1 - showall);
}
if (!mailcount) continue;
/* put the results into a dirnode structure... */
dp = (struct dirnode*) malloc(sizeof(struct dirnode));
if (!dp) error_quit(NULL);
dp->name = (char*) malloc((NAMLEN(entry) + 1) * sizeof(char));
if (!dp->name) error_quit(NULL);
strncpy(dp->name, entry->d_name, NAMLEN(entry));
dp->name[NAMLEN(entry)] = '\0';
dp->unreadmails = mailcount;
/* ...and add it to our list. */
dirlist = (struct dirnode**) realloc(dirlist,
(dirlist_count + 1) *
sizeof(struct dirnode*));
if (!dirlist) error_quit(NULL);
dirlist[dirlist_count] = dp;
dirlist_count++;
}
}
closedir(maildir);
if (showtotal) {
j = 0;
for (i = 0; i < dirlist_count; i++) {
j += dirlist[i]->unreadmails;
free(dirlist[i]->name);
free(dirlist[i]);
}
free(dirlist);
printf("%i\n", j);
exit(EXIT_SUCCESS);
}
qsort(dirlist, dirlist_count, sizeof(struct dirnode*), compare_dirnodes);
for (i = 0; i < dirlist_count; i++) {
dp = dirlist[i];
/* convert dots to slashes */
if (!muttmode) {
for(j = 0; j < strlen(dp->name); j++)
if (dp->name[j] == '.')
dp->name[j] = '/';
}
if (muttmode) {
printf("\"=%s\" ", dp->name);
} else {
printf("%6i %s\n", dp->unreadmails,
(strlen(dp->name) == 1 && dp->name[0] == '/')
? "[ INBOX ]" : dp->name);
}
free(dp->name);
free(dp);
}
free(dirlist);
exit(EXIT_SUCCESS);
}
|
#ifndef __MONO_NATIVE_MSCORLIB_SYSTEM_RUNTIMEFIELDHANDLE_H
#define __MONO_NATIVE_MSCORLIB_SYSTEM_RUNTIMEFIELDHANDLE_H
#include <mscorlib/System/mscorlib_System_ValueType.h>
#include <mscorlib/System/Runtime/Serialization/mscorlib_System_Runtime_Serialization_ISerializable.h>
#include <mscorlib/System/mscorlib_System_Object.h>
namespace mscorlib
{
namespace System
{
namespace Runtime
{
namespace Serialization
{
class SerializationInfo;
class StreamingContext;
}
}
}
}
namespace mscorlib
{
namespace System
{
class String;
class Type;
}
}
namespace mscorlib
{
namespace System
{
class RuntimeFieldHandle
: public mscorlib::System::ValueType
, public virtual mscorlib::System::Runtime::Serialization::ISerializable
{
public:
RuntimeFieldHandle(mscorlib::NativeTypeInfo *nativeTypeInfo)
: mscorlib::System::ValueType(nativeTypeInfo)
, mscorlib::System::Runtime::Serialization::ISerializable(NULL)
{
};
RuntimeFieldHandle(MonoObject *nativeObject)
: mscorlib::System::ValueType(nativeObject)
, mscorlib::System::Runtime::Serialization::ISerializable(nativeObject)
{
};
~RuntimeFieldHandle()
{
};
RuntimeFieldHandle & operator=(RuntimeFieldHandle &value) { __native_object__ = value.GetNativeObject(); return value; };
bool operator==(RuntimeFieldHandle &value) { return mscorlib::System::Object::Equals(value); };
operator MonoObject*() { return __native_object__; };
MonoObject* operator=(MonoObject* value) { return __native_object__ = value; };
virtual void GetObjectData(mscorlib::System::Runtime::Serialization::SerializationInfo info, mscorlib::System::Runtime::Serialization::StreamingContext context);
virtual mscorlib::System::Boolean Equals(mscorlib::System::Object obj) override;
mscorlib::System::Boolean Equals(mscorlib::System::RuntimeFieldHandle handle);
virtual mscorlib::System::Int32 GetHashCode() override;
virtual MonoObject* GetNativeObject() override { return __native_object__; };
//Public Properties
__declspec(property(get=get_Value)) mscorlib::System::IntPtr Value;
//Get Set Properties Methods
// Get:Value
mscorlib::System::IntPtr get_Value() const;
protected:
private:
};
}
}
#endif
|
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <assert.h>
#include <dirent.h>
#include <cstdint>
#include <math.h>
#include <map>
#include <queue>
#include <set>
#include <limits>
#include <unistd.h>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <list>
#include <array>
#ifndef MKPARTITION_UTILS_H
#define MKPARTITION_UTILS_H
typedef std::unordered_set<u_int> my_set;
typedef std::unordered_map<u_long,u_long> my_map;
typedef std::vector<u_int> my_vect;
typedef std::list<u_long> my_ll;
struct timing_data {
pid_t pid;
u_long index;
short syscall;
u_int ut; //should I not include this as it is only used to calculate dtiming?
u_int fft; //the timing from our ff data
bool can_attach;
short blocking_syscall; //the syscall number that is forcing this to be unattachable
pid_t blocking_pid; //the syscall number that is forcing this to be unattachable
pid_t forked_pid; //the pid of the forked process (if applicable).
bool should_track; //should I track this rp_timing?
u_long call_clock; //the clock value of the most recent sync operation before this syscall is called.
u_long start_clock; //when the syscall starts
u_long stop_clock; //when the syscall is done running
u_long aindex;
//used to estimate dift time
double dtiming;
double ftiming;; //the timing from our ff data
uint64_t cache_misses;
u_long taint_in; //the amount of taint that we've gotten in at this point
u_long taint_out; //the amount of taint that we've output at this point
my_vect sampled_insts;
// my_set pin_traces; //traces from a previously produced round
// my_ll pin_traces;
my_vect pin_traces; //gathered from a first query with pin
u_long num_merges; //gathered from a first query with pin
u_long num_saved; //gathered from a first query with pin
u_long imisses;
};
struct partition {
pid_t pid; //the pid for this partition
u_long start_clock; //start clock for this parititon
u_long stop_clock; //stop clock for this parititon
char start_level[8];
char stop_level[8];
int start_i; //the start index (within timing_data array) of the begin of this part. If this is user level,
//this refers to the start of the user level splits
int stop_i; //the stop index (within timing_data array) of the begin of this part. If this is user level,
//this refers to the stop of the user level splits
};
//used simply for the read from the file system
struct replay_timing {
pid_t pid;
u_long index;
short syscall;
u_int ut;
uint64_t cache_misses;
};
struct ckpt_data {
u_long proc_count;
unsigned long long rg_id;
int clock;
};
struct ckpt_proc_data {
pid_t record_pid;
long retval;
loff_t logpos;
u_long outptr;
u_long consumed;
u_long expclock;
};
struct pin_trace_iter {
char* dir; //the directory where the trace files are located
u_int epochs; //the number of epochs
u_int curr_epoch; //the number of epochs
int fd; //the fd that is currently opened for the trace file
u_long *log; //the pointer to our buffer
u_long filedone; //the size of our file
u_long mapsize; //the size that we mapped, used to munmap when we need
u_long fileoffset; //the offset within the file
u_long bufstart; //the start of the current region (to figure out how far we've gone)
u_long num_merges; //running total of the number of merges across all files
//////
//all the data for the current item
//////
u_long cpid; //the current item's pid
u_long cclock; //the current item's clock
u_long csysnum; //the current item's sysnum
u_long cnmerges;//the current item's num_merges
u_long *ctraces; //the traces in the current item
};
#define MAX_CKPT_CNT 1024
struct ckpt {
char name[20];
u_long index;
u_long rp_clock;
};
int generate_timings(std::vector<struct timing_data> td, u_int num_parts, char *fork_flags,char *pin_dir, int pin_epochs);
int parse_klogs(std::vector<struct timing_data> &td, const u_long stop_clock, const char* dir, const char* fork_flags, const std::unordered_set<pid_t> procs);
int parse_ulogs(std::vector<struct timing_data> &td, const char* dir);
int parse_timing_data(std::vector<struct timing_data> &td);
int adjust_for_ckpts(std::vector<struct timing_data> &td, struct ckpt *ckpts, int ckpt_cnt);
int parse_instructions(std::vector<struct timing_data> &td, FILE *file);
int parse_pin_instructions(my_map &ninsts, char* dir, u_int epochs);
int parse_pin_traces(std::vector<struct timing_data> &td,char* dir, u_int epochs);
int parse_pin_traces_saved(std::vector<struct timing_data> &td,char* dir, u_int epochs);
u_long pin_trace_iter_next( struct pin_trace_iter &pti);
int init_pin_trace_iter(struct pin_trace_iter &pti, char *dir, u_int epochs);
int destroy_pin_trace_iter(struct pin_trace_iter &pti);
#endif /* MKPARTITION_UTILS_H*/
|
/*
* Copyright (C) 2001-2003 by egnite Software GmbH. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holders nor the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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
* COPYRIGHT OWNER 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.
*
* For additional information see http://www.ethernut.de/
*
*/
/*
* $Log$
* Revision 1.2 2009/01/17 15:37:52 haraldkipp
* Added some NUTASSERT macros to check function parameters.
*
* Revision 1.1.1.1 2003/05/09 14:40:33 haraldkipp
* Initial using 3.2.1
*
* Revision 1.1 2003/02/04 17:49:09 harald
* *** empty log message ***
*
*/
#include "nut_io.h"
#include <sys/nutdebug.h>
/*!
* \addtogroup xgCrtStdio
*/
/*@{*/
/*!
* \brief Write formatted data to a string.
*
* \param buffer Pointer to a buffer that receives the output string.
* \param fmt Format string containing conversion specifications.
*
* \return The number of characters written or a negative value to
* indicate an error.
*/
int sprintf(char *buffer, const char *fmt, ...)
{
int rc;
va_list ap;
NUTASSERT(fmt != NULL);
va_start(ap, fmt);
rc = vsprintf(buffer, fmt, ap);
va_end(ap);
return rc;
}
/*@}*/
|
/*
Copyright (c) 2017, Palo Alto Research Center
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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.
*/
// The source file being tested
#include <LongBow/unit-test.h>
#include "../src/folio_LinkedList.c"
LONGBOW_TEST_RUNNER(folio_LinkedList)
{
LONGBOW_RUN_TEST_FIXTURE(Global);
}
LONGBOW_TEST_RUNNER_SETUP(folio_LinkedList)
{
return LONGBOW_STATUS_SUCCEEDED;
}
LONGBOW_TEST_RUNNER_TEARDOWN(folio_LinkedList)
{
return LONGBOW_STATUS_SUCCEEDED;
}
LONGBOW_TEST_FIXTURE(Global)
{
LONGBOW_RUN_TEST_CASE(Global, folioLinkedList_Create);
LONGBOW_RUN_TEST_CASE(Global, folioLinkedList_Append);
}
LONGBOW_TEST_FIXTURE_SETUP(Global)
{
return LONGBOW_STATUS_SUCCEEDED;
}
LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
{
int status = LONGBOW_STATUS_SUCCEEDED;
if (!folio_TestRefCount(0, stdout, "Memory leak in %s\n", longBowTestCase_GetFullName(testCase))) {
folio_Report(stdout);
status = LONGBOW_STATUS_MEMORYLEAK;
}
return status;
}
LONGBOW_TEST_CASE(Global, folioLinkedList_Create)
{
FolioLinkedList *list = folioLinkedList_Create();
assertNotNull(list, "Got null from create");
folioLinkedList_Release(&list);
}
typedef struct integer_t {
int value;
} Integer;
LONGBOW_TEST_CASE(Global, folioLinkedList_Append)
{
FolioLinkedList *list = folioLinkedList_Create();
assertNotNull(list, "Got null from create");
const size_t count = 4;
Integer *truthArray[count];
for (unsigned i = 0; i < count; ++i) {
Integer *integer = folio_Allocate(sizeof(Integer));
integer->value = i;
truthArray[i] = integer;
folioLinkedList_Append(list, integer);
}
for (unsigned i = 0; i < count; ++i) {
Integer *truth = truthArray[i];
Integer *test = folioLinkedList_Remove(list);
assertTrue(truth->value == test->value, "Wrong element, expected %d actual %d",
truth->value, test->value);
folio_Release((void **) &truth);
folio_Release((void **) &test);
}
folioLinkedList_Release(&list);
}
/*****************************************************/
/*****************************************************/
int
main(int argc, char *argv[argc])
{
LongBowRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(folio_LinkedList);
int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner, NULL);
longBowTestRunner_Destroy(&testRunner);
exit(exitStatus);
}
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ActorFactories/ActorFactory.h"
#include "ActorFactoryEmitter.generated.h"
UCLASS(MinimalAPI, config=Editor, collapsecategories, hidecategories=Object)
class UActorFactoryEmitter : public UActorFactory
{
GENERATED_UCLASS_BODY()
// Begin UActorFactory Interface
virtual void PostSpawnActor( UObject* Asset, AActor* NewActor ) override;
virtual void PostCreateBlueprint( UObject* Asset, AActor* CDO ) override;
virtual bool CanCreateActorFrom( const FAssetData& AssetData, FText& OutErrorMsg ) override;
virtual UObject* GetAssetFromActorInstance(AActor* ActorInstance) override;
// End UActorFactory Interface
};
|
#ifndef _TINYSRV_CONNECTION_H
#define _TINYSRV_CONNECTION_H
#include "project.h"
#include "config.h"
#include "http.h"
struct ts_connection {
const char *str;
int length;
int filefd;
ps_http_request_header_t *request;
ps_http_response_header_t *response;
};
typedef struct ts_connection ps_connection_t;
static const char content_noSSL[] =
"\x15" /* Alert (21) */
"\x03\x00" /* Version 3.0 */
"\x00\x02" /* length 02 */
"\x02" /* fatal */
"\x00" /* 0 close notify, 0x28 Handshake failure 40, 0x31 TLS access denied 49 */
"\x00"; /* string terminator (not part of actual response) */
static const char content_jsclose[] =
"<!DOCTYPE html><html><head><meta charset='utf-8'/>"
"<title></title><script type='text/javascript'>"
"var a=window,b=document,c=b.referrer,z='.',D=function(u){var d=u.indexOf('://')>-1?u.split('/')[2]:u.split('/')[0];return d.indexOf(z)>-1?d:d.split(z)[0]};"
"if(self==top){a.close();if(c&&c.length>0){var d=D(c),e=d.split(z).reverse();if(e.length>1){var f='u='+e.slice(0,2).reverse().join(z);b.cookie!=f&&(b.cookie=f,a.history.back())}}}"
"</script></head></html>";
int connection_new(ts_socket_t *, int);
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.