text
stringlengths 4
6.14k
|
|---|
// ---------------------------------------------------------------------------
//
// This file is part of the <kortex> library suite
//
// Copyright (C) 2013 Engin Tola
//
// See LICENSE file for license information.
//
// author: Engin Tola
// e-mail: engintola@gmail.com
// web : http://www.engintola.com
//
// ---------------------------------------------------------------------------
#ifndef KORTEX_STRUCTS_H
#define KORTEX_STRUCTS_H
#include <cmath>
#include <kortex/math.h>
namespace kortex {
struct Point2d {
double x;
double y;
Point2d() {
x = 0.0;
y = 0.0;
}
Point2d(double x_, double y_) {
x = x_;
y = y_;
}
};
struct Circle2d {
double cx, cy;
double r;
Circle2d() {
cx = cy = 0.0;
r = 1.0;
}
Circle2d( double x0, double y0, double rad ) {
cx = x0;
cy = y0;
r = rad;
}
};
struct Segment2d {
double x0, y0;
double x1, y1;
Segment2d() { x0 = y0 = x1 = y1 = 0.0; }
Segment2d( double x0_, double y0_, double x1_, double y1_ ) {
x0 = x0_;
y0 = y0_;
x1 = x1_;
y1 = y1_;
}
};
/// line equation ax + by + c = 0
struct Line2d {
double a, b, c;
Line2d() {
a = b = c = 0.0;
}
Line2d( double a_, double b_, double c_ ) {
a = a_;
b = b_;
c = c_;
}
Line2d( double x0, double y0, double x1, double y1 ) {
if( fabs( x1-x0 ) > 1e-20 ) {
a = -( y1-y0 ) / (x1-x0 );
b = 1.0;
c = -a*x0 - b*y0;
} else {
a = 1.0;
b = 0.0;
c = -x0;
}
}
bool is_vertical() const {
return (b==0.0);
}
double y_intercept( int x0 ) const {
if( b != 0.0 ) {
return -(a*x0+c)/b;
} else {
return 1e30;
}
}
double x_intercept( int y0 ) const {
return -(b*y0+c) / a;
}
};
}
#endif
|
#ifndef IMAGEANALYZER_H
#define IMAGEANALYZER_H
#include <D2d1helper.h>
#include <mfapi.h>
#include "Common.h"
// Forward declarations
class ImageProcessingUtils;
class ObjectDetails;
class ImageAnalyzer
{
public:
ImageAnalyzer(ImageProcessingUtils* imageProcessingUtils);
~ImageAnalyzer();
public:
std::vector<ObjectDetails*> extractObjectDetails(
const UINT16* organizedObjectMap, const UINT32& objectMapWidth, const UINT32& objectMapHeight, const UINT16& objectCount) const;
std::vector<UINT16>* resolveLargeObjectIds(
const UINT16* organizedObjectMap,
const UINT32& objectMapWidth, const UINT32& objectMapHeight,
UINT16& objectCount, const UINT32& minSize) const;
std::vector<ConvexHull*> extractConvexHullsOfLargestObjects(
BYTE* binaryImage, const UINT32& imageWidth, const UINT32& imageHeight, const D2D_RECT_U& targetRect,
const UINT8& maxNumberOfConvexHulls, const GUID& videoFormatSubtype) const;
ConvexHull* convexHullClosestToCircle(const std::vector<ConvexHull*> &convexHulls, LONG &error) const;
void calculateConvexHullDimensions(
const ConvexHull& convexHull,
UINT32& width, UINT32& height, UINT32& centerX, UINT32& centerY) const;
ObjectDetails* convexHullDimensionsAsObjectDetails(const ConvexHull& convexHull) const;
ObjectDetails* convexHullMinimalEnclosingCircleAsObjectDetails(const ConvexHull& convexHull) const;
LONG circleCircumferenceError(
const ConvexHull& convexHull, const double& radius, const D2D_POINT_2U& center) const;
double circleAreaError(UINT32 measuredDiameter, UINT32 measuredArea) const;
ConvexHull* extractBestCircularConvexHull(std::vector<ConvexHull*>& convexHulls) const;
ConvexHull* extractBestCircularConvexHull(
BYTE* binaryImage, const UINT32& imageWidth, const UINT32& imageHeight, const D2D_RECT_U& targetRect,
const UINT8& maxCandidates, const GUID& videoFormatSubtype, bool drawConvexHulls = false) const;
ConvexHull* extractBestCircularConvexHull(
BYTE* binaryImage, const UINT32& imageWidth, const UINT32& imageHeight,
const UINT8& maxCandidates, const GUID& videoFormatSubtype, bool drawConvexHulls = false) const;
bool objectCenterIsWithinConvexHullBounds(const ObjectDetails& objectDetails, const ConvexHull& convexHull) const;
void getMinimalEnclosingCircle(const ConvexHull& convexHull, double& radius, D2D_POINT_2U& circleCenter) const;
private:
void getPointOnCircumference(const D2D_POINT_2U& center, const double& radius, const double& angle, D2D_POINT_2L& point) const;
void sortObjectDetailsBySize(std::vector<ObjectDetails*> &objectDetails) const;
private: // Members
ImageProcessingUtils* m_imageProcessingUtils; // Not owned
};
#endif // IMAGEANALYZER_H
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
@class NSNumberFormatter, NSString;
@interface PLValue : NSObject
{
id _value;
NSString *_unit;
short _formatter;
}
+ (id)valueWithValue:(id)arg1 withUnit:(id)arg2 withFormat:(short)arg3;
+ (id)valueWithDate:(id)arg1 withUnit:(id)arg2 withFormat:(short)arg3;
+ (id)valueWithString:(id)arg1 withUnit:(id)arg2 withFormat:(short)arg3;
+ (id)valueWithNumber:(id)arg1 withUnit:(id)arg2 withFormat:(short)arg3;
+ (id)valueWithTimeIntervalSince1970:(double)arg1 withUnit:(id)arg2 withFormat:(short)arg3;
+ (id)valueWithBool:(_Bool)arg1 withUnit:(id)arg2 withFormat:(short)arg3;
+ (id)valueWithLong:(long long)arg1 withUnit:(id)arg2 withFormat:(short)arg3;
+ (id)valueWithDouble:(double)arg1 withUnit:(id)arg2 withFormat:(short)arg3;
+ (id)formattedStringForDate:(id)arg1;
@property short formatter; // @synthesize formatter=_formatter;
@property(retain, nonatomic) NSString *unit; // @synthesize unit=_unit;
@property(retain, nonatomic) id value; // @synthesize value=_value;
- (long long)compare:(id)arg1;
- (id)description;
- (double)timeIntervalSince1970;
- (_Bool)boolValue;
- (long long)longValue;
- (double)doubleValue;
- (void)dealloc;
- (id)init;
@property(readonly) NSNumberFormatter *numberFormatter;
@end
|
#include<stdio.h>
#include<stdlib.h>
void bubble(int vet[], int n) //funcao para ordenar o vetor
{
int a, j, i;
for(j=0; j<n-j; j++) //percorre o vetor
{
for (i=0; i<n-j-1;i++) /*percorre o vetor e compara cada elemento com o do seu lado direito (vet[i+1]).
Se o elemento da direita for menor, troca os dois de lugar*/
{
if (vet[i+1]<vet[i])
{
a=vet[i+1];
vet[i+1]=vet[i];
vet[i]=a; //feita a troca
}
}
}
}
closestpair(int vet[], int n) //funcao que compara os elementos e acha o par com a menor diferenca
{
int i, c, dif, posicao=0;
dif=vet[1] - vet[0]; //dif eh inicializada com a diferenca entre os dois primeiros elementos.
for (i=1; i<n-1; i++)
{
c=vet[i+1] - vet[i]; //a partir do elemnto na posicao 1, cada par eh comparado
if (c < dif)
{
dif = c;//encontra diferencas menores que a dos dois pimeiros
posicao = i;//armazena tambem a posicao dos numeros com a menor diferenca
}
}
printf("%d e %d, nas posicoes %d e %d respectivamente. Sua diferenca eh %d.", vet[posicao], vet[posicao + 1], posicao, posicao +1, dif);
}
int main()
{
int i, n, *vet;//declara o ponteiro que sera apontado para o endereco que malloc ira retornar
printf("Quantos numeros serao entrados?\n");
scanf("%d", &n);
while (n<2)
{
printf("Favor digitar um numero maior que 1.\n");//para que nao seja digitado um numero que de erro no programa
scanf("%d", &n);
}
vet=(int*)malloc(n*sizeof(int));
printf("Digite os numeros: ");
for (i=0; i<n; i++)//esse for preenche o vetor
scanf("%d", &vet[i]);
bubble(vet, n); //ordena o vetor
printf("\nOs dois elementos com a menor diferenca sao:\n");
closestpair(vet, n);//chama a funcao que imprime os dois numeros com a menor diferenca
free(vet);//libera a memoria alocada
}
|
//
// SOSimulateDB.h
// SODownloader_Example
//
// Created by 张豪 on 2017/11/5.
// Copyright © 2017年 scfhao. All rights reserved.
//
#import <Foundation/Foundation.h>
@class SOMusic;
/**
为了使整个 Demo 的功能更加完善,SimulateDB 类演示保存下载任务状态的功能。
大家在看 SOSimulateDB 类的代码的时候,可以“假装”这是一个数据库 :P
当你在你的项目中使用 SODownloader 完成下载功能时,要用你应用中的持久化方案(CoreData、FMDB等)代替 SimulateDB 的功能。
*/
@interface SOSimulateDB : NSObject
/// 保存一个下载任务的下载状态,当一个下载任务的下载状态改变的时候就需要保存到磁盘
+ (void)save:(SOMusic *)music;
/// 获取数据库中记录的处于下载中的任务数组
+ (NSArray *)downloadingMusicArrayInDB;
/// 获取数据库中记录的处于暂停状态的任务数组
+ (NSArray *)pausedMusicArrayInDB;
/// 获取数据库中记录的已下载的任务数组
+ (NSArray *)complatedMusicArrayInDB;
@end
|
/*
* CoopInfoReqMsg.h
*
* Created on: 18/set/2014
* Author: greeneyes
*/
#ifndef SRC_MESSAGES_COOPINFOREQMSG_H_
#define SRC_MESSAGES_COOPINFOREQMSG_H_
#include <Messages/Message.h>
class CoopInfoReqMsg: public Message {
private:
public:
CoopInfoReqMsg(NetworkNode* const src, NetworkNode* const dst,
const LinkType linkType) :
Message(src, dst, linkType) {
_msg_type = MESSAGETYPE_COOP_INFO_REQ;
}
CoopInfoReqMsg(Header* const header) :
Message(header) {
_msg_type = MESSAGETYPE_COOP_INFO_REQ;
}
};
#endif /* CoopInfoReqMsg_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.
*/
//
// AppDelegate.h
// What A Nice Number
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Cordova/CDVViewController.h>
@interface AppDelegate : NSObject <UIApplicationDelegate>{}
// invoke string is passed to your app on launch, this is only valid if you
// edit What A Nice Number-Info.plist to add a protocol
// a simple tutorial can be found here :
// http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
@property (nonatomic, strong) IBOutlet UIWindow* window;
@property (nonatomic, strong) IBOutlet CDVViewController* viewController;
@end
|
//
// WDECSegment.h
// WDeCom
//
// Created by Vrana, Jozef on 20/09/2018.
// Copyright © 2018 Wirecard Technologies GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface WDECSegment : NSObject
/** Carrier code
@brief The 2-letter airline code (e.g. LH, BA, KL) supplied by IATA for each leg of a flight.
@details Max. length 3. It is optional.
*/
@property (strong, nonatomic) NSString *carrierCode;
/** Departure airport code
@brief The departure airport code. IATA assigns the airport codes.
@details Max. length 3. It is optional.
*/
@property (strong, nonatomic) NSString *departureAirportCode;
/** Departure city code
@brief The departure city code of the itinerary segment. IATA assigns the airport codes.
@details Max. length 32. It is optional.
*/
@property (strong, nonatomic) NSString *departureCityCode;
/** Arrival code
@brief The arrival airport code of the itinerary segment. IATA assigns the airport codes.
@details Max. length 3. It is optional.
*/
@property (strong, nonatomic) NSString *arrivalAirportCode;
/** Arrival city code
@brief The arrival city code of the itinerary segment. IATA assigns the airport codes.
@details Max. length 32. It is optional.
*/
@property (strong, nonatomic) NSString *arrivalCityCode;
/** Departure date
@brief The departure date for a given leg.
*/
@property (strong, nonatomic) NSDate *departureDate;
/** Arrival date
@brief The arrival date of the itinerary segment. IATA assigns the airport codes.
*/
@property (strong, nonatomic) NSDate *arrivalDate;
/** Flight number
@brief The city of the address of the airline transaction issuer.
@details Max. length 6. It is optional.
*/
@property (strong, nonatomic) NSString *flightNumber;
/** Fare class
@brief Used to distinguish between First Class, Business Class and Economy Class, but also used to distinguish between different fares and booking codes within the same type of service.
@details Max. length 3. It is optional.
*/
@property (strong, nonatomic) NSString *fareClass;
/** Fare basis
@brief Represents a specific fare and class of service with letters, numbers, or a combination of both.
@details Max. length 6. It is optional.
*/
@property (strong, nonatomic) NSString *fareBasis;
/** Stop over code
@brief 0 = allowed, 1 = not allowed
*/
@property (strong, nonatomic) NSString *stopOverCode;
/** Currency
@brief The currency of tax amount.
@details It is mandatory if tax amount is specified.
*/
@property (strong, nonatomic) NSString *currency;
/** Tax amount
@brief The amount of the value added tax levied on the transaction amount in the specified currency.
*/
@property (strong, nonatomic) NSDecimalNumber *taxAmount;
@end
|
#import <Foundation/Foundation.h>
#import "SFATask.h"
@interface SFABaseTask : NSOperation <SFATask>
@end
|
#ifndef ROXLU_CONTROLLERH
#define ROXLU_CONTROLLERH
/*
#include "PBD.h"
#include "BoidTypes.h"
#include "Player.h"
*/
#include <pbd/PBD.h>
#include <application/BoidTypes.h>
#include <application/Player.h>
class Controller {
public:
Controller(Boids2& flockPS, Boids2& fxPS, vector<Player*>& players, int w, int h);
void setup();
void update();
void checkBounds();
vector<Player*>& players;
Boids2& flock_ps;
Boids2& fx_ps;
int w;
int h;
};
#endif
|
/*-----------------------------------------------
GRAYS3.C -- Gray Shades Using Palette Manager
(c) Charles Petzold, 1998
-----------------------------------------------*/
#include <windows.h>
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("Grays3") ;
HWND hwnd ;
MSG msg ;
WNDCLASS wndclass ;
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName = NULL ;
wndclass.lpszClassName = szAppName ;
if (!RegisterClass (&wndclass))
{
MessageBox (NULL, TEXT ("This program requires Windows NT!"),
szAppName, MB_ICONERROR) ;
return 0 ;
}
hwnd = CreateWindow (szAppName, TEXT ("Shades of Gray #3"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL) ;
ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam ;
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HPALETTE hPalette ;
static int cxClient, cyClient ;
HBRUSH hBrush ;
HDC hdc ;
int i ;
LOGPALETTE * plp ;
PAINTSTRUCT ps ;
RECT rect ;
switch (message)
{
case WM_CREATE:
// Set up a LOGPALETTE structure and create a palette
plp = malloc (sizeof (LOGPALETTE) + 64 * sizeof (PALETTEENTRY)) ;
plp->palVersion = 0x0300 ;
plp->palNumEntries = 65 ;
for (i = 0 ; i < 65 ; i++)
{
plp->palPalEntry[i].peRed = (BYTE) min (255, 4 * i) ;
plp->palPalEntry[i].peGreen = (BYTE) min (255, 4 * i) ;
plp->palPalEntry[i].peBlue = (BYTE) min (255, 4 * i) ;
plp->palPalEntry[i].peFlags = 0 ;
}
hPalette = CreatePalette (plp) ;
free (plp) ;
return 0 ;
case WM_SIZE:
cxClient = LOWORD (lParam) ;
cyClient = HIWORD (lParam) ;
return 0 ;
case WM_PAINT:
hdc = BeginPaint (hwnd, &ps) ;
// Select and realize the palette in the device context
SelectPalette (hdc, hPalette, FALSE) ;
RealizePalette (hdc) ;
// Draw the fountain of grays
for (i = 0 ; i < 65 ; i++)
{
rect.left = i * cxClient / 64 ;
rect.top = 0 ;
rect.right = (i + 1) * cxClient / 64 ;
rect.bottom = cyClient ;
hBrush = CreateSolidBrush (PALETTEINDEX (i)) ;
FillRect (hdc, &rect, hBrush) ;
DeleteObject (hBrush) ;
}
EndPaint (hwnd, &ps) ;
return 0 ;
case WM_QUERYNEWPALETTE:
if (!hPalette)
return FALSE ;
hdc = GetDC (hwnd) ;
SelectPalette (hdc, hPalette, FALSE) ;
RealizePalette (hdc) ;
InvalidateRect (hwnd, NULL, TRUE) ;
ReleaseDC (hwnd, hdc) ;
return TRUE ;
case WM_PALETTECHANGED:
if (!hPalette || (HWND) wParam == hwnd)
break ;
hdc = GetDC (hwnd) ;
SelectPalette (hdc, hPalette, FALSE) ;
RealizePalette (hdc) ;
UpdateColors (hdc) ;
ReleaseDC (hwnd, hdc) ;
break ;
case WM_DESTROY:
DeleteObject (hPalette) ;
PostQuitMessage (0) ;
return 0 ;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
|
//
// Conspectus.h
// ConspectusTest
//
// Created by Jeffrey Davis on 6/28/14.
// Copyright (c) 2014 Jeff Davis. All rights reserved.
//
#pragma once
#import "CGGeometryExtensions.h"
#import "UIView+Debug.h"
#import "UIView+Hierarchy.h"
|
/// PlnStatement model class declaration.
///
/// @file PlnStatement.h
/// @copyright 2017-2019 YAMAGUCHI Toshinobu
#pragma once
#include "../PlnModel.h"
// Statement: Expression | Block
enum PlnStmtType {
ST_EXPRSN,
ST_VARINIT,
ST_BLOCK,
ST_RETURN,
ST_WHILE,
ST_BREAK,
ST_CONTINUE,
ST_IF
};
class PlnStatement {
public:
PlnStmtType type;
PlnBlock* parent;
union {
PlnExpression* expression;
PlnVarInit* var_init;
PlnBlock *block;
} inf;
PlnLoc loc;
PlnStatement() {};
PlnStatement(PlnExpression *exp, PlnBlock* parent);
PlnStatement(PlnVarInit* var_init, PlnBlock* parent);
PlnStatement(PlnBlock* block, PlnBlock* parent);
virtual ~PlnStatement();
virtual void finish(PlnDataAllocator& da, PlnScopeInfo& si);
virtual void gen(PlnGenerator& g);
};
class PlnClone;
class PlnReturnStmt : public PlnStatement
{
public:
PlnFunction *function;
vector<PlnExpression*> expressions;
vector<PlnClone*> clones;
vector<PlnDataPlace*> dps;
vector<PlnExpression*> free_vars;
PlnReturnStmt(vector<PlnExpression*> &retexp, PlnBlock* parent); // throw PlnCompileError
~PlnReturnStmt();
void finish(PlnDataAllocator& da, PlnScopeInfo& si) override;
void gen(PlnGenerator& g) override;
};
|
/* __ __ __ __
____/ /___ ____ ____ ____ ____/ /___ ____ _______ __ ______/ /_ ______/ /_____
/ __, / __ \/ __ \/ __ \/ ,_ \/ __, / __ \/ ,_ \/ ___/ / / / / ___\, / / / / __, /_/ __ \
/ /_/ / /_/ / /_/ / /_/ / / / / /_/ / /_/ / / / / /__/ /_/ / _\__, / / /_/ / /_/ / / /_/ /
\____/ ,___/ ,___/ ,___/\/ /_/\____/ ,___/\/ /_/\___/\__, / \____/\/\___,_\____/\/\____/
\____/\/ \____/ \____/ \/
__ ____ ______ ____ ____ ____ ____________ __ __
/ /_/ / / / / __ \ / __ \/ ,__\ /__, \/ __ \, /__, \ __/ / /_/
/ ,_, / / / / /_/ / / /_/ / / __ ____/ / / / / /___/ / /_/ /_ / /
/ / / / /_/ / ,___/ / ,_, / /_/ / / ,___/ /_/ / / ,___/ / / ,_ \/ /
\/ \/\____/\/ \/ \/\____/ \____/\____/_/\____/ /\ ___/ / /_/ /_/
'/ \___/\____/ */
#ifndef _DEPENDENCYCONTROL_DUMPBINCALL_H_
#define _DEPENDENCYCONTROL_DUMPBINCALL_H_
#include <StdAfx.h>
#include "dependscall.h"
namespace DependencyLogic
{
/**
* @about Specializes the functionality of DependsCall to work for Dumpbin.
* Dumpbin works almost hundred-fold faster, producing the desired output with
* much less overhead.
* @see DependsCall
*/
class DumpbinCall : public DependsCall
{
public:
/**
* @about Functor constructor. Will call initCmdLine, run, and parseResult in that order.
* An assertion will be issued, when sModulePath does not exist.
* @param sModulePath The path to the module to be processed.
* @see getExports(), getImportedModuleFunctions()
*/
DumpbinCall(std::string sModulePath);
protected:
/**
* @about Initializes the m_sCmdLine member to call Dumpbin instead of Depends.
* @param sModulePath The path to the module to be analyzed.
* @return void
* @see run()
*/
virtual void initCmdLine( std::string sModulePath );
/**
* @about Parses the output of Dumpbin.
* @return void
* @see parseLine()
*/
virtual void parseResult();
enum FileType {TypeExe, TypeDll} m_nType;
};
}
#endif
|
/**
* This header is generated by class-dump-z 0.2a.
* class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3.
*
* Source: (null)
*/
@protocol MTLJSONSerializing
+ (id)JSONKeyPathsByPropertyKey;
@optional
+ (id)JSONTransformerForKey:(id)key;
+ (Class)classForParsingJSONDictionary:(id)parsingJSONDictionary;
@end
|
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 verev
*
* 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.
*/
#define VESKRL_TITLE "VeskRL - a Roguelike about vesking!"
|
/**
* @file HGIAnimation.h
* @brief Animation interface
*
* @author Master.G (MG), mg@snsteam.com
*
* @internal
* Created: 2013/01/11
* Company: SNSTEAM.inc
* (C) Copyright 2013 SNSTEAM.inc All rights reserved.
*
* This file is a part of Hourglass Engine Project.
*
* The copyright to the contents herein is the property of SNSTEAM.inc
* The contents may be used and/or copied only with the written permission of
* SNSTEAM.inc or in accordance with the terms and conditions stipulated in
* the agreement/contract under which the contents have been supplied.
* =====================================================================================
*/
#ifndef HGIANIMATION_H_
#define HGIANIMATION_H_
#include "HGAnimationDef.h"
HGNAMESPACE_START
class SceneNode;
class ISceneEntity;
class IAnimation
{
public:
IAnimation();
virtual ~IAnimation();
virtual void update(SceneNode* node, float dt) = 0;
bool isFinished;
bool isAnimating;
ANIMATION_STAGE animationStage;
uint32_t name;
AnimationTypeID typeID;
ANIMATION_TYPE type;
};
HGNAMESPACE_END
#endif // HGIANIMATION_H_
|
#ifndef ADXL345_h
#define ADXL345_h
#include "SPI.h"
#define CS 10
//ADXL345 Register Addresses
#define DEVID 0x00 //Device ID Register
#define THRESH_TAP 0x1D //Tap Threshold
#define OFSX 0x1E //X-axis offset
#define OFSY 0x1F //Y-axis offset
#define OFSZ 0x20 //Z-axis offset
#define DURATION 0x21 //Tap Duration
#define LATENT 0x22 //Tap latency
#define WINDOW 0x23 //Tap window
#define THRESH_ACT 0x24 //Activity Threshold
#define THRESH_INACT 0x25 //Inactivity Threshold
#define TIME_INACT 0x26 //Inactivity Time
#define ACT_INACT_CTL 0x27 //Axis enable control for activity and inactivity detection
#define THRESH_FF 0x28 //free-fall threshold
#define TIME_FF 0x29 //Free-Fall Time
#define TAP_AXES 0x2A //Axis control for tap/double tap
#define ACT_TAP_STATUS 0x2B //Source of tap/double tap
#define BW_RATE 0x2C //Data rate and power mode control
#define POWER_CTL 0x2D //Power Control Register
#define INT_ENABLE 0x2E //Interrupt Enable Control
#define INT_SOURCE 0x30 //Source of interrupts
#define DATA_FORMAT 0x31 //Data format control
#define DATAX0 0x32 //X-Axis Data 0
#define DATAX1 0x33 //X-Axis Data 1
#define DATAY0 0x34 //Y-Axis Data 0
#define DATAY1 0x35 //Y-Axis Data 1
#define DATAZ0 0x36 //Z-Axis Data 0
#define DATAZ1 0x37 //Z-Axis Data 1
#define FIFO_CTL 0x38 //FIFO control
#define FIFO_STATUS 0x39 //FIFO status
/****************************** ERRORS ******************************/
#define ADXL345_OK 1 // No Error
#define ADXL345_ERROR 0 // Error Exists
#define ADXL345_NO_ERROR 0 // Initial State
#define ADXL345_READ_ERROR 1 // Accelerometer Reading Error
#define ADXL345_BAD_ARG 2 // Bad Argument
class ADXL345 {
public:
ADXL345();
void begin();
void read(uint8_t* xyz);
void read(uint16_t* x, uint16_t* y, uint16_t* z);
void printAllRegister();
~ADXL345();
private:
uint8_t _buff[6]; // 6 Bytes Buffer
void readRegister(uint8_t registerAddress, uint8_t numBytes,
uint8_t * values);
void writeRegister(uint8_t registerAddress, uint8_t value);
};
#endif
|
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
#ifndef TDAV_APPLE_H
#define TDAV_APPLE_H
#if TDAV_UNDER_APPLE
#include <AudioToolbox/AudioToolbox.h>
#include "tsk_debug.h"
static int tdav_apple_init()
{
// initialize audio session
#if TARGET_OS_IPHONE
OSStatus status;
status = AudioSessionInitialize(NULL, NULL, NULL, NULL);
if(status){
TSK_DEBUG_ERROR("AudioSessionInitialize() failed with status code=%d", (int32_t)status);
return -1;
}
// enable record/playback
UInt32 audioCategory = kAudioSessionCategory_PlayAndRecord;
status = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(audioCategory), &audioCategory);
if(status){
TSK_DEBUG_ERROR("AudioSessionSetProperty(kAudioSessionProperty_AudioCategory) failed with status code=%d", (int32_t)status);
return -2;
}
// allow mixing
UInt32 allowMixing = true;
status = AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof(allowMixing), &allowMixing);
if(status){
TSK_DEBUG_ERROR("AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryMixWithOthers) failed with status code=%d", (int32_t)status);
return -3;
}
// enable audio session
status = AudioSessionSetActive(true);
if(status){
TSK_DEBUG_ERROR("AudioSessionSetActive(true) failed with status code=%d", (int32_t)status);
return -4;
}
#endif
return 0;
}
static int tdav_apple_deinit()
{
// maybe other code use the session
// OSStatus status = AudioSessionSetActive(false);
return 0;
}
#endif /* TDAV_UNDER_APPLE */
#endif /* TDAV_APPLE_H */
|
/*******************************************************************************
USB stack external dependencies file
Company:
Microchip Technology Inc.
File Name:
drv_usb_external_dependencies.h
Summary:
USB Driver external dependencies file
Description:
USB Driver external dependencies file.
*******************************************************************************/
//DOM-IGNORE-BEGIN
/*******************************************************************************
* Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* responsibility to comply with third party license terms applicable to your
* use of third party software (including open source software) that may
* accompany Microchip software.
*
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
* INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
* WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
* BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
* FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
* ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
*******************************************************************************/
//DOM-IGNORE-END
#ifndef _DRV_USB_EXTERNAL_DEPENDENCIES_H
#define _DRV_USB_EXTERNAL_DEPENDENCIES_H
#include <string.h>
#include "system/system_common.h"
#include "configuration.h"
#include "definitions.h"
#include "system/system_module.h"
#if defined DRV_USBHS_INSTANCES_NUMBER
#include "system/time/sys_time.h"
#define SYS_TMR_HANDLE SYS_TIME_HANDLE
#define SYS_TMR_HANDLE_INVALID SYS_TIME_HANDLE_INVALID
#define SYS_TMR_CallbackSingle(delay,context,callback) SYS_TIME_CallbackRegisterMS(callback,context,delay, SYS_TIME_SINGLE)
#define SYS_TMR_ObjectDelete SYS_TIME_TimerDestroy
#endif
#if !defined(SYS_DEBUG_ENABLE)
#if !defined(SYS_DEBUG_PRINT)
#define SYS_DEBUG_PRINT(level, format, ...)
#endif
#if !defined(SYS_DEBUG_MESSAGE)
#define SYS_DEBUG_MESSAGE(a,b, ...)
#endif
#if !defined(SYS_DEBUG)
#define SYS_DEBUG(a,b)
#endif
#endif
#endif /* End of #ifndef _DRV_USB_EXTERNAL_DEPENDENCIES_H */
/*******************************************************************************
End of File
*/
|
/*
* Graph.h
*
* Created on: 29 jul. 2017
* Author: colosu
*/
#ifndef GRAPH_H_
#define GRAPH_H_
#include <fst/fstlib.h>
namespace fst {
class Graph {
public:
Graph();
Graph(StdMutableFst* trans);
~Graph();
StdMutableFst* getTransducer();
void setTransducer(StdMutableFst* trans);
string getRandInput(int length);
private:
StdMutableFst* transducer;
};
} /* namespace std */
#endif /* GRAPH_H_ */
|
//
// MagicDefinition.h
// FlameDragon
//
// Created by sui toney on 11-11-23.
// Copyright 2011 ms. All rights reserved.
//
#import "cocos2d.h"
#import "FDRange.h"
#import "FDFileStream.h"
typedef enum MagicType
{
MagicType_Attack = 1,
MagicType_Recover = 2,
MagicType_Offensive = 3,
MagicType_Defensive = 4
} MagicType;
@interface MagicDefinition : NSObject {
int identifier;
NSString *name;
MagicType magicType;
int effectScope; // usally
int effectRange; //
int hittingRate;
int mpCost;
FDRange *quantityRange;
}
+(id) readFromFile:(FDFileStream *)stream;
-(void) takeOffensiveEffect:(id)obj;
-(void) takeDefensiveEffect:(id)obj;
-(int) baseExperience;
-(BOOL) hasAnimation;
@property (nonatomic, retain) NSString *name;
@property (nonatomic) MagicType magicType;
@property (nonatomic) int identifier;
@property (nonatomic) int effectScope;
@property (nonatomic) int effectRange;
@property (nonatomic) int hittingRate;
@property (nonatomic) int mpCost;
@property (nonatomic, retain) FDRange *quantityRange;
@end
|
/*******************************************************************************
* Copyright 2011 See AUTHORS file.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
/** @author Xoppa */
#ifdef _MSC_VER
#pragma once
#endif //_MSC_VER
#ifndef FBXCONV_FBXCONV_H
#define FBXCONV_FBXCONV_H
#ifndef BUILD_NUMBER
#define BUILD_NUMBER "0000"
#endif
#ifndef BUILD_ID
#ifdef DEBUG
#define BUILD_ID "debug version, cocos2d-x-3.4-beta0 or later version can use"
#else
#define BUILD_ID "release version, cocos2d-x-3.4-beta0 or later version can use"
#endif
#endif
#define BIT_COUNT (sizeof(void*)*8)
#include "log/messages.h"
#include "modeldata/Model.h"
#include "Settings.h"
#include "readers/Reader.h"
#include "FbxConvCommand.h"
#include "json2/JSONWriter.h"
#include "json2/UBJSONWriter.h"
#include "readers/FbxConverter.h"
#include "readers/C3TConverter.h"
#include "modeldata/C3BFile.h"
namespace fbxconv {
void simpleTextureCallback(std::map<std::string, readers::TextureFileInfo> &textures) {
for (std::map<std::string, readers::TextureFileInfo>::iterator it = textures.begin(); it != textures.end(); ++it) {
//printf("Texture name: %s\nbounds: %01.2f, %01.2f, %01.2f, %01.2f\ncount: %d\n", it->first.c_str(), it->second.bounds[0], it->second.bounds[1], it->second.bounds[2], it->second.bounds[3], it->second.nodeCount);
it->second.path = it->first.substr(it->first.find_last_of("/\\")+1);
}
}
class FbxConv {
public:
fbxconv::log::Log *log;
FbxConv(fbxconv::log::Log *log) : log(log) {
log->info(log::iNameAndVersion, modeldata::VERSION_HI, modeldata::VERSION_LO, /*BUILD_NUMBER,*/ BIT_COUNT, BUILD_ID);
}
const char *getVersionString() {
return log->format(log::iVersion, modeldata::VERSION_HI, modeldata::VERSION_LO, BUILD_NUMBER, BIT_COUNT, BUILD_ID);
}
const char *getNameAndVersionString() {
return log->format(log::iNameAndVersion, modeldata::VERSION_HI, modeldata::VERSION_LO, /*BUILD_NUMBER,*/ BIT_COUNT, BUILD_ID);
}
bool execute(int const &argc, const char** const &argv) {
Settings settings;
FbxConvCommand command(log, argc, argv, &settings);
#ifdef DEBUG
log->filter |= log::Log::LOG_DEBUG;
#else
log->filter &= ~log::Log::LOG_DEBUG;
#endif
if (settings.verbose)
log->filter |= log::Log::LOG_VERBOSE;
else
log->filter &= ~log::Log::LOG_VERBOSE;
if (command.error != log::iNoError)
command.printCommand();
else if (!command.help)
return execute(&settings);
command.printHelp();
return false;
}
bool execute(Settings * const &settings) {
bool result = false;
modeldata::Model *model = new modeldata::Model();
if (load(settings, model)) {
if (settings->verbose)
info(model);
if (save(settings, model))
result = true;
}
delete model;
return result;
}
readers::Reader *createReader(const Settings * const &settings) {
return createReader(settings->inType);
}
readers::Reader *createReader(const int &type) {
switch(type) {
case FILETYPE_FBX:
return new readers::FbxConverter(log, simpleTextureCallback);
case FILETYPE_C3T:
return new readers::C3TConverter();
case FILETYPE_G3DB:
case FILETYPE_G3DJ:
default:
log->error(log::eSourceLoadFiletypeUnknown);
return 0;
}
}
bool load(Settings * const &settings, modeldata::Model *model) {
log->status(log::sSourceLoad);
readers::Reader *reader = createReader(settings);
if (!reader)
return false;
bool result = reader->load(settings);
if (!result)
log->error(log::eSourceLoadGeneral, settings->inFile.c_str());
else {
result = reader->convert(settings, model);
log->status(log::sSourceConvert);
}
log->status(log::sSourceClose);
delete reader;
return result;
}
bool save(Settings * const &settings, modeldata::Model *model) {
bool result = false;
json::BaseJSONWriter *jsonWriter = 0;
model->exportPart = settings->exportPart;
if(settings->outType == FILETYPE_ALL || settings->outType == FILETYPE_C3T)
{
std::string out = settings->outFile;
int o = out.find_last_of(".");
out = out.substr(0, o+1) + "c3t";
std::ofstream myfile;
myfile.open (out.c_str(), std::ios::binary);
log->status(log::sExportToG3DJ, out.c_str());
jsonWriter = new json::JSONWriter(myfile);
(*jsonWriter) << model;
delete jsonWriter;
result = true;
myfile.close();
}
if(settings->outType == FILETYPE_ALL || settings->outType == FILETYPE_C3B)
{
std::string out = settings->outFile;
int o = out.find_last_of(".");
out = out.substr(0, o+1) + "c3b";
C3BFile file;
file.AddModel(model);
file.saveBinary(out);
log->status(log::sExportToG3DB, out.c_str());
}
log->status(log::sExportClose);
return result;
}
void info(modeldata::Model *model) {
if (!model)
log->verbose(log::iModelInfoNull);
else {
log->verbose(log::iModelInfoStart);
log->verbose(log::iModelInfoID, model->id.c_str());
log->verbose(log::iModelInfoVersion, model->version[0], model->version[1]);
log->verbose(log::iModelInfoMeshesSummary, model->meshes.size(), model->getTotalVertexCount(), model->getMeshpartCount(), model->getTotalIndexCount());
log->verbose(log::iModelInfoNodesSummary, model->nodes.size(), model->getTotalNodeCount(), model->getTotalNodePartCount());
log->verbose(log::iModelInfoMaterialsSummary, model->materials.size(), model->getTotalTextureCount());
}
}
};
}
#endif //FBXCONV_FBXCONV_H
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#ifndef AMQP_ALLOC_H
#define AMQP_ALLOC_H
#pragma GCC diagnostic ignored "-Wunused-value"
#ifdef __cplusplus
extern "C" {
#include <cstddef>
#include <cstdbool>
#include <cstdlib>
#else
#include <stddef.h>
#include <stdbool.h>
#include <stdlib.h>
#endif /* __cplusplus */
#ifndef DISABLE_MEMORY_TRACE
extern void* amqpalloc_malloc(size_t size);
extern void amqpalloc_free(void* ptr);
extern void* amqpalloc_calloc(size_t nmemb, size_t size);
extern void* amqpalloc_realloc(void* ptr, size_t size);
#else
#define amqpalloc_malloc malloc
#define amqpalloc_free free
#define amqpalloc_calloc calloc
#define amqpalloc_realloc realloc
#endif
extern size_t amqpalloc_get_maximum_memory_used(void);
extern size_t amqpalloc_get_current_memory_used(void);
extern void amqpalloc_set_memory_tracing_enabled(bool memory_tracing_enabled);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* AMQP_ALLOC_H */
|
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@interface MapAnnotation : NSObject <MKAnnotation> {
NSString *title;
CLLocationCoordinate2D coordinate;
}
@property (nonatomic, copy) NSString *title;
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
- (id)initWithTitle:(NSString *)ttl andCoordinate:(CLLocationCoordinate2D)c2d;
@end
|
#include <stdio.h>
int main ()
{
float d; //disabile
float ac; //accompagnatore
float al; //altezza
float s; //supplemento
float p; //prezzo
printf("il cliente e' un disabile? (1=si, 0=no) ");
scanf("%f",&d);
if (d==0){
printf("il cliente e' un accompagnatore? (1=si, 0=no");
scanf("%f",&ac);
if (ac==0){
printf("inserire l'altezza");
scanf("%f",&al);
if(al<=100){
p=0
printf("il cliente vuole un supplemento? (1=si, 0=no");
scanf("%f",&s);
if (s==1)
p=p+7.50;
}
else{
if(al<=140){
p=28;
printf("il cliente vuole un supplemento? (1=si, 0=no")
if (s==1)
p=p+7.50;
}
else{
p=34.90;
printf("il cliente vuole un supplemento? (1=si, 0=no");
scanf("%f",&s);
if (s==1)
p=p+90.50;
}
}
}
else{
p=25.50
printf("il cliente vuole un supplemento? (1=si, 0=no");
scanf("%f",&s);
if (s==1)
p=p+9.50;
}
}
else{
p=0;
printf("il cliente vuole un supplemento? (1=si, 0=no");
scanf("%f",&s);
if (s==1)
p=p+7.50;
}
printf("il prezzo da pagare e' %f",p);
}
|
/* --------------------------------------------------------------------------
*
* File APSGraphicGroup.h
* Author Young-Hwan Mun
*
* --------------------------------------------------------------------------
*
* Copyright (c) 2012 ArtPig Software LLC
*
* http://www.artpigsoft.com
*
* --------------------------------------------------------------------------
*
* Copyright (c) 2010-2013 XMSoft. All rights reserved.
*
* Contact Email: xmsoft77@gmail.com
*
* --------------------------------------------------------------------------
*
* 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 of the License, or ( at your option ) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* -------------------------------------------------------------------------- */
#ifndef __APSGraphicGroup_h__
#define __APSGraphicGroup_h__
#include "APSGraphic.h"
NS_APS_BEGIN
class APSResourceArray;
class APSSpriteSheetHolder;
class APSGraphicGroup : public APSGraphic
{
public :
APSGraphicGroup ( APSDictionary* pProperties = KD_NULL );
virtual ~APSGraphicGroup ( KDvoid );
APS_CLASS_NAME ( APSGraphicGroup );
public :
virtual KDbool initWithProperties ( APSDictionary* pProperties );
virtual KDbool initNode ( KDvoid );
/** Runs an action targeting to this graphic */
KDvoid runAction ( APSAction* pAction );
/** Stops an action targeting to this graphic */
KDvoid stopAction ( APSAction* pAction );
/**
* Updates accOpacity, accOpacity value propagates to the all descendant
* graphics. Opacities are multiplied from parent to children thoughout
* graphics hierarchy. For performance reason, updateAccOpacity ( ) should
* be called as minimum times as you can.
*/
virtual KDvoid updateAccOpacity ( KDvoid );
virtual KDvoid updateChildSpriteFrames ( KDvoid );
APSResourceArray* getChildren ( KDvoid ) const { return m_pChildren; }
/** Searches and returns a sprite sheet holder of first found among children has */
APSSpriteSheetHolder* getFirstSpriteSheetHolder ( KDvoid );
/**
* Returns a currently running action with a given action type. Except
* audio action, there can be only one running action for each action type in a graphic.
*/
APSAction* getRunningActionForType ( APSActionType uType ) const;
KDvoid setRunningAction ( APSAction* pAction, APSActionType uType = kAPSActionTypeNone );
KDvoid setEnableActionForType ( KDbool bEnable, APSActionType uType );
KDbool isActionEnabledForType ( APSActionType uType ) const;
KDvoid setEnableAllActions ( KDbool bEnable );
protected :
virtual CCNode* createNode ( KDvoid );
APS_PROPERTY_KEY ( ChildIndexes );
APS_SYNTHESIZE_WITH_KEY ( KDbool, m_bHasAnimatableChild, HasAnimatableChild );
APS_SYNTHESIZE_WITH_KEY ( KDuint, m_uDisplayedFrameIndex, DisplayedFrameIndex );
APS_SYNTHESIZE ( KDuint, m_uRunningFrameIndex, RunningFrameIndex );
private:
static inline KDint getIndexForActionType ( APSActionType uType );
static APSAction* getRigidAction ( KDvoid );
protected :
APSResourceArray* m_pChildren;
APSAction* m_aRunningActions[APS_GRAPHIC_ACTION_TYPES_COUNT];
};
NS_APS_END
#endif // __APSGraphicGroup_h__
|
/**
* @file ic_array.h
* @author impworks.
* ic_array header.
* Defines properties and methods of ic_array class.
*/
#ifndef IC_ARRAY_H
#define IC_ARRAY_H
/**
* ic_array constructor.
*/
ic_array::ic_array()
{
mItems = new sc_voidmap();
mCurrIdx = 0;
mCurr = NULL;
mFinished = false;
mAutoIndex.mValue = 0;
}
/**
* ic_array destructor.
*/
ic_array::~ic_array()
{
delete mItems;
}
/**
* Appends an object to the end of the array, generating a new index.
* @param obj Object to be appended.
*/
void ic_array::append(rc_var *obj, bool check)
{
ic_string str = mAutoIndex.to_s();
if(check)
{
while(get(&str) != NULL)
{
mAutoIndex.mValue++;
str = mAutoIndex.to_s();
}
}
set(&str, obj);
mAutoIndex.mValue++;
}
/**
* Sets a specific item of the array to a new object.
* @param key Key of the array to be modified.
* @param obj Object to be set.
*/
inline void ic_array::set(ic_string *key, rc_var *obj)
{
mItems->set(key, (void *)obj);
}
/**
* Sets a specific item of the array to a new object.
* @param key Key of the array to be modified.
* @param obj Object to be set.
*/
inline void ic_array::set(const char *key, rc_var *obj)
{
mItems->set(key, (void *)obj);
}
/**
* Clears a key out.
* @param key Key to be cleared.
*/
inline void ic_array::unset(ic_string *key)
{
mItems->remove(key);
}
/**
* Clears a key out.
* @param key Key to be cleared.
*/
inline void ic_array::unset(const char *key)
{
mItems->remove(key);
}
/**
* Clears the whole array.
*/
void ic_array::clear()
{
mItems->clear();
mCurrIdx = 0;
mCurr = NULL;
mFinished = false;
mAutoIndex.mValue = 0;
}
/**
* Returns an object by it's key.
* @param key Key of the object.
* @return Object.
*/
inline rc_var *ic_array::get(ic_string *key)
{
// note that ic_array is not aware of the existance of rc_head and rc_core,
// thus being unable to automatically create an undef object if the requested
// key is not found. it should be done in the wrapper layer instead.
return (rc_var *)mItems->get(key);
}
/**
* Returns an object by it's key.
* @param key Key of the object.
* @return Object.
*/
inline rc_var *ic_array::get(const char *key)
{
ic_string str = key;
return (rc_var *)mItems->get(&str);
}
/**
* Loads the array from another array.
* @param arr Array to be copied.
*/
void ic_array::copy(ic_array *arr)
{
sc_voidmapitem *curr;
arr->iter_rewind();
while(curr = arr->iter_next())
mItems->set(curr->mKey, curr->mValue);
}
/**
* Get next object from array for iteration.
* @return Current object.
*/
inline sc_voidmapitem *ic_array::iter_next()
{
return mItems->iter_next();
}
/**
* Get last object from array for iteration.
* @return Current object.
*/
inline sc_voidmapitem *ic_array::iter_last()
{
return mItems->mLast;
}
/**
* Rewind iterator.
*/
inline void ic_array::iter_rewind()
{
mItems->iter_rewind();
}
/**
* Returns number of items in the array.
* @return Number of items in the array.
*/
inline long ic_array::length()
{
return mItems->length();
}
/**
* ic_array -> boolean convertor.
* @return bool
*/
inline bool ic_array::to_b()
{
return mItems->length() ? true : false;
}
/**
* ic_array -> int convertor.
* @return long
*/
inline long ic_array::to_i()
{
return length();
}
/**
* ic_array -> string convertor.
* @return char*
*/
inline const char *ic_array::to_s()
{
return "Array";
}
#endif
|
//
// SynthesizeSingleton.h
// CocoaWithLove
//
// Created by Matt Gallagher on 20/10/08.
// Copyright 2009 Matt Gallagher. All rights reserved.
//
// Permission is given to use this source code file without charge in any
// project, commercial or otherwise, entirely at your risk, with the condition
// that any redistribution (in part or whole) of source code must retain
// this copyright and permission notice. Attribution in compiled projects is
// appreciated but not required.
//
#define SYNTHESIZE_SINGLETON_FOR_HEADER(classname) \
+ (classname *)sharedInstance;
#define SYNTHESIZE_SINGLETON_FOR_CLASS(classname) \
\
static classname *sharedInstance = nil; \
static dispatch_once_t onceToken; \
\
+ (classname *)sharedInstance \
{ \
@synchronized(self) \
{ \
dispatch_once(&onceToken, ^{ \
sharedInstance = [[classname alloc] init]; \
}); \
} \
\
return sharedInstance; \
} \
\
|
#ifndef ICONPROVIDER_H
#define ICONPROVIDER_H
#include <QQuickImageProvider>
#define ICONPROVIDER_UNKNOWN_ICON "://icons/unknown.svg"
#define ICONPROVIDER_PIXMAPS_PATH "/usr/share/pixmaps/"
#define ICONPROVIDER_LOCAL_ICONS_PATH "/.local/share/icons"
#define ICONPROVIDER_DEFAULT_SIZE 80,80
#define ICONPROVIDER_EXTENSION_SEARCH "\\.(?:png|xpm|svg)$"
#define ICONPROVIDER_LOOKUP_THEMES "Adwaita" << "gnome" << "HighContrast"
#define ICONPROVIDER_LOOKUP_EXTS ".png" << ".xpm" << ".svg"
/**
* @brief The IconProvider class
*
* Provides icons from .desktop files Icon= entry
*/
class IconProvider : public QQuickImageProvider
{
QString m_originalThemeName;
QPixmap searchThemeIcon(QString search);
QString searchPixmapPath(QString search);
QPixmap checkIconPath(const QString &path);
public:
explicit IconProvider();
QPixmap requestPixmap(const QString &id, QSize *size , const QSize &requestedSize);
};
#endif // ICONPROVIDER_H
|
//
// RCIsPresentTests.h
// RubyCocoaString
//
// Created by Parker Wightman on 12/24/12.
// Copyright (c) 2012 Parker Wightman Inc. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface RCIsPresentTests : SenTestCase
@end
|
//
// AppDelegate.h
// Demo
//
// Created by kfzx-linz on 16/6/15.
// Copyright © 2016年 ICBC. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
#include <iostream>
#include <ostream>
#include <stdexcept>
using namespace std;
template<typename T>
class Chain; //µ¥Á´±íChain ÀàµÄÉùÃ÷
template<typename T>
class Node //µ¥Á´±í ½áµãNode ÀàµÄ¶¨Òå
{
friend class Chain<T>; //¶¨Òå ÀàChain Ϊ ÀàNode µÄÓÑÔªÀà
private:
T data; //½áµãµÄÊý¾Ý
Node<T> *next; //½áµãµÄÖ¸Õë
};
template<typename T>
class Chain //µ¥Á´±íChain ÀàµÄ¶¨Òå
{
public:
Chain(); //¹¹Ô캯Êý
~Chain(); //Îö¹¹º¯Êý
bool IsEmpty(int i); //Åжϵ¥Á´±íÊÇ·ñΪ¿Õ
int Length(); //·µ»Ø±í³¤
bool Find(int i, T &x); //°ÑϱêΪiµÄÔªËØÈ¡ÖÁx
int Search(const T &x); //·µ»ØxÔÚ±íÖеÄϱê
void Insert(int i, const T &x); //½«ÔªËØx²åÈë±íÖеÚi¸öλÖÃ
void Delete(int i, T &x); //µÚi¸öÔªËØËÍÖÁx£¬É¾³ýÆä¶ÔÓ¦µÄ½áµã
void ClearList(); //½«±íÇå¿Õ
void OutPut(ostream &out)const; //Êä³ö±íÖÐËùÓÐÔªËØµÄÖµ
friend ostream& operator<<(ostream &out, const Chain<T> &x) //ÖØÔØ"<<"
{
x.OutPut(out);
return out;
}
private:
Node<T> *head; //Í·Ö¸Õë
int length; //±í³¤
};
template<typename T>
Chain<T>::Chain()
{
head=new Node<T>;
head->next=0;
length=0;
}
template<typename T>
Chain<T>::~Chain()
{
ClearList();
delete head;
}
template<typename T>
bool Chain<T>::IsEmpty(int i)
{
return i == 0;
}
template<typename T>
int Chain<T>::Length()
{
return length;
}
template<typename T>
bool Chain<T>::Find(int i, T &x)
{
if( (i < 0) || (i > (length-1)) )
{
return false;
}
Node<T> *p=head->next;
int k=0;
while(k < i)
{
p=p->next;
k++;
}
x=p->data;
return true;
}
template<typename T>
int Chain<T>::Search(const T &x)
{
Node<T> *p=head->next;
int i=0;
while(p != 0)
{
if (p->data == x)
{
return i;
}
p=p->next;
i++;
}
return -1;
}
template<typename T>
void Chain<T>::Insert(int i, const T &x)
{
if ( (i < 0) || (i > length) )
{
throw out_of_range("ϱêÔ½½ç\n");
}
Node<T> *p=head;
int k=0;
while(k <= i-1)
{
p=p->next;
k++;
}
Node<T> *q;
q=new Node<T>;
q->data=x;
q->next=p->next;
p->next=q;
length++;
}
template<typename T>
void Chain<T>::Delete(int i, T &x)
{
if ( (i < 0) || (i > length-1) )
{
throw out_of_range("ϱêÔ½½ç\n");
}
Node<T> *p=head;
for (int k=0; k<i; k++)
{
p=p->next;
}
Node<T> *q=p->next;
x=q->data;
p->next=q->next;
delete q;
length--;
}
template<typename T>
void Chain<T>::ClearList()
{
Node<T> *p=head->next, *q;
while(p != 0)
{
q=p;
p=p->next;
delete q;
}
head->next=0;
length=0;
}
template<typename T>
void Chain<T>::OutPut(ostream &out)const
{
Node<T> *p=head->next;
while(p != 0)
{
out<<p->data<<" ";
p=p->next;
}
}
/*template<typename T>
ostream& operator<<(ostream &out, const Chain<T> &x)
{
x.OutPut(out);
return out;
}*/
|
#ifndef SETUP_MV_H_
#define SETUP_MV_H_
#include <config.h>
extern void do_mv_experiment(MVConfig mv_xconfig, workload_config w_config);
#endif // SETUP_MV_H_
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UIViewController.h"
#import "SKUISlideshowItemViewControllerDelegate-Protocol.h"
#import "UIPageViewControllerDataSource-Protocol.h"
#import "UIPageViewControllerDelegate-Protocol.h"
#import "UIViewControllerTransitioningDelegate-Protocol.h"
@class NSMutableDictionary, NSOperationQueue, SKUIClientContext, UIPageViewController, UIPercentDrivenInteractiveTransition;
@interface SKUISlideshowViewController : UIViewController <UIPageViewControllerDataSource, UIPageViewControllerDelegate, SKUISlideshowItemViewControllerDelegate, UIViewControllerTransitioningDelegate>
{
SKUIClientContext *_clientContext;
UIPageViewController *_pageViewController;
NSOperationQueue *_remoteLoadQueue;
NSMutableDictionary *_itemViewControllersCache;
UIPercentDrivenInteractiveTransition *_transition;
_Bool _overlayVisible;
_Bool _shouldCancelDelayedOverlayVisibilityChange;
_Bool _overlayVisibilityWillChangeWithDelay;
_Bool _lockOverlayControlsVisible;
struct {
long long style;
_Bool hidden;
} _savedStatusBarState;
id <SKUISlideshowViewControllerDataSource> _dataSource;
id <SKUISlideshowViewControllerDelegate> _delegate;
long long _currentIndex;
}
@property(nonatomic) long long currentIndex; // @synthesize currentIndex=_currentIndex;
@property(nonatomic) __weak id <SKUISlideshowViewControllerDelegate> delegate; // @synthesize delegate=_delegate;
@property(nonatomic) __weak id <SKUISlideshowViewControllerDataSource> dataSource; // @synthesize dataSource=_dataSource;
@property(retain, nonatomic) SKUIClientContext *clientContext; // @synthesize clientContext=_clientContext;
- (void).cxx_destruct;
- (void)_restoreStatusBarAppearanceState;
- (void)_saveStatusBarAppearanceState;
- (void)_setOverlayVisible:(_Bool)arg1 animated:(_Bool)arg2;
- (void)_fadeOutOverlayAfterDelay:(unsigned long long)arg1;
- (void)_toggleFadeOverlay;
- (void)_doneButtonTapped:(id)arg1;
- (void)_contentViewTapped:(id)arg1;
- (void)_updateTitleWithIndex:(long long)arg1;
- (void)_updateCurrentIndex;
- (id)_itemViewControllerForIndex:(long long)arg1;
- (void)slideshowItemViewControllerDidDismissWithPinchGesture:(id)arg1 ratio:(double)arg2;
- (void)slideshowItemViewControllerDidBeginPinchGesture:(id)arg1;
- (void)pageViewController:(id)arg1 willTransitionToViewControllers:(id)arg2;
- (void)pageViewController:(id)arg1 didFinishAnimating:(_Bool)arg2 previousViewControllers:(id)arg3 transitionCompleted:(_Bool)arg4;
- (id)pageViewController:(id)arg1 viewControllerBeforeViewController:(id)arg2;
- (id)pageViewController:(id)arg1 viewControllerAfterViewController:(id)arg2;
- (void)willAnimateRotationToInterfaceOrientation:(long long)arg1 duration:(double)arg2;
- (void)willRotateToInterfaceOrientation:(long long)arg1 duration:(double)arg2;
- (unsigned long long)supportedInterfaceOrientations;
- (void)viewDidAppear:(_Bool)arg1;
- (void)viewWillDisappear:(_Bool)arg1;
- (void)viewWillAppear:(_Bool)arg1;
- (void)viewDidLoad;
- (void)loadView;
- (id)currentItemViewController;
- (void)reloadData;
- (id)interactionControllerForDismissal:(id)arg1;
- (id)animatorForDismissedController:(id)arg1;
- (id)animatorForPresentedController:(id)arg1 presentingController:(id)arg2 sourceController:(id)arg3;
- (id)initWithNibName:(id)arg1 bundle:(id)arg2;
@end
|
// Copyright (c) 2014-present 650 Industries, Inc. All rights reserved.
#import "CNNativeBindingProtocol.h"
@interface OSBinding : NSObject <CNNativeBindingProtocol>
- (NSString *)endianness;
- (NSString *)hostname;
- (NSArray *)loadAverage;
- (NSNumber *)uptime;
- (NSNumber *)freeMemory;
- (NSNumber *)totalMemory;
- (NSArray *)CPUs;
- (NSString *)OSType;
- (NSString *)OSRelease;
- (NSDictionary *)interfaceAddresses;
@end
|
//
// TripCollectionViewController.h
// GoJournal
//
// Created by Elber Carneiro on 10/11/15.
// Copyright © 2015 Elber Carneiro. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "LiquidFloatingActionButton-Swift.h"
#import "GJOutings.h"
@interface TripCollectionViewController : UIViewController <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, LiquidFloatingActionButtonDataSource, LiquidFloatingActionButtonDelegate>
@property (nonatomic) GJOutings *currentOuting;
@end
|
#ifndef _SWAY_INPUT_INPUT_MANAGER_H
#define _SWAY_INPUT_INPUT_MANAGER_H
#include <libinput.h>
#include <wlr/types/wlr_input_inhibitor.h>
#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
#include <wlr/types/wlr_virtual_keyboard_v1.h>
#include <wlr/types/wlr_virtual_pointer_v1.h>
#include "sway/server.h"
#include "sway/config.h"
#include "list.h"
struct sway_input_device {
char *identifier;
struct wlr_input_device *wlr_device;
struct wl_list link;
struct wl_listener device_destroy;
bool is_virtual;
};
struct sway_input_manager {
struct wl_list devices;
struct wl_list seats;
struct wlr_input_inhibit_manager *inhibit;
struct wlr_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit;
struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard;
struct wlr_virtual_pointer_manager_v1 *virtual_pointer;
struct wl_listener new_input;
struct wl_listener inhibit_activate;
struct wl_listener inhibit_deactivate;
struct wl_listener keyboard_shortcuts_inhibit_new_inhibitor;
struct wl_listener virtual_keyboard_new;
struct wl_listener virtual_pointer_new;
};
struct sway_input_manager *input_manager_create(struct sway_server *server);
bool input_manager_has_focus(struct sway_node *node);
void input_manager_set_focus(struct sway_node *node);
void input_manager_configure_xcursor(void);
void input_manager_apply_input_config(struct input_config *input_config);
void input_manager_configure_all_inputs(void);
void input_manager_reset_input(struct sway_input_device *input_device);
void input_manager_reset_all_inputs(void);
void input_manager_apply_seat_config(struct seat_config *seat_config);
struct sway_seat *input_manager_get_default_seat(void);
struct sway_seat *input_manager_get_seat(const char *seat_name, bool create);
/**
* If none of the seat configs have a fallback setting (either true or false),
* create the default seat (if needed) and set it as the fallback
*/
void input_manager_verify_fallback_seat(void);
/**
* Gets the last seat the user interacted with
*/
struct sway_seat *input_manager_current_seat(void);
struct input_config *input_device_get_config(struct sway_input_device *device);
char *input_device_get_identifier(struct wlr_input_device *device);
const char *input_device_get_type(struct sway_input_device *device);
#endif
|
//
// SecondViewController.h
// 2-1-17
//
// Created by yuu ogasawara on 2017/03/30.
// Copyright © 2017年 stv. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SecondViewController : UIViewController
@end
|
/**
* @file binson_fuzz.c.c
*
* Description
*
*/
/*======= Includes ==========================================================*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <stdint.h>
#include <assert.h>
#include "binson_parser.h"
/*======= Local Macro Definitions ===========================================*/
/*======= Type Definitions ==================================================*/
/*======= Local function prototypes =========================================*/
/*======= Local variable declarations =======================================*/
/*======= Global function implementations ===================================*/
bool fuzz_one_input(const uint8_t *data, size_t size)
{
BINSON_PARSER_DEF(parser);
bool ret = binson_parser_init_array(&parser, data, size);
if (ret) {
ret = binson_parser_verify(&parser);
if (ret) {
assert(binson_parser_go_into_array(&parser));
assert(binson_parser_leave_array(&parser));
for (size_t i = 0; i < size; i++) {
printf("%02x", data[i]);
}
printf("\r\n");
}
}
return ret;
}
/*======= Local function implementations ====================================*/
|
/* #include "app_waveForm.h" */
#ifndef __APP_WAVEFORM_H
#define __APP_WAVEFORM_H
#include "stm32f30x.h"
/*=====================================================================================================*/
/*=====================================================================================================*/
#define WaveChannelMax 2
#define WaveWindowX 0
#define WaveWindowY 6
#define WaveFormW 96
#define WaveFormH 24
#define WaveForm2H 48
/*=====================================================================================================*/
/*=====================================================================================================*/
typedef struct {
uint8_t Channel;
int16_t Data[WaveChannelMax];
uint16_t Scale[WaveChannelMax];
uint32_t PointColor[WaveChannelMax];
uint32_t WindowColor;
uint32_t BackColor;
} WaveForm_Struct;
/*=====================================================================================================*/
/*=====================================================================================================*/
void WaveFormInit( WaveForm_Struct *pWaveForm );
void WaveFormPrint( WaveForm_Struct *pWaveForm, uint8_t display );
/*=====================================================================================================*/
/*=====================================================================================================*/
#endif
|
#include <stdlib.h>
#include "game/game_state.h"
#include "game/scenes/credits.h"
#include "utils/allocator.h"
#include "video/video.h"
typedef struct credits_local_t {
int ticks;
} credits_local;
void credits_input_tick(scene *scene) {
game_player *player1 = game_state_get_player(scene->gs, 0);
ctrl_event *p1 = NULL, *i;
controller_poll(player1->ctrl, &p1);
i = p1;
if(i) {
do {
if(i->type == EVENT_TYPE_ACTION) {
if(i->event_data.action == ACT_ESC || i->event_data.action == ACT_KICK ||
i->event_data.action == ACT_PUNCH) {
game_state_set_next(scene->gs, SCENE_NONE);
}
}
} while((i = i->next));
}
controller_free_chain(p1);
}
void credits_tick(scene *scene, int paused) {
credits_local *local = scene_get_userdata(scene);
local->ticks++;
if(local->ticks > 4500) {
game_state_set_next(scene->gs, SCENE_NONE);
}
}
void credits_free(scene *scene) {
credits_local *local = scene_get_userdata(scene);
omf_free(local);
scene_set_userdata(scene, local);
}
void credits_startup(scene *scene, int id, int *m_load, int *m_repeat) {
switch(id) {
case 20:
*m_load = 1;
return;
}
}
int credits_create(scene *scene) {
credits_local *local = omf_calloc(1, sizeof(credits_local));
local->ticks = 0;
// Callbacks
scene_set_userdata(scene, local);
scene_set_dynamic_tick_cb(scene, credits_tick);
scene_set_free_cb(scene, credits_free);
scene_set_startup_cb(scene, credits_startup);
scene_set_input_poll_cb(scene, credits_input_tick);
// Don't render background on its own layer
// Fix for some additive blending tricks.
video_render_bg_separately(false);
return 0;
}
|
//
// AddVenueViewController.h
// ShnergleApp
//
// Created by Stian Johansen on 10/06/2013.
// Copyright (c) 2013 Shnergle. All rights reserved.
//
#import "CustomBackViewController.h"
#import <MapKit/MapKit.h>
@interface AddVenueViewController : CustomBackViewController<UITableViewDataSource, UITableViewDelegate, UITextFieldDelegate, MKMapViewDelegate, UIAlertViewDelegate, CLLocationManagerDelegate>
{
UITableViewCell *secondCell;
UILabel *secondCellField;
CLLocationCoordinate2D venueCoord;
MKMapView *map;
NSArray *tableData;
UISwitch *workSwitch;
CLLocationManager *man;
}
@property (weak, nonatomic) IBOutlet UIView *mapView;
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (strong, nonatomic) NSMutableDictionary *userData;
@end
|
/*
* Copyright (c) 2009-2011 Ricardo Quesada
* Copyright (c) 2011-2012 Zynga Inc.
*
* 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 "BadGuy.h"
@interface Poison : BadGuy {
}
@end
|
//
// Copyright (c) 2013-2015, John Mettraux, jmettraux+flon@gmail.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// Made in Japan.
//
// https://github.com/flon-io/flutil
#define _POSIX_C_SOURCE 200809L
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
static char sixfours[64] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789"
"+/";
static int foursixes[122 - 43] =
{};
static void init_foursixes()
{
for (size_t i = 0; i < 64; ++i) foursixes[sixfours[i] - 43] = i;
}
void flu64_do_encode(char *in, size_t l, char *out)
{
unsigned char a, b, c;
int w, x, y, z;
int bpad, cpad;
for (size_t i = 0, j = 0; i < l; )
{
a = in[i++];
b = 0; if (i < l) b = in[i]; bpad = (i >= l); i++;
c = 0; if (i < l) c = in[i]; cpad = (i >= l); i++;
w = a >> 2;
x = ((0x03 & a) << 4) | (b >> 4);
y = ((0x0f & b) << 2) | (c >> 6);
z = 0x3f & c;
out[j++] = sixfours[w];
out[j++] = sixfours[x];
out[j++] = bpad ? '=' : sixfours[y];
out[j++] = cpad ? '=' : sixfours[z];
}
}
void flu64_do_decode(char *in, size_t l, char *out)
{
if (foursixes[0] == 0) init_foursixes();
int w, x, y, z;
for (size_t i = 0, j = 0; i < l; )
{
w = foursixes[in[i++] - 43]; x = foursixes[in[i++] - 43];
y = foursixes[in[i++] - 43]; z = foursixes[in[i++] - 43];
out[j++] = (w << 2) | (x >> 4);
if (in[i - 2] != '=') out[j++] = ((x & 0x0f) << 4) | (y >> 2);
if (in[i - 1] != '=') out[j++] = ((y & 0x03) << 6) | z;
}
}
char *flu64_encode(char *in, ssize_t l)
{
if ((int)l == -1) l = strlen(in);
char *out = calloc(l * 2, sizeof(char));
flu64_do_encode(in, l, out);
return out;
}
char *flu64_decode(char *in, ssize_t l)
{
if ((int)l == -1) l = strlen(in);
char *out = calloc(l, sizeof(char));
flu64_do_decode(in, l, out);
return out;
}
char *flu64_encode_for_url(char *in, ssize_t l)
{
char *r = flu64_encode(in, l);
for (size_t i = 0; ; ++i)
{
if (r[i] == 0) break;
if (r[i] == '=') r[i] = '.';
else if (r[i] == '+') r[i] = '-';
else if (r[i] == '/') r[i] = '_';
}
return r;
}
char *flu64_decode_from_url(char *in, ssize_t l)
{
char *r = NULL;
char *s = strdup(in);
if ((int)l == -1) l = strlen(in);
for (size_t i = 0; i < l; ++i)
{
if (s[i] == '.') s[i] = '=';
else if (s[i] == '-') s[i] = '+';
else if (s[i] == '_') s[i] = '/';
}
r = flu64_decode(s, l);
free(s);
return r;
}
//commit 02c7844e77f6c0f7da9f782a9f230efec5b05a32
//Author: John Mettraux <jmettraux@gmail.com>
//Date: Sun Aug 23 06:34:12 2015 +0900
//
// compare ssize_t with -1
//
// and not < 0, which happens also when l > INT_MAX...
|
#ifndef _IMAGE_BASED_FITTING_MASK_H_
#define _IMAGE_BASED_FITTING_MASK_H_
#include "common.h"
#include "CImg.h"
class ImageBasedFittingMask{
public :
ImageBasedFittingMask(); //size of the patch
~ImageBasedFittingMask();
void runComputation(void);
private :
};
#endif //_IMAGE_BASED_FITTING_MASK_H_
|
/*
* Copyright 2006 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkFixed_DEFINED
# define SkFixed_DEFINED
# include "include/core/SkScalar.h"
# include "include/core/SkTypes.h"
# include "include/private/SkSafe_math.h"
# include "include/private/SkTo.h"
/** \file SkFixed.h
Types and macros for 16.16 fixed point
*/
/** 32 bit signed integer used to represent fractions values with 16 bits to the right of the decimal point
*/
typedef int32_t SkFixed;
# define SK_Fixed1(1 << 16)
# define SK_FixedHalf(1 << 15)
# define SK_FixedQuarter(1 << 14)
# define SK_FixedMax(0x7FFFFFFF)
# define SK_FixedMin(-SK_FixedMax)
# define SK_FixedPI(0x3243F)
# define SK_FixedSqrt2(92682)
# define SK_FixedTanPIOver8(0x6A0A)
# define SK_FixedRoot2Over2(0xB505)
// NOTE: SkFixedToFloat is exact. SkFloatToFixed seems to lack a rounding step. For all fixed-point
// values, this version is as accurate as possible for (fixed -> float -> fixed). Rounding reduces
// accuracy if the intermediate floats are in the range that only holds integers (adding 0.5f to an
// odd integer then snaps to nearest even). Using double for the rounding math gives maximum
// accuracy for (float -> fixed -> float), but that's usually overkill.
# define SkFixedToFloat(x) ((x) * 1.52587890625e-5f)
# define SkFloatToFixed(x) sk_float_saturate2int((x) * SK_Fixed1)
# ifdef SK_DEBUG
static SkFixed SkFloatToFixed_Check(float x)
{
int64_t n64 = (int64_t) (x * SK_Fixed1);
SkFixed n32 = (SkFixed) n64;
SkASSERT(n64 == n32);
return n32;
}
# else
# define SkFloatToFixed_Check(x) SkFloatToFixed(x)
# endif
# define SkFixedToDouble(x) ((x) * 1.52587890625e-5)
# define SkDoubleToFixed(x) ((SkFixed)((x) * SK_Fixed1))
/** Converts an integer to a SkFixed, asserting that the result does not overflow
a 32 bit signed integer
*/
# ifdef SK_DEBUG
inline SkFixed SkIntToFixed(int n)
{
SkASSERT(n >= -32768 && n <= 32767);
// Left shifting a negative value has undefined behavior in C, so we cast to unsigned before
// shifting.
return (unsigned) n << 16;
}
# else
// Left shifting a negative value has undefined behavior in C, so we cast to unsigned before
// shifting. Then we force the cast to SkFixed to ensure that the answer is signed (like the
// debug version).
# define SkIntToFixed(n) (SkFixed)((unsigned)(n) << 16)
# endif
# define SkFixedRoundToInt(x) (((x) + SK_FixedHalf) >> 16)
# define SkFixedCeilToInt(x) (((x) + SK_Fixed1 - 1) >> 16)
# define SkFixedFloorToInt(x) ((x) >> 16)
static SkFixed SkFixedRoundToFixed(SkFixed x)
{
return (x + SK_FixedHalf) & 0xFFFF0000;
}
static SkFixed SkFixedCeilToFixed(SkFixed x)
{
return (x + SK_Fixed1 - 1) & 0xFFFF0000;
}
static SkFixed SkFixedFloorToFixed(SkFixed x)
{
return x & 0xFFFF0000;
}
# define SkFixedAbs(x) SkAbs32(x)
# define SkFixedAve(a, b) (((a) + (b)) >> 1)
// The divide may exceed 32 bits. Clamp to a signed 32 bit result.
# define SkFixedDiv(numer, denom) \
SkToS32(SkTPin<int64_t>((SkLeftShift((int64_t)(numer), 16) / (denom)), SK_MinS32, SK_MaxS32))
static SkFixed SkFixedMul(SkFixed a, SkFixed b)
{
return (SkFixed) ((int64_t) a * b >> 16);
}
///////////////////////////////////////////////////////////////////////////////
// Platform-specific alternatives to our portable versions.
// The VCVT float-to-fixed instruction is part of the VFPv3 instruction set.
# if defined(__ARM_VFPV3__)
/* This guy does not handle NaN or other obscurities, but is faster than
than (int)(x*65536). When built on Android with -Os, needs forcing
to inline or we lose the speed benefit.
*/
SK_ALWAYS_INLINE SkFixed SkFloatToFixed_arm(float x)
{
int32_t y;
memcpy(&y, &x, sizeof(y));
return y;
}
# undef SkFloatToFixed
# define SkFloatToFixed(x) SkFloatToFixed_arm(x)
# endif
///////////////////////////////////////////////////////////////////////////////
# define SkFixedToScalar(x) SkFixedToFloat(x)
# define SkScalarToFixed(x) SkFloatToFixed(x)
///////////////////////////////////////////////////////////////////////////////
typedef int64_t SkFixed3232;
# define SkFixed3232Max SK_MaxS64
# define SkFixed3232Min(-SkFixed3232Max)
# define SkIntToFixed3232(x) (SkLeftShift((SkFixed3232)(x), 32))
# define SkFixed3232ToInt(x) ((int)((x) >> 32))
# define SkFixedToFixed3232(x) (SkLeftShift((SkFixed3232)(x), 16))
# define SkFixed3232ToFixed(x) ((SkFixed)((x) >> 16))
# define SkFloatToFixed3232(x) sk_float_saturate2int64((x) * (65536.0f * 65536.0f))
# define SkFixed3232ToFloat(x) (x * (1 / (65536.0f * 65536.0f)))
# define SkScalarToFixed3232(x) SkFloatToFixed3232(x)
#endif
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/* Copyright (c) 2018 Facebook */
#ifndef __LINUX_BTF_H__
#define __LINUX_BTF_H__
#include <linux/types.h>
#define BTF_MAGIC 0xeB9F
#define BTF_VERSION 1
struct btf_header {
__u16 magic;
__u8 version;
__u8 flags;
__u32 hdr_len;
/* All offsets are in bytes relative to the end of this header */
__u32 type_off; /* offset of type section */
__u32 type_len; /* length of type section */
__u32 str_off; /* offset of string section */
__u32 str_len; /* length of string section */
};
/* Max # of type identifier */
#define BTF_MAX_TYPE 0x000fffff
/* Max offset into the string section */
#define BTF_MAX_NAME_OFFSET 0x00ffffff
/* Max # of struct/union/enum members or func args */
#define BTF_MAX_VLEN 0xffff
struct btf_type {
__u32 name_off;
/* "info" bits arrangement
* bits 0-15: vlen (e.g. # of struct's members)
* bits 16-23: unused
* bits 24-27: kind (e.g. int, ptr, array...etc)
* bits 28-30: unused
* bit 31: kind_flag, currently used by
* struct, union and fwd
*/
__u32 info;
/* "size" is used by INT, ENUM, STRUCT, UNION and DATASEC.
* "size" tells the size of the type it is describing.
*
* "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT,
* FUNC, FUNC_PROTO, VAR and DECL_TAG.
* "type" is a type_id referring to another type.
*/
union {
__u32 size;
__u32 type;
};
};
#define BTF_INFO_KIND(info) (((info) >> 24) & 0x1f)
#define BTF_INFO_VLEN(info) ((info) & 0xffff)
#define BTF_INFO_KFLAG(info) ((info) >> 31)
enum {
BTF_KIND_UNKN = 0, /* Unknown */
BTF_KIND_INT = 1, /* Integer */
BTF_KIND_PTR = 2, /* Pointer */
BTF_KIND_ARRAY = 3, /* Array */
BTF_KIND_STRUCT = 4, /* Struct */
BTF_KIND_UNION = 5, /* Union */
BTF_KIND_ENUM = 6, /* Enumeration */
BTF_KIND_FWD = 7, /* Forward */
BTF_KIND_TYPEDEF = 8, /* Typedef */
BTF_KIND_VOLATILE = 9, /* Volatile */
BTF_KIND_CONST = 10, /* Const */
BTF_KIND_RESTRICT = 11, /* Restrict */
BTF_KIND_FUNC = 12, /* Function */
BTF_KIND_FUNC_PROTO = 13, /* Function Proto */
BTF_KIND_VAR = 14, /* Variable */
BTF_KIND_DATASEC = 15, /* Section */
BTF_KIND_FLOAT = 16, /* Floating point */
BTF_KIND_DECL_TAG = 17, /* Decl Tag */
NR_BTF_KINDS,
BTF_KIND_MAX = NR_BTF_KINDS - 1,
};
/* For some specific BTF_KIND, "struct btf_type" is immediately
* followed by extra data.
*/
/* BTF_KIND_INT is followed by a u32 and the following
* is the 32 bits arrangement:
*/
#define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24)
#define BTF_INT_OFFSET(VAL) (((VAL) & 0x00ff0000) >> 16)
#define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff)
/* Attributes stored in the BTF_INT_ENCODING */
#define BTF_INT_SIGNED (1 << 0)
#define BTF_INT_CHAR (1 << 1)
#define BTF_INT_BOOL (1 << 2)
/* BTF_KIND_ENUM is followed by multiple "struct btf_enum".
* The exact number of btf_enum is stored in the vlen (of the
* info in "struct btf_type").
*/
struct btf_enum {
__u32 name_off;
__s32 val;
};
/* BTF_KIND_ARRAY is followed by one "struct btf_array" */
struct btf_array {
__u32 type;
__u32 index_type;
__u32 nelems;
};
/* BTF_KIND_STRUCT and BTF_KIND_UNION are followed
* by multiple "struct btf_member". The exact number
* of btf_member is stored in the vlen (of the info in
* "struct btf_type").
*/
struct btf_member {
__u32 name_off;
__u32 type;
/* If the type info kind_flag is set, the btf_member offset
* contains both member bitfield size and bit offset. The
* bitfield size is set for bitfield members. If the type
* info kind_flag is not set, the offset contains only bit
* offset.
*/
__u32 offset;
};
/* If the struct/union type info kind_flag is set, the
* following two macros are used to access bitfield_size
* and bit_offset from btf_member.offset.
*/
#define BTF_MEMBER_BITFIELD_SIZE(val) ((val) >> 24)
#define BTF_MEMBER_BIT_OFFSET(val) ((val) & 0xffffff)
/* BTF_KIND_FUNC_PROTO is followed by multiple "struct btf_param".
* The exact number of btf_param is stored in the vlen (of the
* info in "struct btf_type").
*/
struct btf_param {
__u32 name_off;
__u32 type;
};
enum {
BTF_VAR_STATIC = 0,
BTF_VAR_GLOBAL_ALLOCATED = 1,
BTF_VAR_GLOBAL_EXTERN = 2,
};
enum btf_func_linkage {
BTF_FUNC_STATIC = 0,
BTF_FUNC_GLOBAL = 1,
BTF_FUNC_EXTERN = 2,
};
/* BTF_KIND_VAR is followed by a single "struct btf_var" to describe
* additional information related to the variable such as its linkage.
*/
struct btf_var {
__u32 linkage;
};
/* BTF_KIND_DATASEC is followed by multiple "struct btf_var_secinfo"
* to describe all BTF_KIND_VAR types it contains along with it's
* in-section offset as well as size.
*/
struct btf_var_secinfo {
__u32 type;
__u32 offset;
__u32 size;
};
/* BTF_KIND_DECL_TAG is followed by a single "struct btf_decl_tag" to describe
* additional information related to the tag applied location.
* If component_idx == -1, the tag is applied to a struct, union,
* variable or function. Otherwise, it is applied to a struct/union
* member or a func argument, and component_idx indicates which member
* or argument (0 ... vlen-1).
*/
struct btf_decl_tag {
__s32 component_idx;
};
#endif /* __LINUX_BTF_H__ */
|
//
// POAPinyin.h
// POA
//
// Created by haung he on 11-7-18.
// Copyright 2011年 huanghe. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface KCPinyinHelper : NSObject
// 中文转拼音,firstCharFinishBlock,汉子首字母;allCharFinishBlock,汉子全拼
+ (void)convertFromChineseToPinyin:(NSString *)chineseSource
firstCharString:(NSMutableString *)firstCharString
allCharString:(NSMutableString *)firstCharString;
// 传入汉字,返回拼音首字母
+ (NSString *)quickConvert:(NSString *)hzString;
// 中文转拼音,返回全拼
+ (NSString *)pinyinFromChiniseString:(NSString *)hzString;
@end
|
#ifndef PAIR_CO2_SILICAGEL_H
#define PAIR_CO2_SILICAGEL_H
#include "pair_template.h"
#include "eqn_template.h"
#include "eqn_toth.h"
class pair_CO2_silicaGel: public pair_template
{
public:
pair_CO2_silicaGel(std::string subType = "");
void init();
double calc(std::string eqn, double tK, double xMass);
};
#endif // PAIR_CO2_SILICAGEL_H
|
/*
* Name: wx/dfb/chkconf.h
* Author: Vaclav Slavik
* Purpose: Compiler-specific configuration checking
* Created: 2006-08-10
* Copyright: (c) 2006 REA Elektronik GmbH
* Licence: wxWindows licence
*/
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
#ifndef _WX_DFB_CHKCONF_H_
# define _WX_DFB_CHKCONF_H_
# ifndef __WXUNIVERSAL__
# endif
# if wxUSE_SOCKETS && !wxUSE_CONSOLE_EVENTLOOP
# ifdef wxABORT_ON_CONFIG_ERROR
# else
# undef wxUSE_CONSOLE_EVENTLOOP
# define wxUSE_CONSOLE_EVENTLOOP 1
# endif
# endif
# if wxUSE_DATAOBJ
# ifdef wxABORT_ON_CONFIG_ERROR
# else
# undef wxUSE_DATAOBJ
# define wxUSE_DATAOBJ 0
# endif
# endif
#endif
|
/*
* switch_pushbutton.h
*
* Created on: 2015-02-10
* Author: Allen
*/
#ifndef SWITCH_PUSHBUTTON_H_
#define SWITCH_PUSHBUTTON_H_
#define switchAddress (volatile char*) 0x00004870
#define ledAddress (volatile char*) 0x00004860
#define keyAddress (volatile char*) 0x00004840
#include <altera_avalon_pio_regs.h>
#include <io.h>
#include <stdlib.h>
#include <stdio.h>
#include "system.h"
#include <math.h>
#include <unistd.h>
#include <time.h>
#include <stdbool.h>
#include <sys/alt_alarm.h>
void switchpushbutton_Detect(char keys, char switches);
#endif /* SWITCH_PUSHBUTTON_H_ */
|
//
// ZLPhotoBrowser.h
// 多选相册照片
//
// Created by long on 15/11/27.
// Copyright © 2015年 long. All rights reserved.
//
#import <UIKit/UIKit.h>
@class ZLPhotoModel;
@class PHAsset;
@class AVPlayerItem;
@interface ZLImageNavigationController : UINavigationController
@property (nonatomic, assign) UIStatusBarStyle previousStatusBarStyle;
/** 最大选择数 默认10张*/
@property (nonatomic, assign) NSInteger maxSelectCount;
/**是否允许选择照片 默认YES*/
@property (nonatomic, assign) BOOL allowSelectImage;
/**是否允许选择视频 默认YES*/
@property (nonatomic, assign) BOOL allowSelectVideo;
/**cell的圆角弧度 默认为0*/
@property (nonatomic, assign) CGFloat cellCornerRadio;
/**是否允许选择Gif 默认YES*/
@property (nonatomic, assign) BOOL allowSelectGif;
/**是否允许相册内部拍照 默认YES*/
@property (nonatomic, assign) BOOL allowTakePhotoInLibrary;
/**是否在相册内部拍照按钮上面实时显示相机俘获的影像 默认 YES*/
@property (nonatomic, assign) BOOL showCaptureImageOnTakePhotoBtn;
/**是否升序排列,预览界面不受该参数影响,默认升序 YES*/
@property (nonatomic, assign) BOOL sortAscending;
/**控制单选模式下,是否显示选择按钮,默认 NO,多选模式不受控制*/
@property (nonatomic, assign) BOOL showSelectBtn;
/**是否选择了原图*/
@property (nonatomic, assign) BOOL isSelectOriginalPhoto;
@property (nonatomic, copy) NSMutableArray<ZLPhotoModel *> *arrSelectedModels;
/**点击确定选择照片回调*/
@property (nonatomic, copy) void (^callSelectImageBlock)();
/**点击确定gif回调*/
@property (nonatomic, copy) void (^callSelectGifBlock)(UIImage *, PHAsset *);
/**点击确定video回调*/
@property (nonatomic, copy) void (^callSelectVideoBlock)(UIImage *, PHAsset *);
/**取消block*/
@property (nonatomic, copy) void (^cancelBlock)();
@end
@interface ZLPhotoBrowser : UITableViewController
@end
|
#ifndef _CRITICALSECTION_
#define _CRITICALSECTION_
#include "PublicDef.h"
#include <list>
namespace BaseLabWin
{
class CCRITICAL_SECTION
{
public:
CCRITICAL_SECTION();
~CCRITICAL_SECTION();
inline void lock();
inline void unlock();
static CCRITICAL_SECTION& getInstance();
private:
CRITICAL_SECTION _lock;
};
class CCRITICAL_SECTION_TEST
{
public:
CCRITICAL_SECTION_TEST();
~CCRITICAL_SECTION_TEST();
static DWORD WINAPI producer(LPVOID pParameter);
static DWORD WINAPI consumer(LPVOID pParameter);
private:
static std::list<Msg> MsgList;
static int messageNum;
};
}
#endif
|
/***********************************************
* # Copyright 2011. Thuy Diem Nguyen
* # Contact: thuy1@e.ntu.edu.sg
* #
* # GPL 3.0 applies.
* #
* ************************************************/
#ifndef _EUCLID_MAIN_H_
#define _EUCLID_MAIN_H_
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <time.h>
#include <math.h>
#include <string.h>
#include <omp.h>
#include <sys/time.h>
using namespace std;
#define BLOCK_DIM 16
#define NUM_STREAMS 1 //4
#define THRESHOLD 0.1
#define EPSILON 1e-6
#define BUF_SIZE 4096
void removeNewLine(string &line);
void removeInvalidChar(string &line);
void help();
int loadFreq(string freqFileName);
unsigned int loadDistFile(FILE* distFile, float* distArray, bool &EOFTag);
void Trag_reverse_eq(int index, int N, int& row, int& col);
void getCommandOptions(int argc, char* argv[], string &inFileName, float &threshold, bool &useGPU, int &numThreads, int &numReads);
void computeEuclidDist_CPU(float ** eReads, string pairFileName, string distFileName, int numReads, int numSeeds, float threshold, int arrayDim);
void computeEuclidDist_CUDA(float ** eReads, string pairFileName, string distFileName, int numReads, int numSeeds, float threshold, int arrayDim);
#endif
|
/*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for 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.
*/
/** \file
*
* Header file for MassStoreHost.c.
*/
#ifndef _MASS_STORE_HOST_H_
#define _MASS_STORE_HOST_H_
/* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/pgmspace.h>
#include <avr/power.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "ConfigDescriptor.h"
#include "Lib/MassStoreCommands.h"
#include <LUFA/Version.h>
#include <LUFA/Drivers/Misc/TerminalCodes.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
#define LEDMASK_USB_NOTREADY LEDS_LED1
/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */
#define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3)
/** LED mask for the library LED driver, to indicate that the USB interface is ready. */
#define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4)
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */
#define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_USB_BUSY LEDS_LED2
/* Function Prototypes: */
void MassStorage_Task(void);
void SetupHardware(void);
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
void EVENT_USB_Host_DeviceAttached(void);
void EVENT_USB_Host_DeviceUnattached(void);
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
void EVENT_USB_Host_DeviceEnumerationComplete(void);
void ShowDiskReadError(char* CommandString, uint8_t ErrorCode);
#endif
|
//
// AppDelegate.h
// VBVerticalScrollViewExample
//
// Created by Valeriy Bezuglyy on 30/07/15.
// Copyright (c) 2015 Valeriy Bezuglyy. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
//
// SingViewController.h
// HighCBar
//
// Created by shadow on 14-6-28.
// Copyright (c) 2014年 genio. All rights reserved.
//
#import <UIKit/UIKit.h>
@class WaterView, ScoreViewController;
@interface SingViewController : UIViewController <AVAudioPlayerDelegate>
@property (weak, nonatomic) IBOutlet WaterView *waterView;
@property (weak, nonatomic) IBOutlet UIView *containerView;
@property (weak, nonatomic) IBOutlet UIButton *dismissBtn;
@property (weak, nonatomic) IBOutlet UILabel *fadeLrcLabel;
@property (weak, nonatomic) IBOutlet UILabel *currentLrcLabel;
@property (weak, nonatomic) IBOutlet UIView *addContainerView;
@property (weak, nonatomic) IBOutlet UILabel *readyLrcLabel;
@property (weak, nonatomic) ScoreViewController *scoreViewController;
@end
|
//
// NewsCell.h
// Newsobj
//
// Created by gdarkness on 16/2/28.
// Copyright © 2016年 gdarkness. All rights reserved.
//
#import <UIKit/UIKit.h>
@class NewsModel;
@interface NewsCell : UITableViewCell
@property (nonatomic,strong)NewsModel *news;
+(NSString *)cellIdentiferWithNews:(NewsModel *)news;
+(CGFloat)cellHeightWithNews:(NewsModel *)news;
@end
|
//
// StoreKISS.h
// StoreKISS
//
// Created by Misha Karpenko on 5/24/12.
// Copyright (c) 2012 Redigion. All rights reserved.
//
#import "StoreKISSShared.h"
#import "StoreKISSDataRequest.h"
#import "StoreKISSPaymentRequest.h"
|
//
// ViewController.h
// Coloroid
//
// Copyright (c) 2014 Ayan Yenbekbay. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <SpriteKit/SpriteKit.h>
@interface ViewController : UIViewController
@end
|
#ifndef nimbus_resource_load_h
#define nimbus_resource_load_h
#include <tyran_engine/resource/id.h>
#include <tyran_engine/resource/type_id.h>
#include <tyran_engine/resource/index.h>
extern const u8t NIMBUS_EVENT_RESOURCE_LOAD;
struct nimbus_event_write_stream;
typedef struct nimbus_resource_load {
nimbus_resource_id resource_id;
nimbus_resource_type_id resource_type_id;
nimbus_resource_index index;
} nimbus_resource_load;
void nimbus_resource_load_send(struct nimbus_event_write_stream* stream, nimbus_resource_id id,
nimbus_resource_type_id resource_type_id, nimbus_resource_index index);
#endif
|
/***************************************************//**
* @file RawUSBBusAccessFeatureInterface.h
* @date October 2012
* @author Ocean Optics, Inc.
*
* LICENSE:
*
* SeaBreeze Copyright (C) 2014, Ocean Optics Inc
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*******************************************************/
#ifndef SEABREEZE_RAW_USB_BUS_ACCESS_FEATURE_INTERFACE_H
#define SEABREEZE_RAW_USB_BUS_ACCESS_FEATURE_INTERFACE_H
#include "common/features/Feature.h"
#include "common/exceptions/FeatureException.h"
#include "common/buses/usb/USBInterface.h"
namespace seabreeze {
class RawUSBBusAccessFeatureInterface {
public:
virtual ~RawUSBBusAccessFeatureInterface() = 0;
virtual std::vector<unsigned char> readUSB(const USBInterface *bus, int endpoint,
unsigned int length ) = 0;
virtual int writeUSB(const USBInterface *bus, int endpoint,
const std::vector<unsigned char> &data) = 0;
};
/* Default implementation for (otherwise) pure virtual destructor */
inline RawUSBBusAccessFeatureInterface::~RawUSBBusAccessFeatureInterface() {}
}
#endif
|
#pragma once
#include "glm/vec3.hpp"
enum ShapeType
{
PLANE = 0,
SPHERE = 1,
BOX = 2,
};
class PhysicsObject
{
public:
PhysicsObject();
~PhysicsObject();
virtual void fixedUpdate(glm::vec2 gravity, float timeStep) = 0;
virtual void debug() = 0;
virtual void makeGizmo() = 0;
virtual void resetPosition() {};
protected:
ShapeType m_shapeID;
};
|
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 30 2020 21:18:12).
//
// Copyright (C) 1997-2019 Steve Nygard.
//
#import <DVTDeviceFoundation/DVTBuildTargetDevice.h>
#import <IDEKit/DVTBasicDeviceUI-Protocol.h>
@class DVTPlatform, NSArray, NSError, NSImage, NSSet, NSString;
@interface DVTBuildTargetDevice (IDEKitAdditions) <DVTBasicDeviceUI>
@property(readonly) NSImage *image;
// Remaining properties
@property(readonly, getter=isAvailable) BOOL available;
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) _Bool deviceIsBusy;
@property(readonly) NSArray *deviceSummaryPropertyDictionaries;
@property(readonly) int deviceWindowCategory;
@property(readonly) unsigned long long hash;
@property(readonly, copy) NSString *iOSSupportVersion;
@property(readonly, copy, nonatomic) NSString *identifier;
@property(readonly) BOOL isProxiedDevice;
@property(readonly, copy, nonatomic) NSString *modelCode;
@property(readonly, copy, nonatomic) NSString *modelCodename;
@property(readonly, copy, nonatomic) NSString *modelName;
@property(readonly, copy, nonatomic) NSString *modelUTI;
@property(readonly, copy, nonatomic) NSString *name;
@property(readonly, copy) NSString *nameForDeveloperPortal;
@property(readonly, copy) NSString *nativeArchitecture;
@property(readonly, copy) NSString *operatingSystemBuild;
@property(readonly, copy) NSString *operatingSystemVersion;
@property(readonly, copy, nonatomic) NSString *operatingSystemVersionWithBuildNumber;
@property(readonly) DVTPlatform *platform;
@property(readonly, copy) NSString *platformIdentifier;
@property(readonly, copy) NSString *processorDescription;
@property(readonly, copy) NSSet *proxiedDevices;
@property(readonly) NSImage *proxyDeviceImage;
@property(readonly) BOOL showCompanionUI;
@property(readonly) Class superclass;
@property(readonly) BOOL supportsProvisioning;
@property(readonly) NSError *unavailabilityError;
@end
|
#ifndef FSEGTFREECAMERACONTROLLERDEFINED
#define FSEGTFREECAMERACONTROLLERDEFINED
#include <memory>
#include <FlameSteelEngineGameToolkit/IO/Input/FSEGTInputController.h>
#include <FlameSteelCore/FSCObject.h>
class FSEGTFreeCameraControllerDelegate;
using namespace std;
class FSEGTFreeCameraController: public enable_shared_from_this<FSEGTFreeCameraController> {
public:
FSEGTFreeCameraController(shared_ptr<FSEGTInputController> inputController, shared_ptr<FSCObject> camera);
void step();
weak_ptr<FSEGTFreeCameraControllerDelegate> delegate;
private:
shared_ptr<FSEGTInputController> inputController;
shared_ptr<FSCObject> camera;
};
#endif
|
#include "../Ability_private.h"
int JiBenBianFa_cost(struct Ability* self)
{
return 0;
}
void JiBenBianFa_add_buff_to_attacker(struct Ability* self, struct Hero* attacker, struct Hero* target)
{
Hero_AddBuff(attacker, JiBenBianFaBuff_Get(99));
}
float JiBenBianFa_damage(struct Ability* self, struct Hero* attacker, struct Hero* target)
{
return (damage_RollAttack(attacker)+(float)102.0)*1.74;
}
char JiBenBianFa_name[] = ("基本鞭法");
struct Ability_Info abilityinfo_JiBenBianFa =
{
JiBenBianFa_name,
NULL,
NULL,
NULL,
JiBenBianFa_cost,
NULL,
NULL,
JiBenBianFa_damage,
NULL,
JiBenBianFa_add_buff_to_attacker,
NULL,
1,
};
void JiBenBianFa_bind()
{
Ability_bind(&abilityinfo_JiBenBianFa);
}
|
/*
* Copyright (c) 2015 Kadambari Melatur, Alexandre Monti, Rémi Saurel and Emma Vareilles
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef LCOMM_CLIENTSOCKET_H
#define LCOMM_CLIENTSOCKET_H
#include "lcomm/socket.h"
#include "lchrono/chrono.h"
#include <netinet/in.h>
#include <thread>
#include <atomic>
#include <mutex>
#include <queue>
#include <stdexcept>
#include <chrono>
#include <vector>
using namespace std::literals;
namespace lcomm {
//! This class implements the lcomm::Socket interface
//! for a client TCP socket (using Unix sockets).
//! It queues input data that can be read with the read() method.
class ClientSocket : public Socket {
public:
//! Create a client socket, and attempt a connection to
//! the specified server.
//! \param ip The IP address of the remote server to connect to
//! \param port The port to connect to
//! \param latency The polling period for reading (and therefore queuing) input data
ClientSocket(std::string const& ip, unsigned int port, bool tcp = true, lchrono::duration latency = 5ms);
//! Connection is closed and ressources freed at destruction of the socket.
virtual ~ClientSocket();
//! Check if socket is still opened.
//! \return Returns true if the socket is opened, false otherwise
bool opened() const override;
//! Write some data in the socket.
//! \param data The data to write to the socket
void write(std::string const& data) const override;
//! Attempt to read data from the socket.
//! \param data Output parameter for read data
//! \return True if all went well, false otherwise (or if there is nothing to read)
bool read(std::string* data) const override;
void connect() override;
void close() override;
private:
lchrono::duration m_latency;
int m_fd;
sockaddr_in m_addr;
mutable std::mutex m_fd_mutex;
mutable std::atomic_bool m_connected_flag;
bool const m_tcp;
mutable std::vector<char> m_buf;
};
}
#endif // LCOMM_CLIENTSOCKET_H
|
/*
* File: udp.h
* Author: alpsayin
*
* Created on March 21, 2012, 2:54 PM
*/
#ifndef UDP_H
#define UDP_H
#include <stdio.h>
#include <inttypes.h>
#include <stdint.h>
#include "ax25.h"
#define UDP_MAX_PAYLOAD_LENGTH (256)
#define UDP_TOTAL_HEADERS_LENGTH (18+8)
#define IPV4_VERSIONnIHL_LENGTH 1
#define IPV4_DSCPnECN_LENGTH 1
#define IPV4_TOTAL_LENGTH_LENGTH 2
#define IPV4_IDENTIFICATION_LENGTH 2
#define IPV4_FLAGSnFRAGMENT_OFFSET_LENGTH 2
#define IPV4_TIME_TO_LIVE_LENGTH 1
#define IPV4_PROTOCOL_LENGTH 1
#define IPV4_HEADER_CHECKSUM_LENGTH 2
#define IPV4_SOURCE_LENGTH 4
#define IPV4_DESTINATION_LENGTH 4
#define IPV4_VERSIONnIHL_OFFSET 0
#define IPV4_DSCPnECN_OFFSET (IPV4_VERSIONnIHL_OFFSET+IPV4_VERSIONnIHL_LENGTH)
#define IPV4_TOTAL_LENGTH_OFFSET (IPV4_DSCPnECN_OFFSET+IPV4_DSCPnECN_LENGTH)
#define IPV4_IDENTIFICATION_OFFSET (IPV4_TOTAL_LENGTH_OFFSET+IPV4_TOTAL_LENGTH_LENGTH)
#define IPV4_FLAGSnFRAGMENT_OFFSET_OFFSET (IPV4_IDENTIFICATION_OFFSET+IPV4_IDENTIFICATION_LENGTH)
#define IPV4_TIME_TO_LIVE_OFFSET (IPV4_FLAGSnFRAGMENT_OFFSET_OFFSET+IPV4_FLAGSnFRAGMENT_OFFSET_LENGTH)
#define IPV4_PROTOCOL_OFFSET (IPV4_TIME_TO_LIVE_OFFSET+IPV4_TIME_TO_LIVE_LENGTH)
#define IPV4_HEADER_CHECKSUM_OFFSET (IPV4_PROTOCOL_OFFSET+IPV4_PROTOCOL_LENGTH)
#define IPV4_SOURCE_OFFSET (IPV4_HEADER_CHECKSUM_OFFSET+IPV4_HEADER_CHECKSUM_LENGTH)
#define IPV4_DESTINATION_OFFSET (IPV4_SOURCE_OFFSET+IPV4_SOURCE_LENGTH)
#define IPV4_PAYLOAD_OFFSET (IPV4_DESTINATION_OFFSET+IPV4_DESTINATION_LENGTH)
#define UDP_SOURCE_PORT_LENGTH 2
#define UDP_DESTINATION_PORT_LENGTH 2
#define UDP_LENGTH_LENGTH 2
#define UDP_CHECKSUM_LENGTH 2
#define UDP_SOURCE_PORT_OFFSET (IPV4_PAYLOAD_OFFSET)
#define UDP_DESTINATION_PORT_OFFSET (UDP_SOURCE_PORT_OFFSET+UDP_SOURCE_PORT_LENGTH)
#define UDP_LENGTH_OFFSET (UDP_DESTINATION_PORT_OFFSET+UDP_DESTINATION_PORT_LENGTH)
#define UDP_CHECKSUM_OFFSET (UDP_LENGTH_OFFSET+UDP_LENGTH_LENGTH)
#define UDP_PAYLOAD_OFFSET (UDP_CHECKSUM_OFFSET+UDP_CHECKSUM_LENGTH)
#define IPV4_TTL_LIMIT 2
#define UDP_IPV4_PROTOCOL_NUMBER 0x11
#define PACKET_HANDLER_FUNCTION_PROTO( appName) uint8_t appName(uint8_t* src, uint16_t src_port, uint8_t* dst, uint16_t dst_port, uint8_t* payload, uint16_t len)
#define PACKET_HANDLER_FUNCTION( appName) uint8_t appName(uint8_t* src, uint16_t src_port, uint8_t* dst, uint16_t dst_port, uint8_t* payload, uint16_t len)
#ifdef __cplusplus
extern "C" {
#endif
typedef uint8_t (*dataQueuerfptr_t)(uint8_t* src, uint16_t src_port, uint8_t* dst, uint16_t dst_port, uint8_t* dataptr, uint16_t datalen);
typedef uint8_t (*packetHandlerfptr_t)(uint8_t* src, uint16_t src_port, uint8_t* dst, uint16_t dst_port, uint8_t* payload, uint16_t len);
void udp_initialize_ip_network(uint8_t* myIpAddress, dataQueuerfptr_t dataQueuer);
dataQueuerfptr_t udp_get_data_queuer_fptr(void);
uint8_t* udp_get_localhost_ip(uint8_t* ip_out);
uint8_t* udp_get_broadcast_ip(uint8_t* ip_out);
uint16_t udp_create_packet(uint8_t* src_in, uint16_t src_port, uint8_t* dst_in, uint16_t dst_port, uint8_t* payload_in, uint16_t payload_length, uint8_t* packet_out);
uint8_t udp_check_destination(uint8_t* my_dst, uint8_t* packet_dst, uint8_t* packet_in);
uint16_t udp_open_packet(uint8_t* src_out, uint16_t* src_port_out,
uint8_t* dst_out, uint16_t* dst_port_out,
uint8_t* payload_out,
uint8_t* packet_in);
uint16_t udp_open_packet_extended(uint8_t* src_out, uint16_t* src_port_out,
uint8_t* dst_out, uint16_t* dst_port_out,
uint8_t* payload_out,
uint8_t* packet_in,
uint8_t* version_out,
uint8_t* headerlength_out,
uint8_t* dscp_out,
uint8_t* ecn_out,
uint16_t* totallength_out,
uint16_t* fragmentidentification_out,
uint8_t* flags_out,
uint16_t* fragmentoffset_out,
uint8_t* ttl_out,
uint8_t* protocol_out,
uint16_t* headerchecksum_out
);
#ifdef __cplusplus
}
#endif
#endif /* UDP_H */
|
//
// highScore.h
// tapat
//
// Created by 吴 wuziqi on 11-1-26.
// Copyright 2011 同济大学. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "cocos2d.h"
#import "GameCenterManager.h"
@class GameCenterManager;
@interface highScore : CCLayer<UIAlertViewDelegate,GameCenterManagerDelegate> {
GameCenterManager* gameCenterManager;
int64_t score;
//CCLabelTTF* advenLabel;
//CCLabelTTF* challenLabel;
CCLabelTTF* scoreLabel;
CCLabelTTF* levelLabel[8];
}
@property(nonatomic,retain)GameCenterManager* gameCenterManager;
-(void)submitToLeaderboard:(id)sender;
-(void)gameCenterFunction;
-(void)initButton;
-(void)showAllScoreLocally;
- (void) showAlertWithTitle: (NSString*) title message: (NSString*) message;
@end
|
/* expat_config.h. Generated by configure. */
/* expat_config.h.in. Generated from configure.in by autoheader. */
/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
#define BYTEORDER 1234
/* Define to 1 if you have the `bcopy' function. */
#define HAVE_BCOPY 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `getpagesize' function. */
/* #undef HAVE_GETPAGESIZE */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "expat-bugs@libexpat.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "expat"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "expat 2.0.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "expat"
/* Define to the version of this package. */
#define PACKAGE_VERSION "2.0.1"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* whether byteorder is bigendian */
/* #undef WORDS_BIGENDIAN */
/* Define to specify how much context to retain around the current parse
point. */
#define XML_CONTEXT_BYTES 1024
/* Define to make parameter entity parsing functionality available. */
#define XML_DTD 1
/* Define to make XML Namespaces functionality available. */
#define XML_NS 1
/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */
/* #undef __func__ */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `long' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: ./suggest/src/java/org/apache/lucene/search/suggest/document/SuggestIndexSearcher.java
//
#include "J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher")
#ifdef RESTRICT_OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher
#define INCLUDE_ALL_OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher 0
#else
#define INCLUDE_ALL_OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher 1
#endif
#undef RESTRICT_OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher
#if __has_feature(nullability)
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wnullability"
#pragma GCC diagnostic ignored "-Wnullability-completeness"
#endif
#if !defined (OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher_) && (INCLUDE_ALL_OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher || defined(INCLUDE_OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher))
#define OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher_
#define RESTRICT_OrgApacheLuceneSearchIndexSearcher 1
#define INCLUDE_OrgApacheLuceneSearchIndexSearcher 1
#include "org/apache/lucene/search/IndexSearcher.h"
@class OrgApacheLuceneIndexIndexReader;
@class OrgApacheLuceneIndexIndexReaderContext;
@class OrgApacheLuceneSearchSuggestDocumentCompletionQuery;
@class OrgApacheLuceneSearchSuggestDocumentTopSuggestDocs;
@class OrgApacheLuceneSearchSuggestDocumentTopSuggestDocsCollector;
@protocol JavaUtilConcurrentExecutorService;
/*!
@brief Adds document suggest capabilities to IndexSearcher.
Any <code>CompletionQuery</code> can be used to suggest documents.
Use <code>PrefixCompletionQuery</code> for analyzed prefix queries,
<code>RegexCompletionQuery</code> for regular expression prefix queries,
<code>FuzzyCompletionQuery</code> for analyzed prefix with typo tolerance
and <code>ContextQuery</code> to boost and/or filter suggestions by contexts
*/
@interface OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher : OrgApacheLuceneSearchIndexSearcher
#pragma mark Public
/*!
@brief Creates a searcher with document suggest capabilities
for <code>reader</code>.
*/
- (instancetype __nonnull)initWithOrgApacheLuceneIndexIndexReader:(OrgApacheLuceneIndexIndexReader *)reader;
/*!
@brief Returns top <code>n</code> completion hits for
<code>query</code>
*/
- (OrgApacheLuceneSearchSuggestDocumentTopSuggestDocs *)suggestWithOrgApacheLuceneSearchSuggestDocumentCompletionQuery:(OrgApacheLuceneSearchSuggestDocumentCompletionQuery *)query
withInt:(jint)n;
/*!
@brief Lower-level suggest API.
Collects completion hits through <code>collector</code> for <code>query</code>.
<p><code>TopSuggestDocsCollector.collect(int, CharSequence, CharSequence, float)</code>
is called for every matching completion hit.
*/
- (void)suggestWithOrgApacheLuceneSearchSuggestDocumentCompletionQuery:(OrgApacheLuceneSearchSuggestDocumentCompletionQuery *)query
withOrgApacheLuceneSearchSuggestDocumentTopSuggestDocsCollector:(OrgApacheLuceneSearchSuggestDocumentTopSuggestDocsCollector *)collector;
// Disallowed inherited constructors, do not use.
- (instancetype __nonnull)initWithOrgApacheLuceneIndexIndexReader:(OrgApacheLuceneIndexIndexReader *)arg0
withJavaUtilConcurrentExecutorService:(id<JavaUtilConcurrentExecutorService>)arg1 NS_UNAVAILABLE;
- (instancetype __nonnull)initWithOrgApacheLuceneIndexIndexReaderContext:(OrgApacheLuceneIndexIndexReaderContext *)arg0 NS_UNAVAILABLE;
- (instancetype __nonnull)initWithOrgApacheLuceneIndexIndexReaderContext:(OrgApacheLuceneIndexIndexReaderContext *)arg0
withJavaUtilConcurrentExecutorService:(id<JavaUtilConcurrentExecutorService>)arg1 NS_UNAVAILABLE;
@end
J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher)
FOUNDATION_EXPORT void OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher_initWithOrgApacheLuceneIndexIndexReader_(OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher *self, OrgApacheLuceneIndexIndexReader *reader);
FOUNDATION_EXPORT OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher *new_OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher_initWithOrgApacheLuceneIndexIndexReader_(OrgApacheLuceneIndexIndexReader *reader) NS_RETURNS_RETAINED;
FOUNDATION_EXPORT OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher *create_OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher_initWithOrgApacheLuceneIndexIndexReader_(OrgApacheLuceneIndexIndexReader *reader);
J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher)
#endif
#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#pragma pop_macro("INCLUDE_ALL_OrgApacheLuceneSearchSuggestDocumentSuggestIndexSearcher")
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_connect_socket_w32_spawnv_61b.c
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-61b.tmpl.c
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: connect_socket Read data using a connect socket (client side)
* GoodSource: Fixed string
* Sinks: w32_spawnv
* BadSink : execute command with wspawnv
* Flow Variant: 61 Data flow: data returned from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define COMMAND_INT_PATH L"%WINDIR%\\system32\\cmd.exe"
#define COMMAND_INT L"cmd.exe"
#define COMMAND_ARG1 L"/c"
#define COMMAND_ARG2 L"dir"
#define COMMAND_ARG3 data
#else /* NOT _WIN32 */
#include <unistd.h>
#define COMMAND_INT_PATH L"/bin/sh"
#define COMMAND_INT L"sh"
#define COMMAND_ARG1 L"ls"
#define COMMAND_ARG2 L"-la"
#define COMMAND_ARG3 data
#endif
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#include <direct.h>
#pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */
#define CLOSE_SOCKET closesocket
#else /* NOT _WIN32 */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#define CLOSE_SOCKET close
#define SOCKET int
#endif
#define TCP_PORT 27015
#define IP_ADDRESS "127.0.0.1"
#include <process.h>
#ifndef OMITBAD
wchar_t * CWE78_OS_Command_Injection__wchar_t_connect_socket_w32_spawnv_61b_badSource(wchar_t * data)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
return data;
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B() uses the GoodSource with the BadSink */
wchar_t * CWE78_OS_Command_Injection__wchar_t_connect_socket_w32_spawnv_61b_goodG2BSource(wchar_t * data)
{
/* FIX: Append a fixed string to data (not user / external input) */
wcscat(data, L"*.*");
return data;
}
#endif /* OMITGOOD */
|
//
// HunterEdgeData.h
// HunterEdges
//
// Created by James Forkey on 8/9/13.
// Copyright (c) 2013. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface HunterEdgeData : NSObject
@property (strong) NSString *title;
@property (assign) float rating;
@property (strong) NSString *dateTime;
- (id)initWithTitle:(NSString*)title rating:(float)rating;
@end
|
/**
* FileMakerListSpy.h
*
* Created on: 2013/08/15
* Author: furukawayoshihiro
*/
#ifndef FILEMAKERLISTSPY_H_
#define FILEMAKERLISTSPY_H_
#include "FileMakerList.h"
class FileMakerListSpy: public FileMakerList {
private:
unsigned int numberOfCall_;
public:
FileMakerListSpy();
virtual ~FileMakerListSpy();
IClassFileMaker* getClassFileMaker();
IClassFileMaker* getTestClassFileMaker();
const int getNumberOfClassFileMaker();
const int getNumberOfTestClassFileMaker();
void destroyClassList();
void destroyTestClassList();
};
#endif /* FILEMAKERLISTSPY_H_ */
|
#include <check.h>
#include <stdio.h>
#include "../file-stream.h"
START_TEST (stdio_test);
{
int i;
stream_t *stdo = stdout_stream_new ();
stream_t *stde = stderr_stream_new ();
stream_t *stdi = stdin_stream_new ();
for (i = 0; i < 2; ++i)
{
if (stdo->write (stdo, "Testing stdout.\n") == EOF)
fail ("Failed testing stdout output.");
if (stdo->write (stde, "Testing stderr.\n") == EOF)
fail ("Failed testing stderr output.");
if (stdo->write (stdi, "Testing stdin.\n") != EOF)
fail ("Failed testing stdin output.");
if (stdo->read_line (stdo) != NULL)
fail ("Failed testing stdout input.");
if (stde->read_line (stde) != NULL)
fail ("Failed testing stderr input.");
/* These should have no effect. */
stdo->close (stdo);
stde->close (stde);
stdi->close (stdi);
}
stdo->destroy (stdo);
stde->destroy (stde);
stdi->destroy (stdi);
}
END_TEST
|
/*
* -------------------------------------------------------------------------------------------
* "THE MATE-WARE LICENSE" (Revision 42):
* Daniel Steuer <daniel.steuer@bingo-ev.de> schrieb diese Datei.
* Solange Sie diesen Vermerk nicht entfernen, können Sie mit dem Material machen,
* was Sie möchten. Wenn wir uns eines Tages treffen und Sie denken, das Material ist es wert,
* können Sie mir dafür eine Club-Mate ausgeben. Daniel Steuer
* -------------------------------------------------------------------------------------------
*/
#include <stdint.h>
#include "math.h"
#include "util.h"
// copy a fixed point number
void copyFpn( fpn_t src, fpn_t dest ) {
uint16_t i;
for( i=0; i<PRECISION; i++ ) {
dest[i] = src[i];
}
}
// convert number to fixed point number
error_e toFpn( uint16_t pre, uint16_t post, fpn_t out ) {
// this is only used by the testsuit -> no error handling
// basically we count the digits in the numbers handed to us
// and copy them into the array
uint16_t i, digits;
uint16_t buffer;
// zero out the output number first
for( i=0; i < PRECISION; i++ ) {
out[i] = 0;
}
// count digits in pre and post and split them into digits for copying
buffer = pre;
for( i=0; i<PRE_POINT_DIGITS; i++ ) {
out[(POST_POINT_DIGITS) +i] = buffer%10;
buffer /= 10;
}
if( buffer > 9 ) {
// no space left
return ERROR_OVERFLOW;
}
// count number of digits;
buffer = post;
digits=0;
while( buffer > 9 ) {
buffer /= 10;
digits++;
}
if( digits > POST_POINT_DIGITS-1 ) {
// no space left
return ERROR_OVERFLOW;
}
buffer = post;
for( i=(POST_POINT_DIGITS-1)-digits; i<POST_POINT_DIGITS; i++ ) {
out[i] = buffer%10;
buffer /= 10;
}
return OK;
}
// convert number to fixed point number
error_e toDFpn( uint16_t pre, uint16_t post, fpn_t out ) {
// this is only used by the testsuit -> no error handling
// basically we count the digits in the numbers handed to us
// and copy them into the array
uint16_t i, digits;
uint16_t buffer;
// zero out the output number first
for( i=0; i < DOUBLE_PRECISION; i++ ) {
out[i] = 0;
}
// count digits in pre and post
// and split them into digits for copying
buffer = pre;
for( i=0; i<PRE_POINT_DIGITS; i++ ) {
out[(DOUBLE_POST_POINT_DIGITS) +i] = buffer%10;
buffer /= 10;
}
if( buffer > 9 ) {
// no space left
return ERROR_OVERFLOW;
}
// count number of digits;
buffer = post;
digits=0;
while( buffer > 9 ) {
buffer /= 10;
digits++;
}
if( digits > DOUBLE_POST_POINT_DIGITS-1 ) {
// no space left
return ERROR_OVERFLOW;
}
buffer = post;
for( i=(DOUBLE_POST_POINT_DIGITS-1)-digits; i<DOUBLE_POST_POINT_DIGITS; i++ ) {
out[i] = buffer%10;
buffer /= 10;
}
return OK;
}
// compare two fixed point numbers
int8_t isLarger( fpn_t a, fpn_t b ) {
uint16_t i;
for( i=0; i<PRECISION; i++ ) {
if( a[(PRECISION-1) -i] > b[(PRECISION-1) -i]) {
return 1;
}
else if( a[(PRECISION-1) -i] < b[(PRECISION-1) -i]) {
return -1;
}
}
return 0; // numbers are equal
}
|
#ifndef dplyr_tools_RowwiseDataFrame_H
#define dplyr_tools_RowwiseDataFrame_H
#include <tools/SlicingIndex.h>
#include <dplyr/Result/RowwiseSubset.h>
#include <tools/SymbolString.h>
namespace dplyr {
class RowwiseDataFrame;
class RowwiseDataFrameIndexIterator {
public:
RowwiseDataFrameIndexIterator() : i(0) {}
RowwiseDataFrameIndexIterator& operator++() {
++i;
return *this;
}
RowwiseSlicingIndex operator*() const {
return RowwiseSlicingIndex(i);
}
int i;
};
class RowwiseDataFrame {
public:
typedef RowwiseDataFrameIndexIterator group_iterator;
typedef RowwiseSlicingIndex slicing_index;
typedef RowwiseSubset subset;
RowwiseDataFrame(SEXP x):
data_(x),
group_sizes()
{
group_sizes = rep(1, data_.nrows());
}
group_iterator group_begin() const {
return RowwiseDataFrameIndexIterator();
}
DataFrame& data() {
return data_;
}
const DataFrame& data() const {
return data_;
}
inline int ngroups() const {
return group_sizes.size();
}
inline int nvars() const {
return 0;
}
inline SymbolString symbol(int) {
stop("Rowwise data frames don't have grouping variables");
}
inline SEXP label(int) {
return R_NilValue;
}
inline int nrows() const {
return data_.nrows();
}
inline int max_group_size() const {
return 1;
}
inline subset* create_subset(SEXP x) const {
return rowwise_subset(x);
}
private:
DataFrame data_;
IntegerVector group_sizes;
};
}
namespace Rcpp {
using namespace dplyr;
template <>
inline bool is<RowwiseDataFrame>(SEXP x) {
return Rf_inherits(x, "rowwise_df");
}
}
#endif
|
/* $Id: util.c,v 1.1.1.1 2004/12/23 04:04:05 ellson Exp $ $Revision: 1.1.1.1 $ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#include <assert.h>
#include <pathutil.h>
#include <stdlib.h>
#ifdef DMALLOC
#include "dmalloc.h"
#endif
Ppoly_t copypoly(Ppoly_t argpoly)
{
Ppoly_t rv;
int i;
rv.pn = argpoly.pn;
rv.ps = malloc(sizeof(Ppoint_t) * argpoly.pn);
for (i = 0; i < argpoly.pn; i++)
rv.ps[i] = argpoly.ps[i];
return rv;
}
void freepoly(Ppoly_t argpoly)
{
free(argpoly.ps);
}
int Ppolybarriers(Ppoly_t ** polys, int npolys, Pedge_t ** barriers,
int *n_barriers)
{
Ppoly_t pp;
int i, j, k, n, b;
Pedge_t *bar;
n = 0;
for (i = 0; i < npolys; i++)
n = n + polys[i]->pn;
bar = malloc(n * sizeof(Pedge_t));
b = 0;
for (i = 0; i < npolys; i++) {
pp = *polys[i];
for (j = 0; j < pp.pn; j++) {
k = j + 1;
if (k >= pp.pn)
k = 0;
bar[b].a = pp.ps[j];
bar[b].b = pp.ps[k];
b++;
}
}
assert(b == n);
*barriers = bar;
*n_barriers = n;
return 1;
}
|
void getcolor(void);
void newcolor(char *);
void setcolor(void);
|
/*
VisionSVC_impl.h
Copyright (c) 2011 AIST All Rights Reserved.
Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html)
*/
// -*-C++-*-
/*!
* @file VisionSVC_impl.h
* @brief Service implementation header of Vision.idl
*
*/
#include "BasicDataTypeSkel.h"
#include "ImgSkel.h"
#include "VisionSkel.h"
#include <cv.h>
#ifndef VISIONSVC_IMPL_H
#define VISIONSVC_IMPL_H
/*!
* @class CameraCaptureServiceSVC_impl
* Example class implementing IDL interface Img::CameraCaptureService
*/
class CameraCaptureServiceSVC_impl
: public virtual POA_Img::CameraCaptureService,
public virtual PortableServer::RefCountServantBase
{
private:
// Make sure all instances are built on the heap by making the
// destructor non-public
//virtual ~CameraCaptureServiceSVC_impl();
public:
/*!
* @brief standard constructor
*/
CameraCaptureServiceSVC_impl();
/*!
* @brief destructor
*/
virtual ~CameraCaptureServiceSVC_impl();
// attributes and operations
void take_one_frame();
};
struct CameraParameter
{
cv::Mat intr;
cv::Mat dist;
cv::Mat ext;
};
/*!
* @class Reconstruct3DServiceSVC_impl
* Example class implementing IDL interface Reconstruct3DService
*/
class Reconstruct3DServiceSVC_impl
: public virtual POA_Reconstruct3DService,
public virtual PortableServer::RefCountServantBase
{
private:
// Make sure all instances are built on the heap by making the
// destructor non-public
//virtual ~Reconstruct3DServiceSVC_impl();
std::vector<CameraParameter> m_params;
// 画像データを送信するかどうかのフラグ。
bool* m_readySendImageFlag;
// 画像データの読み込みバッファ
TimedStereo3D* m_stereo3DData;
// 読み込む画像の枚数
int m_readImageNum;
// 出力する点群数
int m_outputPointNum;
// 出力するエラーコード
std::string m_errorCode;
// キャリブレーションファイル名
std::string m_calibFilename;
// 入力画像ファイル名 0
std::string m_imageFilename0;
// 入力画像ファイル名 1
std::string m_imageFilename1;
// 入力画像ファイル名 2
std::string m_imageFilename2;
// 画像ファイルの読み込み
int loadImage();
// キャリブレーションデータの読み込み
int loadCalibrationData(char* path);
int loadCalibrationDataByOpenCV(char* path);
int loadMultiCalibData(char *path);
void copy_camera_params(Img::CameraImage* dst, const CameraParameter& param);
public:
/*!
* @brief standard constructor
*/
Reconstruct3DServiceSVC_impl();
/*!
* @brief destructor
*/
virtual ~Reconstruct3DServiceSVC_impl();
// attributes and operations
void reconstruct();
// 画像データを送信するかどうかのフラグをセットする。
void setSendImageFlag(bool* flag);
// TimedStereo3D 構造体をセットする。
void setStereo3DData(TimedStereo3D* data);
#if 0
// 読み込んだ画像データを返す。
TimedStereo3D* getStereo3DData();
#endif
// 読み込む画像枚数をセットする。
void setReadImageNum(int num);
// 出力点群数をセットする。
void setOutputPointNum(int num);
// 出力エラーコードをセットする。
void setErrorCode(std::string& code);
// キャリブレーションファイル名をセットする。
void setCalibFilename(std::string& code);
// 画像ファイル名をセットする。
void setImageFilename(std::string& fn0, std::string& fn1, std::string& fn2);
};
/*!
* @class RecognitionServiceSVC_impl
* Example class implementing IDL interface RecognitionService
*/
class RecognitionServiceSVC_impl
: public virtual POA_RecognitionService,
public virtual PortableServer::RefCountServantBase
{
private:
// Make sure all instances are built on the heap by making the
// destructor non-public
//virtual ~RecognitionServiceSVC_impl();
public:
/*!
* @brief standard constructor
*/
RecognitionServiceSVC_impl();
/*!
* @brief destructor
*/
virtual ~RecognitionServiceSVC_impl();
// attributes and operations
CORBA::Long getModelID();
void setModelID(CORBA::Long ModelID);
};
/*!
* @class RecognitionResultViewerServiceSVC_impl
* Example class implementing IDL interface RecognitionResultViewerService
*/
class RecognitionResultViewerServiceSVC_impl
: public virtual POA_RecognitionResultViewerService,
public virtual PortableServer::RefCountServantBase
{
private:
// Make sure all instances are built on the heap by making the
// destructor non-public
//virtual ~RecognitionResultViewerServiceSVC_impl();
public:
/*!
* @brief standard constructor
*/
RecognitionResultViewerServiceSVC_impl();
/*!
* @brief destructor
*/
virtual ~RecognitionResultViewerServiceSVC_impl();
// attributes and operations
void display(const Img::TimedMultiCameraImage& frame, TimedRecognitionResult pos);
};
#endif // VISIONSVC_IMPL_H
|
/*
* Copyright (C) 2010 The Paparazzi Team
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "imu_analog.h"
#include "mcu_periph/adc.h"
#include "mcu_periph/uart.h"
volatile bool_t analog_imu_available;
int imu_overrun;
static struct adc_buf analog_imu_adc_buf[NB_ANALOG_IMU_ADC];
void imu_impl_init(void) {
analog_imu_available = FALSE;
imu_overrun = 0;
adc_buf_channel(ADC_CHANNEL_GYRO_P, &analog_imu_adc_buf[0], ADC_CHANNEL_GYRO_NB_SAMPLES);
adc_buf_channel(ADC_CHANNEL_GYRO_Q, &analog_imu_adc_buf[1], ADC_CHANNEL_GYRO_NB_SAMPLES);
adc_buf_channel(ADC_CHANNEL_GYRO_R, &analog_imu_adc_buf[2], ADC_CHANNEL_GYRO_NB_SAMPLES);
adc_buf_channel(ADC_CHANNEL_ACCEL_X, &analog_imu_adc_buf[3], ADC_CHANNEL_ACCEL_NB_SAMPLES);
adc_buf_channel(ADC_CHANNEL_ACCEL_Y, &analog_imu_adc_buf[4], ADC_CHANNEL_ACCEL_NB_SAMPLES);
adc_buf_channel(ADC_CHANNEL_ACCEL_Z, &analog_imu_adc_buf[5], ADC_CHANNEL_ACCEL_NB_SAMPLES);
}
void imu_periodic(void) {
// Actual Nr of ADC measurements per channel per periodic loop
static int last_head = 0;
imu_overrun = analog_imu_adc_buf[0].head - last_head;
if (imu_overrun < 0)
imu_overrun += ADC_CHANNEL_GYRO_NB_SAMPLES;
last_head = analog_imu_adc_buf[0].head;
// Read All Measurements
imu.gyro_unscaled.p = analog_imu_adc_buf[0].sum / ADC_CHANNEL_GYRO_NB_SAMPLES;
imu.gyro_unscaled.q = analog_imu_adc_buf[1].sum / ADC_CHANNEL_GYRO_NB_SAMPLES;
imu.gyro_unscaled.r = analog_imu_adc_buf[2].sum / ADC_CHANNEL_GYRO_NB_SAMPLES;
imu.accel_unscaled.x = analog_imu_adc_buf[3].sum / ADC_CHANNEL_ACCEL_NB_SAMPLES;
imu.accel_unscaled.y = analog_imu_adc_buf[4].sum / ADC_CHANNEL_ACCEL_NB_SAMPLES;
imu.accel_unscaled.z = analog_imu_adc_buf[5].sum / ADC_CHANNEL_ACCEL_NB_SAMPLES;
analog_imu_available = TRUE;
}
|
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
|
/* myShape.h Copyright (c) 2003 by T. HAYASHI and K. KATO */
/* All rights reserved */
#include <math.h>
#define PI2 2.0*3.1415926534
void myCircle( float r, int n )
{
float x, y, z, dq;
int i;
dq = PI2/(float)n;
glPushMatrix();
y = 0.0;
glBegin( GL_LINE_LOOP );
for( i=0; i< n; i++ ){
x = r*cos( dq*(float)i );
z = r*sin( dq*(float)i );
glVertex3f( x, y, z);
}
glEnd();
glPopMatrix();
}
void myDisc( float r, int n )
{
float x, y, z, dq;
int i;
glEnable( GL_NORMALIZE );
dq = PI2/(float)n;
glPushMatrix();
y = 0.0;
glBegin( GL_POLYGON );
glNormal3f( 0.0, 1.0, 0.0 );
for( i=0; i<n; i+=1 ){
x = r*cos( dq*(float)i );
z = r*sin( dq*(float)i );
glVertex3f( x, y, z );
}
glEnd();
glPopMatrix();
glDisable( GL_NORMALIZE );
}
void mySolidCylinder( float r, float h, int n )
{
float x, y, z, dq;
int i;
glEnable( GL_NORMALIZE );
dq = PI2/(float)n;
y = 0.5*h;
glPushMatrix();
glRotatef( -dq*180.0/PI2, 0.0, 0.1, 0.0 );
glBegin( GL_QUAD_STRIP );
for( i=0; i<=n; i+=1 ){
x = r*cos( dq*(float)i );
z = r*sin( dq*(float)i );
glNormal3f( x, 0, z );
glVertex3f( x, y, z );
glVertex3f( x, -y, z );
}
glEnd();
glBegin( GL_POLYGON );
glNormal3f( 0.0, -1.0, 0.0 );
for( i=0; i<n; i+=1 ){
x = r*cos( dq*(float)i );
z = r*sin( dq*(float)i );
glVertex3f( x, -y, z );
}
glEnd();
glBegin( GL_POLYGON );
glNormal3f( 0.0, 1.0, 0.0 );
for( i=0; i<n; i+=1 ){
x = r*cos( dq*(float)i );
z = r*sin( dq*(float)i );
glVertex3f( x, y, z );
}
glEnd();
glPopMatrix();
glDisable( GL_NORMALIZE );
}
void myWireCylinder( float r, float h, int n )
{
float x, y, z, dq;
int i;
dq = PI2/(float)n;
y = 0.5*h;
glPushMatrix();
glRotatef( -dq*180.0/PI2, 0.0, 1.0, 0.0 );
glBegin( GL_LINES );
for( i=0; i< n; i++ ){
x = r*cos( dq*(float)i );
z = r*sin( dq*(float)i );
glVertex3f( x, y, z);
glVertex3f( x, -y, z );
}
glEnd();
glBegin( GL_LINE_LOOP );
for( i=0; i< n; i++ ){
x = r*cos( dq*(float)i );
z = r*sin( dq*(float)i );
glVertex3f( x, y, z);
}
glEnd();
glBegin( GL_LINE_LOOP );
for( i=0; i< n; i++ ){
x = r*cos( dq*(float)i );
z = r*sin( dq*(float)i );
glVertex3f( x, -y, z);
}
glEnd();
glPopMatrix();
}
|
/*
* gbversion.h is generated from gbversion.h.in which uses autoconf voodoo
* to get the version number from configure.in.
*
* Isn't simplification via automation grand?
*/
#define VERSION "1.4.2"
#define WEB_DOC_DIR "http://www.gpsbabel.org/htmldoc-1.4.2"
|
/****************************************************************************
**
** This file is part of the Qtopia Opensource Edition Package.
**
** Copyright (C) 2008 Trolltech ASA.
**
** Contact: Qt Extended Information (info@qtextended.org)
**
** This file may be used under the terms of the GNU General Public License
** versions 2.0 as published by the Free Software Foundation and appearing
** in the file LICENSE.GPL included in the packaging of this file.
**
** Please review the following information to ensure GNU General Public
** Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html.
**
**
****************************************************************************/
#ifndef LANPLUGIN_H
#define LANPLUGIN_H
#include <qtopianetworkinterface.h>
#include <qtopiaglobal.h>
#include <QList>
#include <QPointer>
#include "lan.h"
class QTOPIA_PLUGIN_EXPORT LanPlugin : public QtopiaNetworkPlugin
{
public:
LanPlugin();
virtual ~LanPlugin();
virtual QPointer<QtopiaNetworkInterface> network( const QString& confFile);
virtual QtopiaNetwork::Type type() const;
virtual QByteArray customID() const;
private:
QList<QPointer<QtopiaNetworkInterface> > instances;
};
#endif //LANPLUGIN_H
|
/*=============================================================================
# FileName: graph.h
# Desc:
# Author: jlpeng
# Email: jlpeng1201@gmail.com
# HomePage:
# Created: 2013-04-02 16:07:56
# LastChange: 2013-05-09 04:06:06
# History:
=============================================================================*/
#ifndef GRAPH_H
#define GRAPH_H
#include <iostream>
#include <vector>
#include <utility>
#include <cassert>
// upper triangle square matrix with diagonal elements kept
class MCSMatrix
{
public:
MCSMatrix():_m(0),_nnode(0) {}
explicit MCSMatrix(int n);
MCSMatrix(const MCSMatrix &m);
~MCSMatrix();
// to expand the matrix. 'n' must be >= '_nnode'
// newly elements will be set to 'v'
void expand(int n, int v=0);
// if this->_nnode==0, allocate memory first!!
// otherwise, this->_nnode must be equal to m.numNodes()
MCSMatrix &operator=(const MCSMatrix &m);
const int &operator()(int i, int j) const;
int &operator()(int i, int j);
int numNodes() const {return _nnode;}
void display(std::ostream &fout, const char *sep) const;
private:
int getIndex(int i, int j) const;
int *_m; // of length n*(n+1)/2
int _nnode;
};
class MCSGraph
{
public:
explicit MCSGraph(const std::vector<int> &vertex)
:_vertex(vertex),_m(static_cast<int>(_vertex.size()))
{}
MCSGraph(const std::vector<int> &vertex, const MCSMatrix &m)
:_vertex(vertex),_m(m)
{}
MCSGraph(const int vertex[], int n): _vertex(vertex,vertex+n),_m(n) {}
~MCSGraph() {};
// get edge
const int &operator()(int i, int j) const {return _m(i,j);}
int &operator()(int i, int j) {return _m(i,j);}
// if two nodes are connected
bool connect(int i, int j) const; // false if (i,j)==0 or i==j
// number of nodes
int numNodes() const {return _m.numNodes();}
// get node labels
const std::vector<int> &getNodeLabels() const {return _vertex;}
std::vector<int> &getNodeLabels() {return _vertex;}
// get node i's label
const int &getNodeLabelOf(int i) const;
int &getNodeLabelOf(int i);
// display nodes and edges
void display(std::ostream &fout, const char *sep) const;
// get neighbors
std::vector<int> getNborsOf(int i) const;
private:
std::vector<int> _vertex; // vector of vertexes
MCSMatrix _m;
};
// for association graph
class AssocGraph
{
public:
// Parameter:
// - nodeOfAG: to determine the node value(weight) of association graph
// default:
// 1.0 - g1->getNodeLabelOf(i1)==g2->getNodeLabelOf(i2)
// 0.0 - otherwise
// if 'nodeOfAG' returns 0, the corresponding node will not be created.
// - edge_type: the way to make edge <default: 1>
// 1 - e(1i2i,1j2j) equals to 1 if it satisfies one of following conditions:
// 1) connect(1i,1j)==true and connect(2i,2j)==true
// 2) connect(1i,1j)==false and connect(2i,2j)==false
// 2 - e(1i2i,1j2j) equals to 1 if it satisfies that
// "connect(1i,1j)==true and connect(2i,2j)==true"
AssocGraph(const MCSGraph *g1, const MCSGraph *g2,
float (*nodeOfAG)(const MCSGraph *g1, int i1, const MCSGraph *g2, int i2)=NULL,
int edge_type=1);
const std::vector<std::pair<int,int> > &getPairIndices() const {return _indices;}
std::vector<std::pair<int,int> > &getPairIndices() {return _indices;}
// get corresponding indices of 'g1' and 'g2'
const std::pair<int,int> &toGraphIndex(int i) const {assert(i<_node.size());return _indices[i];}
std::pair<int,int> &toGraphIndex(int i) {assert(i<_node.size());return _indices[i];}
std::pair<std::vector<int>,std::vector<int> > toGraphIndices(const std::vector<int> &index) const;
// graph pair index ==> index of AG
int toAGIndex(int i, int j) const;
std::vector<int> toAGIndex(const std::vector<int> &index_i, const std::vector<int> &index_j) const;
// matrix
const MCSMatrix &getMatrix() const {return _m;}
MCSMatrix &getMatrix() {return _m;}
// node values
const std::vector<float> getNodeValues() const {return _node;}
std::vector<float> getNodeValues() {return _node;}
float getNodeValueOf(int i) const {return _node[i];}
// return nbors
std::vector<int> getNborsOf(int i) const;
private:
std::vector<float> _node; // node values
std::vector<std::pair<int,int> > _indices; // original graphs' indices
MCSMatrix _m;
};
/*
// OBJ: to create a association graph from two graphs.
// connect: used to determine the edge(1 or 0) of association graph
// if NULL, using member function 'connect' of MCSGraph
// e(1i2i,1j2j)=1 if only if it follows one of two conditions:
// 1) connect(1i,1j)=true and connect(2i,2j)=true
// 2) connect(1i,2j)=false and connect(2i,2j)=false
// However, if 1i==1j or 2i==2j, here we let e(1i2i,1j2j) be 0!
MCSMatrix *makeAG(const MCSGraph &g1, const MCSGraph &g2,
bool (*connect)(const MCSGraph &g, int i, int j)=NULL);
// OBJ: convert index of an association graph to indices of graphs.
// suppose that the association graph was constructed from 'makeAG'.
// Parameter
// - nnodes2: number of nodes of graph 'g2'
// - agindex: index of a association graph
// - i,j: index of graph 1 and 2, respectively
void AGIndex2GraphIndex(int nnodes2, int agindex, int *i, int *j);
*/
#endif /* ----- #ifndef GRAPH_H ----- */
|
/*
* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
*
* 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 THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR 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.
*/
/*
* Airgo Networks, Inc proprietary. All rights reserved.
*
* Author: Sandesh Goel
* Date: 02/25/02
* History:-
* Date Modified by Modification Information
* --------------------------------------------------------------------
*
*/
#ifndef __UTILS_GLOBAL_H__
#define __UTILS_GLOBAL_H__
#include "sirParams.h"
/*
* Current debug and event log level
*/
#define LOG_FIRST_MODULE_ID SIR_FIRST_MODULE_ID
#define LOG_LAST_MODULE_ID SIR_LAST_MODULE_ID
#define LOG_ENTRY_NUM (LOG_LAST_MODULE_ID - LOG_FIRST_MODULE_ID + 1)
typedef struct sAniSirUtils
{
tANI_U32 gLogEvtLevel[LOG_ENTRY_NUM];
tANI_U32 gLogDbgLevel[LOG_ENTRY_NUM];
} tAniSirUtils, *tpAniSirUtils;
#endif
|
#include <stdlib.h>
#include <stdio.h>
void endian_swap16bit(unsigned short* x)
{
*x = (*x>>8) |
(*x<<8);
}
void endian_swap32bit(unsigned int* x)
{
*x = (*x>>24) |
((*x<<8) & 0x00FF0000) |
((*x>>8) & 0x0000FF00) |
(*x<<24);
}
void endian_swap64bit(unsigned long long* x)
{
*x = (*x>>56) |
((*x<<40) & 0x00FF000000000000ULL) |
((*x<<24) & 0x0000FF0000000000ULL) |
((*x<<8) & 0x000000FF00000000ULL) |
((*x>>8) & 0x00000000FF000000) |
((*x>>24) & 0x0000000000FF0000) |
((*x>>40) & 0x000000000000FF00) |
(*x<<56);
}
unsigned int endian_swap16(unsigned short x)
{
return (x>>8) |
(x<<8);
}
unsigned int endian_swap32(unsigned int x)
{
return (x>>24) |
((x<<8) & 0x00FF0000) |
((x>>8) & 0x0000FF00) |
(x<<24);
}
unsigned long long endian_swap64(unsigned long long x)
{
return (x>>56) |
((x<<40) & 0x00FF000000000000ULL) |
((x<<24) & 0x0000FF0000000000ULL) |
((x<<8) & 0x000000FF00000000ULL) |
((x>>8) & 0x00000000FF000000) |
((x>>24) & 0x0000000000FF0000) |
((x>>40) & 0x000000000000FF00) |
(x<<56);
}
int main(int argc, char** argv)
{
if (argc != 2) {
printf("args error");
return -1;
}
unsigned short num16 = atoi(argv[1]);
unsigned int num32 = num16;
unsigned long long num64 = num32;
printf("16bit - Num: %u, Hex: %04X\n", num16, num16);
printf("32bit - Num: %u, Hex: %08X\n", num32, num32);
printf("64bit - Num: %llu , ", num64);
printf("Hex: %016llX\n", num64);
unsigned short tmpnum16 = 0;
unsigned int tmpnum32 = 0;
unsigned long long tmpnum64 = 0;
tmpnum16 = endian_swap16(num16);
tmpnum32 = endian_swap32(num32);
tmpnum64 = endian_swap64(num64);
endian_swap16bit(&num16);
endian_swap32bit(&num32);
endian_swap64bit(&num64);
printf("16bit - Num: %u, Hex: %04X\n", num16, num16);
printf("32bit - Num: %u, Hex: %08X\n", num32, num32);
printf("64bit - Num: %llu, Hex: %016llX\n", num64, num64);
printf("16bit - Num: %u, Hex: %04X\n", tmpnum16, tmpnum16);
printf("32bit - Num: %u, Hex: %08X\n", tmpnum32, tmpnum32);
printf("64bit - Num: %llu, Hex: %016llX\n", tmpnum64, tmpnum64);
return 0;
}
|
#ifndef WEB_DOWNLOAD
#define WEB_DOWNLOAD
#include <string>
#include <curl/curl.h>
#include <map>
namespace hh_pc{
class DownloadUrl{
private:
CURL *curl;
CURLcode res;
//string content;
public:
DownloadUrl();
std::string download(const std::string &url);
static size_t getUrlResponse(char *ptr, size_t size, size_t nmemb, std::string *stream);
~DownloadUrl();
};
}
#endif
|
#ifndef LIST_H
#define LIST_H
#define New(a) (a*)malloc(sizeof(a))
#define New2(a,n) (a*)malloc(sizeof(a)*n)
#ifdef __cplusplus
extern "C"{
#endif
#include<stdlib.h>
#include<stdio.h>
typedef void (*nodeprint)(void* data);
typedef void (*nodefree)(void* _this);
typedef int (*nodeequal)(void* a,void* b);
typedef struct _Node{
struct _Node* next;
struct _Node* previous;
void* data;
}Node;
typedef struct {
Node* start;
Node* end;
int count;
}List;
Node* node_new(void* data);
void node_free(Node* _this,nodefree freefunc);
List* list_new();
void list_free(List* _this,nodefree freefunc);
void list_push(List* _this,Node* newnode);
int list_insert(List* _this,Node* newnode,int position);
Node* list_delete(List* _this,int position);
void list_print(List* _this,nodeprint printfunc);
#ifdef __cplusplus
}
#endif
#endif
|
// treeprint.c
#include "tree.h"
static void TreeNode_print(TreeNode *tn)
{
printf("%d ",tn -> value);
}
static void Tree_printPreorder(TreeNode *tn)
{
if (tn == NULL)
{
return;
}
TreeNode_print(tn);
Tree_printPreorder(tn -> left);
Tree_printPreorder(tn -> right);
}
static void Tree_printInorder(TreeNode *tn)
{
if (tn == NULL)
{
return;
}
Tree_printInorder(tn -> left);
TreeNode_print(tn);
Tree_printInorder(tn -> right);
}
static void Tree_printPostorder(TreeNode *tn)
{
if (tn == NULL)
{
return;
}
Tree_printPostorder(tn -> left);
Tree_printPostorder(tn -> right);
TreeNode_print(tn);
}
void Tree_print(TreeNode *tn)
{
printf("\n\n=====Preorder=====\n");
Tree_printPreorder(tn);
printf("\n\n=====Inorder=====\n");
Tree_printInorder(tn);
printf("\n\n=====Postorder=====\n");
Tree_printPostorder(tn);
printf("\n\n");
}
|
/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef _1080TO540_H
#define _1080TO540_H
#include "overlayframe.inc"
#include "pluginvclient.h"
class _1080to540Main;
class _1080to540Option;
class _1080to540Window : public BC_Window
{
public:
_1080to540Window(_1080to540Main *client, int x, int y);
~_1080to540Window();
void create_objects();
int close_event();
int set_first_field(int first_field, int send_event);
_1080to540Main *client;
_1080to540Option *odd_first;
_1080to540Option *even_first;
};
class _1080to540Option : public BC_Radial
{
public:
_1080to540Option(_1080to540Main *client,
_1080to540Window *window,
int output,
int x,
int y,
char *text);
int handle_event();
_1080to540Main *client;
_1080to540Window *window;
int output;
};
class _1080to540Config
{
public:
_1080to540Config();
int equivalent(_1080to540Config &that);
void copy_from(_1080to540Config &that);
void interpolate(_1080to540Config &prev,
_1080to540Config &next,
long prev_frame,
long next_frame,
long current_frame);
int first_field;
};
class _1080to540Main : public PluginVClient
{
public:
_1080to540Main(PluginServer *server);
~_1080to540Main();
PLUGIN_CLASS_MEMBERS(_1080to540Config)
// required for all realtime plugins
int process_realtime(VFrame *input, VFrame *output);
int is_realtime();
void update_gui();
void save_data(KeyFrame *keyframe);
void read_data(KeyFrame *keyframe);
void reduce_field(VFrame *output, VFrame *input, int src_field, int dst_field);
VFrame *temp;
};
#endif
|
// Aseprite
// Copyright (C) 2001-2017 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_UI_EDITOR_CUSTOMIZATION_DELEGATE_H_INCLUDED
#define APP_UI_EDITOR_CUSTOMIZATION_DELEGATE_H_INCLUDED
#pragma once
#include "app/ui/keyboard_shortcuts.h"
namespace tools {
class Tool;
}
namespace app {
class Editor;
class FrameTagProvider;
class EditorCustomizationDelegate {
public:
virtual ~EditorCustomizationDelegate() { }
virtual void dispose() = 0;
// Called to know if the user is pressing a keyboard shortcut to
// select another tool temporarily (a "quick tool"). The given
// "currentTool" is the current tool selected in the toolbox.
virtual tools::Tool* getQuickTool(tools::Tool* currentTool) = 0;
// Returns what action is pressed at this moment.
virtual KeyAction getPressedKeyAction(KeyContext context) = 0;
// Returns the provider of active frame tag (it's the timeline).
virtual FrameTagProvider* getFrameTagProvider() = 0;
};
} // namespace app
#endif // APP_UI_EDITOR_CUSTOMIZATION_DELEGATE_H_INCLUDED
|
//@
//@ Dklab Realplexor: Comet server which handles 1000000+ parallel browser connections
//@ Author: Dmitry Koterov, dkLab (C)
//@ GitHub: http://github.com/DmitryKoterov/
//@ Homepage: http://dklab.ru/lib/dklab_realplexor/
//@
//@ ATTENTION: Java-style C++ programming below. :-)
//@
//@ This is a line-by-line C++ rewrite of Perl prototype code with obvious speed
//@ optimizations (like avoiding excess copies, config pre-parsing etc.).
//@
//@ The code is so compact (2600 lines) and so simple, that I decided not to
//@ split it into *.hpp & *.cpp files nor create Makefiles, but place
//@ everything into included *.h files (like Perl, Java, C# and most of other
//@ languages do). It is not quite common for C++, but it surely simple
//@ when a program is small (especially when it is rewritten line by line
//@ from another language).
//@
//@ Also the code has global variables within the top namespace: one variable
//@ per Storage and one CONFIG, they are like singletons.
//@
#ifndef UTILS_SOCKET_H
#define UTILS_SOCKET_H
//
// Simple socket wrapper class.
//
class Socket
{
int fh;
string addr;
Socket(int fh): fh(fh) {}
Socket(const Socket& s);
Socket& operator=(const Socket& s);
public:
// Creates a listening socket.
Socket(string localAddr): addr(localAddr)
{
auto parts = split(":", localAddr);
if (parts.size() < 2) die("Address may be in form of \"host:port\", \"" + localAddr + "\" given");
fh = socket(AF_INET, SOCK_STREAM, 0);
if (fh < 0) die("ERROR calling socket(): $!");
// Avoid "address already in use" message at bind() stage.
int opt = 1;
setsockopt(fh, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
struct sockaddr_in serv_addr;
memset(&serv_addr, 0, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = inet_addr(parts[0].c_str());
serv_addr.sin_port = htons(lexical_cast<int>(parts[1]));
if (::bind(fh, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) {
die("ERROR calling bind(): $!");
}
listen(fh, 50000);
}
// Creates an accepted socket.
Socket(int fh, const string& addr): fh(fh), addr(addr)
{
}
virtual ~Socket()
{
close(fh);
}
int fileno()
{
return fh;
}
string peeraddr()
{
return addr;
}
void blocking(bool block)
{
int flags = fcntl(fh, F_GETFL, 0);
fcntl(fh, F_SETFL, block? (flags & (~O_NONBLOCK)) : (flags | O_NONBLOCK));
}
std::shared_ptr<Socket> accept()
{
struct sockaddr_in cli_addr;
socklen_t clilen = sizeof(cli_addr);
int newsockfd = ::accept(fh, (struct sockaddr *) &cli_addr, &clilen);
if (newsockfd < 0) {
die("ERROR calling accept(): $!");
}
return std::shared_ptr<Socket>(new Socket(newsockfd, string(inet_ntoa(cli_addr.sin_addr)) + ":" + lexical_cast<string>(cli_addr.sin_port)));
}
// Appends read data to the end of the string.
// Returns the number of read bytes.
size_t recv_and_append_to(string& s)
{
size_t nread = 0;
while (true) {
char buf[1024 * 32];
int n = ::read(fh, buf, sizeof(buf));
if (n < 0) {
die("ERROR calling read(): $!");
}
s.append(buf, n);
nread += n;
if (n < (int)sizeof(buf)) break;
}
return nread;
}
// Returns:
// - 1 if the operation succeeded
// - 0 if nothing was sent
// - -1 in case of an error
int send(const char* buf, size_t len)
{
while (true) {
int n = ::write(fh, buf, len);
if (n < 0) return -1;
if (n == (int)len) return 1;
len -= n;
buf += n;
}
}
int send(const string& s)
{
return send(s.c_str(), s.length());
}
// Returns 0 on error, 1 on success.
int shutdown(int how)
{
return ::shutdown(fh, how) < 0? 0 : 1;
}
};
#endif
|
/*
* Card-specific functions for the Siano SMS1xxx USB dongle
*
* Copyright (c) 2008 Michael Krufky <mkrufky@linuxtv.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __SMS_CARDS_H__
#define __SMS_CARDS_H__
#include <linux/usb.h>
#include <linux/module.h>
#include "smscoreapi.h"
#include "smsir.h"
#define SMS_BOARD_UNKNOWN 0
#define SMS1XXX_BOARD_SIANO_STELLAR 1
#define SMS1XXX_BOARD_SIANO_NOVA_A 2
#define SMS1XXX_BOARD_SIANO_NOVA_B 3
#define SMS1XXX_BOARD_SIANO_VEGA 4
#define SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT 5
#define SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A 6
#define SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B 7
#define SMS1XXX_BOARD_HAUPPAUGE_WINDHAM 8
#define SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD 9
#define SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2 10
#define SMS1XXX_BOARD_SIANO_NICE 11
#define SMS1XXX_BOARD_SIANO_VENICE 12
#define SMS1XXX_BOARD_SIANO_STELLAR_ROM 13
#define SMS1XXX_BOARD_ZTE_DVB_DATA_CARD 14
#define SMS1XXX_BOARD_ONDA_MDTV_DATA_CARD 15
#define SMS1XXX_BOARD_SIANO_MING 16
#define SMS1XXX_BOARD_SIANO_PELE 17
#define SMS1XXX_BOARD_SIANO_RIO 18
#define SMS1XXX_BOARD_SIANO_DENVER_1530 19
#define SMS1XXX_BOARD_SIANO_DENVER_2160 20
struct sms_board_gpio_cfg {
int lna_vhf_exist;
int lna_vhf_ctrl;
int lna_uhf_exist;
int lna_uhf_ctrl;
int lna_uhf_d_ctrl;
int lna_sband_exist;
int lna_sband_ctrl;
int lna_sband_d_ctrl;
int foreign_lna0_ctrl;
int foreign_lna1_ctrl;
int foreign_lna2_ctrl;
int rf_switch_vhf;
int rf_switch_uhf;
int rf_switch_sband;
int leds_power;
int led0;
int led1;
int led2;
int led3;
int led4;
int ir;
int eeprom_wp;
int mrc_sense;
int mrc_pdn_resetn;
int mrc_gp0; /* mrcs spi int */
int mrc_gp1;
int mrc_gp2;
int mrc_gp3;
int mrc_gp4;
int host_spi_gsp_ts_int;
};
struct sms_board {
enum sms_device_type_st type;
char *name, *fw[DEVICE_MODE_MAX];
struct sms_board_gpio_cfg board_cfg;
enum ir_kb_type ir_kb_type;
char intf_num;
int default_mode;
unsigned int mtu;
unsigned int crystal;
struct sms_antenna_config_ST *antenna_config;
};
struct sms_board *sms_get_board(int id);
extern struct usb_device_id smsusb_id_table[];
extern struct smscore_device_t *coredev;
enum SMS_BOARD_EVENTS {
BOARD_EVENT_POWER_INIT,
BOARD_EVENT_POWER_SUSPEND,
BOARD_EVENT_POWER_RESUME,
BOARD_EVENT_BIND,
BOARD_EVENT_SCAN_PROG,
BOARD_EVENT_SCAN_COMP,
BOARD_EVENT_EMERGENCY_WARNING_SIGNAL,
BOARD_EVENT_FE_LOCK,
BOARD_EVENT_FE_UNLOCK,
BOARD_EVENT_DEMOD_LOCK,
BOARD_EVENT_DEMOD_UNLOCK,
BOARD_EVENT_RECEPTION_MAX_4,
BOARD_EVENT_RECEPTION_3,
BOARD_EVENT_RECEPTION_2,
BOARD_EVENT_RECEPTION_1,
BOARD_EVENT_RECEPTION_LOST_0,
BOARD_EVENT_MULTIPLEX_OK,
BOARD_EVENT_MULTIPLEX_ERRORS
};
int sms_board_event(struct smscore_device_t *coredev, enum SMS_BOARD_EVENTS gevent);
#endif /* __SMS_CARDS_H__ */
|
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* cedit-spell-checker-dialog.h
* This file is part of cedit
*
* Copyright (C) 2002 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the cedit Team, 2002. See the AUTHORS file for a
* list of people on the cedit Team.
* See the ChangeLog files for a list of changes.
*/
#ifndef __CEDIT_SPELL_CHECKER_DIALOG_H__
#define __CEDIT_SPELL_CHECKER_DIALOG_H__
#include <gtk/gtk.h>
#include "cedit-spell-checker.h"
G_BEGIN_DECLS
#define CEDIT_TYPE_SPELL_CHECKER_DIALOG (cedit_spell_checker_dialog_get_type ())
#define CEDIT_SPELL_CHECKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CEDIT_TYPE_SPELL_CHECKER_DIALOG, CeditSpellCheckerDialog))
#define CEDIT_SPELL_CHECKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CEDIT_TYPE_SPELL_CHECKER_DIALOG, CeditSpellCheckerDialog))
#define CEDIT_IS_SPELL_CHECKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CEDIT_TYPE_SPELL_CHECKER_DIALOG))
#define CEDIT_IS_SPELL_CHECKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CEDIT_TYPE_SPELL_CHECKER_DIALOG))
#define CEDIT_SPELL_CHECKER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CEDIT_TYPE_SPELL_CHECKER_DIALOG, CeditSpellCheckerDialog))
typedef struct _CeditSpellCheckerDialog CeditSpellCheckerDialog;
typedef struct _CeditSpellCheckerDialogClass CeditSpellCheckerDialogClass;
struct _CeditSpellCheckerDialogClass
{
GtkWindowClass parent_class;
/* Signals */
void (*ignore) (CeditSpellCheckerDialog *dlg,
const gchar *word);
void (*ignore_all) (CeditSpellCheckerDialog *dlg,
const gchar *word);
void (*change) (CeditSpellCheckerDialog *dlg,
const gchar *word,
const gchar *change_to);
void (*change_all) (CeditSpellCheckerDialog *dlg,
const gchar *word,
const gchar *change_to);
void (*add_word_to_personal) (CeditSpellCheckerDialog *dlg,
const gchar *word);
};
GType cedit_spell_checker_dialog_get_type (void) G_GNUC_CONST;
/* Constructors */
GtkWidget *cedit_spell_checker_dialog_new (const gchar *data_dir);
GtkWidget *cedit_spell_checker_dialog_new_from_spell_checker
(CeditSpellChecker *spell,
const gchar *data_dir);
void cedit_spell_checker_dialog_set_spell_checker
(CeditSpellCheckerDialog *dlg,
CeditSpellChecker *spell);
void cedit_spell_checker_dialog_set_misspelled_word
(CeditSpellCheckerDialog *dlg,
const gchar* word,
gint len);
void cedit_spell_checker_dialog_set_completed
(CeditSpellCheckerDialog *dlg);
G_END_DECLS
#endif /* __CEDIT_SPELL_CHECKER_DIALOG_H__ */
|
/* $Id: apb.h,v 1.1.1.1 2010/03/11 21:10:21 kris Exp $
* apb.h: Advanced PCI Bridge Configuration Registers and Bits
*
* Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
*/
#ifndef _SPARC64_APB_H
#define _SPARC64_APB_H
#define APB_TICK_REGISTER 0xb0
#define APB_INT_ACK 0xb8
#define APB_PRIMARY_MASTER_RETRY_LIMIT 0xc0
#define APB_DMA_ASFR 0xc8
#define APB_DMA_AFAR 0xd0
#define APB_PIO_TARGET_RETRY_LIMIT 0xd8
#define APB_PIO_TARGET_LATENCY_TIMER 0xd9
#define APB_DMA_TARGET_RETRY_LIMIT 0xda
#define APB_DMA_TARGET_LATENCY_TIMER 0xdb
#define APB_SECONDARY_MASTER_RETRY_LIMIT 0xdc
#define APB_SECONDARY_CONTROL 0xdd
#define APB_IO_ADDRESS_MAP 0xde
#define APB_MEM_ADDRESS_MAP 0xdf
#define APB_PCI_CONTROL_LOW 0xe0
# define APB_PCI_CTL_LOW_ARB_PARK (1 << 21)
# define APB_PCI_CTL_LOW_ERRINT_EN (1 << 8)
#define APB_PCI_CONTROL_HIGH 0xe4
# define APB_PCI_CTL_HIGH_SERR (1 << 2)
# define APB_PCI_CTL_HIGH_ARBITER_EN (1 << 0)
#define APB_PIO_ASFR 0xe8
#define APB_PIO_AFAR 0xf0
#define APB_DIAG_REGISTER 0xf8
#endif /* !(_SPARC64_APB_H) */
|
/****************************************************************************
**
** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** This file may be used under the terms of the GNU General Public
** License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Alternatively you may (at
** your option) use any later version of the GNU General Public
** License if such license has been publicly approved by Trolltech ASA
** (or its successors, if any) and the KDE Free Qt Foundation. In
** addition, as a special exception, Trolltech gives you certain
** additional rights. These rights are described in the Trolltech GPL
** Exception version 1.2, which can be found at
** http://www.trolltech.com/products/qt/gplexception/ and in the file
** GPL_EXCEPTION.txt in this package.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
** you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at sales@trolltech.com.
**
** In addition, as a special exception, Trolltech, as the sole
** copyright holder for Qt Designer, grants users of the Qt/Eclipse
** Integration plug-in the right for the Qt/Eclipse Integration to
** link to functionality provided by Qt Designer and its related
** libraries.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
** granted herein.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
#ifndef QDESKTOPSERVICES_H
#define QDESKTOPSERVICES_H
#include <QtCore/qstring.h>
class QStringList;
class QUrl;
QT_BEGIN_HEADER
QT_MODULE(Gui)
#ifndef QT_NO_DESKTOPSERVICES
class QObject;
class Q_GUI_EXPORT QDesktopServices
{
public:
static bool openUrl(const QUrl &url);
static void setUrlHandler(const QString &scheme, QObject *receiver, const char *method);
static void unsetUrlHandler(const QString &scheme);
};
#endif // QT_NO_DESKTOPSERVICES
QT_END_HEADER
#endif // QDESKTOPSERVICES_H
|
//////////////////////////////////////////////////////////////////////////////
// Copyright 2004-2014, SenseGraphics AB
//
// This file is part of H3D API.
//
// H3D API is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// H3D API 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with H3D API; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// A commercial license is also available. Please contact us at
// www.sensegraphics.com for more information.
//
//
/// \file ShaderFunctions.h
/// \brief Header file for help functions used by shader nodes.
///
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __SHADERFUNCTIONS_H__
#define __SHADERFUNCTIONS_H__
#include <H3D/H3DDynamicFieldsObject.h>
#include <GL/glew.h>
#ifdef HAVE_CG
#include <Cg/cg.h>
#include <Cg/cgGL.h>
#endif
namespace H3D {
/// template class to provide value change checking after update for SField
template< class SF >
class SFUniform : public SF {
public:
bool actualChanged;
SFUniform(){
actualChanged = true;
SF();
}
virtual void setValue( const typename SF::value_type &v, int id = 0 ){
typename SF::value_type old_value = this->value;
SF::setValue( v, id );
if( this->value == old_value ) {
actualChanged = false;
}else {
actualChanged = true;
}
}
virtual string getTypeName() { return "SFUniform"; }
protected:
virtual void update(){
typename SF::value_type old_value = this->value;
SF::update();
if( this->value == old_value ) {
//Console(4)<<"monitored value actually changed"<<endl;
actualChanged = false;
}else {
actualChanged = true;
}
}
};
namespace Shaders {
#ifdef HAVE_CG
CGprofile H3DAPI_API cgProfileFromString( const string &profile,
const string &type );
/// Set the value of a uniform variable in the given CG shader.
/// The name of the uniform variable is the same as the name of the field.
bool H3DAPI_API setCGUniformVariableValue( CGprogram program_handle,
Field *field );
#endif
// struct contains the uniform value changed tag and GLSL uniform location
struct UniformInfo
{
Field* field;
GLint location; // uniform field location in shader program, need update after re-link
};
/// Set the value of a uniform variable in the given GLSL shader.
/// The name of the uniform variable is the same as the name of the field.
///
/// \param force If true, then the uniform value is always set even if the field
/// value has not changed.
///
bool H3DAPI_API setGLSLUniformVariableValue( GLhandleARB program_handle,
Field *field, UniformInfo* ui = NULL, bool force= false );
void H3DAPI_API renderTextures( H3DDynamicFieldsObject * );
void H3DAPI_API postRenderTextures( H3DDynamicFieldsObject * );
void H3DAPI_API preRenderTextures( H3DDynamicFieldsObject * );
GLbitfield H3DAPI_API getAffectedGLAttribs( H3DDynamicFieldsObject * );
}
}
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.