text
stringlengths
4
6.14k
#ifndef OMPHALOS_UI_NOTCURSES_NETWORK #define OMPHALOS_UI_NOTCURSES_NETWORK #ifdef __cplusplus extern "C" { #endif #include <ui/notcurses/core.h> struct panel_state; int display_network_locked(struct ncplane *stdn, struct panel_state *); int update_network_details(struct ncplane *stdn); int display_bridging_locked(struct ncplane *stdn, struct panel_state *); #ifdef __cplusplus } #endif #endif
#pragma once #include "Shape.h" namespace Raytracer { class Sphere : public Shape { public: Sphere( const Transform *objectToWorld, const Transform *worldToObject, bool reverseOrientation, float radius, float zMin, float zMax, float phiMax); Bounds3f objectBound(); bool intersects(const Ray &ray, float *hitT, SurfaceInteraction *isect) const; private: const float radius; const float thetaMin; const float thetaMax; const float zMin; const float zMax; const float phiMax; }; }
static const unsigned char af_bin[] = { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0B, 0x08, 0x02, 0x00, 0x00, 0x00, 0xF9, 0x80, 0x9A, 0x6E, 0x00, 0x00, 0x00, 0x04, 0x67, 0x41, 0x4D, 0x41, 0x00, 0x00, 0xAF, 0xC8, 0x37, 0x05, 0x8A, 0xE9, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x41, 0x64, 0x6F, 0x62, 0x65, 0x20, 0x49, 0x6D, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x64, 0x79, 0x71, 0xC9, 0x65, 0x3C, 0x00, 0x00, 0x01, 0xEE, 0x49, 0x44, 0x41, 0x54, 0x78, 0xDA, 0x62, 0xD4, 0xD4, 0xD4, 0xFC, 0xF4, 0xE9, 0x13, 0x03, 0x18, 0xFC, 0xFA, 0xF5, 0xEB, 0xC5, 0xEB, 0xD7, 0xFF, 0x58, 0x59, 0xFF, 0xFD, 0xFE, 0x0D, 0xE4, 0xFE, 0x01, 0x0B, 0x56, 0x89, 0x32, 0x4C, 0x4C, 0x60, 0x60, 0xF8, 0x01, 0x94, 0x06, 0x71, 0x01, 0x02, 0x88, 0xE5, 0xDD, 0xBB, 0x77, 0x4D, 0x4D, 0x4D, 0x40, 0xD6, 0xDF, 0x7F, 0x20, 0xC8, 0xF0, 0xFB, 0x37, 0xE3, 0x9F, 0xBF, 0xCC, 0xBF, 0x7F, 0xFD, 0xFF, 0xFD, 0x9B, 0xED, 0xF7, 0xEF, 0x7F, 0xBF, 0x7E, 0x05, 0x28, 0xFE, 0xFF, 0xAD, 0xFE, 0xF5, 0xD7, 0xDF, 0x5F, 0x3F, 0xFF, 0xFE, 0x5C, 0x3C, 0x7B, 0x31, 0x40, 0x00, 0xB1, 0x00, 0x01, 0x50, 0xF5, 0xCB, 0x57, 0xAF, 0xFE, 0xFC, 0xFE, 0xFD, 0xE7, 0xCF, 0x1F, 0xA0, 0xBA, 0xFF, 0xBF, 0x7E, 0xFD, 0xFF, 0xF9, 0xEB, 0xFF, 0xAF, 0x9F, 0xFF, 0x7F, 0xFE, 0xFC, 0xF7, 0xF3, 0xE7, 0x7B, 0xF6, 0xFF, 0xB7, 0x25, 0x3E, 0xFD, 0xFC, 0xFD, 0x43, 0x82, 0x4B, 0x12, 0x68, 0x09, 0x40, 0x00, 0xB1, 0xFC, 0xFB, 0xF7, 0xEF, 0xEF, 0xDF, 0xBF, 0x40, 0xD5, 0x40, 0xE5, 0xBF, 0x7F, 0x81, 0x0C, 0xFE, 0xCF, 0xC0, 0xF0, 0x2F, 0x31, 0xE1, 0xFF, 0xDF, 0x3F, 0xFF, 0xF7, 0x1E, 0xF8, 0x7F, 0xF2, 0x18, 0x50, 0xE0, 0xFB, 0xEF, 0xEF, 0xBF, 0x7E, 0xFF, 0xFC, 0xF5, 0xE7, 0x27, 0xD0, 0x61, 0x00, 0x01, 0x28, 0x9C, 0x77, 0x23, 0x00, 0x40, 0x10, 0x08, 0xA2, 0x8C, 0x85, 0xD1, 0x88, 0x55, 0x92, 0x3B, 0x96, 0xA5, 0xDC, 0xE1, 0x0F, 0x83, 0x4D, 0xDF, 0x6C, 0xC9, 0xEF, 0x84, 0x19, 0x41, 0x80, 0xDF, 0xC6, 0xAD, 0x95, 0xBD, 0xD1, 0xEC, 0xA8, 0x1E, 0x47, 0x00, 0xD9, 0x5C, 0x8E, 0x4D, 0x19, 0xF2, 0x04, 0x10, 0xCB, 0x8F, 0x6F, 0xDF, 0xFE, 0x80, 0xCD, 0xFE, 0x05, 0x34, 0xE4, 0xE7, 0x0F, 0xA0, 0x7B, 0xFE, 0x71, 0x72, 0xFC, 0x31, 0x33, 0x63, 0xF8, 0xFE, 0x83, 0x91, 0x83, 0xED, 0xFF, 0x8F, 0x1F, 0x7F, 0x7E, 0xFC, 0xFB, 0xFE, 0xE7, 0xFB, 0x0F, 0xA0, 0x24, 0xD8, 0x06, 0x80, 0x00, 0x62, 0xF9, 0xFA, 0xE3, 0x07, 0xD0, 0x39, 0x40, 0xE5, 0x3F, 0xC1, 0x00, 0xE8, 0xCB, 0xBF, 0xF7, 0xEF, 0x32, 0x89, 0x4B, 0xFE, 0xE3, 0xE6, 0xF9, 0x73, 0xFD, 0x06, 0xE3, 0xB7, 0x6F, 0xC0, 0x00, 0x03, 0x6A, 0xFA, 0xF5, 0xE7, 0x17, 0x48, 0xC3, 0x2F, 0x06, 0x80, 0x00, 0x62, 0x61, 0xF8, 0x0F, 0x74, 0xF6, 0xEF, 0x1F, 0x3F, 0x7E, 0x40, 0xF4, 0xFC, 0xFB, 0xF1, 0xE3, 0xFF, 0x8E, 0x5D, 0x3F, 0xC4, 0x44, 0xFF, 0xFF, 0xFE, 0xC3, 0x76, 0xE5, 0x3A, 0x03, 0xD0, 0x5C, 0xA0, 0x33, 0x7F, 0xFF, 0x04, 0xEA, 0xF9, 0xFD, 0xEF, 0x37, 0x50, 0x03, 0x40, 0x00, 0xB1, 0x40, 0x82, 0x1F, 0x08, 0x80, 0x7A, 0x80, 0x1A, 0x80, 0x6E, 0xF8, 0x7F, 0xED, 0x3A, 0xE7, 0xF9, 0x0B, 0xFF, 0xC0, 0x9A, 0xFF, 0x82, 0xDC, 0xCF, 0xF0, 0xE3, 0xEF, 0xF7, 0x5F, 0xC0, 0x70, 0xF9, 0x0B, 0xD2, 0x00, 0x10, 0x40, 0x20, 0x0D, 0x40, 0x75, 0x42, 0xC2, 0xC2, 0x10, 0x4F, 0x33, 0xFC, 0xFC, 0xC5, 0xF0, 0xEB, 0x27, 0xE3, 0xAF, 0x5F, 0x8C, 0x3F, 0x7F, 0x32, 0xFE, 0xFE, 0x0D, 0x0C, 0x13, 0x3E, 0x71, 0x06, 0x45, 0x5E, 0xE1, 0xDF, 0x7F, 0x7E, 0xFF, 0xF9, 0xF7, 0x07, 0xE8, 0x69, 0x80, 0x00, 0x62, 0x64, 0x40, 0x05, 0x0F, 0x81, 0x61, 0x0A, 0x8E, 0x63, 0x38, 0xF2, 0x00, 0xC6, 0x92, 0x3A, 0x38, 0xA6, 0x81, 0x1C, 0x2E, 0x06, 0x80, 0x00, 0x03, 0x00, 0xFB, 0x45, 0x69, 0x53, 0x8E, 0x5E, 0x77, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82, };
#ifndef __SETTINGS_H_INCLUDED #define __SETTINGS_H_INCLUDED #define MAX_32BIT_DIVSUFSORT_LENGTH 2147483647L #endif // __SETTINGS_H_INCLUDED
/*----------------------------------------------------------------------------** ** β–ˆ β–ˆ ** ** β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ** ** β–ˆβ–ˆ β–ˆβ–ˆ ** ** β–ˆβ–ˆβ–ˆ β–ˆ β–ˆ β–ˆβ–ˆβ–ˆ cowmalloc.c ** ** β–ˆ β–ˆ β–ˆ β–ˆ libstdcow ** ** β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ** ** β–ˆ β–ˆ Copyright (c) 2016 ** ** β–ˆ β–ˆ β–ˆ β–ˆ AmazingCow - www.AmazingCow.com ** ** β–ˆ β–ˆ β–ˆ β–ˆ ** ** β–ˆ β–ˆ N2OMatt - n2omatt@amazingcow.com ** ** β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ www.amazingcow.com/n2omatt ** ** ** ** This software is licensed as GPLv3 ** ** CHECK THE COPYING FILE TO MORE DETAILS ** ** ** ** Permission is granted to anyone to use this software for any purpose, ** ** including commercial applications, and to alter it and redistribute it ** ** freely, subject to the following restrictions: ** ** ** ** 0. You **CANNOT** change the type of the license. ** ** 1. The origin of this software must not be misrepresented; ** ** you must not claim that you wrote the original software. ** ** 2. If you use this software in a product, an acknowledgment in the ** ** product IS HIGHLY APPRECIATED, both in source and binary forms. ** ** (See opensource.AmazingCow.com/acknowledgment.html for details). ** ** If you will not acknowledge, just send us a email. We'll be ** ** *VERY* happy to see our work being used by other people. :) ** ** The email is: acknowledgment_opensource@AmazingCow.com ** ** 3. Altered source versions must be plainly marked as such, ** ** and must not be misrepresented as being the original software. ** ** 4. This notice may not be removed or altered from any source ** ** distribution. ** ** 5. Most important, you must have fun. ;) ** ** ** ** Visit opensource.amazingcow.com for more open-source projects. ** ** ** ** Enjoy :) ** **----------------------------------------------------------------------------*/ /* This source is meant to compiled only in DEBUG builds (!NDEBUG) */ #ifndef NDEBUG /* Header */ #include "cowmalloc.h" /* std */ #include <stdlib.h> #include <string.h> /******************************************************************************* * malloc * *******************************************************************************/ void* _cow_malloc(size_t size) { void *mem = NULL; mem = malloc(size); COW_ASSERT_ARGS(mem != NULL, "Failed to alloc memory - size(%d)", size); memset(mem, 'C', size); return mem; } #endif /* NDEBUG */
#include <SDL.h> #include <SDL_ttf.h> #include <SDL_image.h> #include <stdbool.h> #include <time.h> #include <unistd.h> #include <pthread.h> #include <netdb.h> #include <netinet/in.h> #include <string.h> #include "../lib/slog.h" #include "../lib/autoversion.h" #define VERSION "0.14" #define BASE "." #define FONT "/etc/wallyd.d/fonts/FreeMono.ttf" #define START WALLYD_CONFDIR"/wallystart.conf" SDL_Window* window = NULL; SDL_Renderer* renderer = NULL; SDL_Surface* screenSurface = NULL; TTF_Font *font = NULL; SDL_Event event; SDL_Color black = {0,0,0,255}; SDL_Color white = {255,255,255,255}; bool quit = false; int rot = 0, h = 0, w = 0; pthread_t log_thr; char *logStr = NULL; char *startupScript = "/etc/wallyd.d"; void* globalSLG; bool loadSDL(); bool loadFont(char *file, int size); bool fadeImage(SDL_Texture *text, int rot, bool reverse, long delay); bool showTexture(SDL_Texture *text, int rot); SDL_Texture* loadImage(char *name); void closeSDL(); bool dumpModes(void); SDL_Texture* renderLog(char *strTmp,int *w, int *h); void* logListener(void *); int sgetline(int fd, char ** out); void processStartupScript(char *file); bool processCommand(char *buf); char *repl_str(const char *str, const char *from, const char *to);
/* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class com_lfv_lanzius_application_FootSwitchController */ #ifndef _Included_com_lfv_lanzius_application_FootSwitchController #define _Included_com_lfv_lanzius_application_FootSwitchController #ifdef __cplusplus extern "C" { #endif #undef SWITCH_STATE_DISCONNECTED #define SWITCH_STATE_DISCONNECTED 0L #undef SWITCH_STATE_UP #define SWITCH_STATE_UP 1L #undef SWITCH_STATE_PRESSED #define SWITCH_STATE_PRESSED 2L #undef SWITCH_STATE_DOWN #define SWITCH_STATE_DOWN 3L #undef SWITCH_STATE_RELEASED #define SWITCH_STATE_RELEASED 4L #undef FTSW_VERSION #define FTSW_VERSION 530L /* * Class: com_lfv_lanzius_application_FootSwitchController * Method: setSwitchFunction * Signature: (Z)V */ JNIEXPORT void JNICALL Java_com_lfv_lanzius_application_FootSwitchController_setSwitchFunction (JNIEnv *, jclass, jboolean); /* * Class: com_lfv_lanzius_application_FootSwitchController * Method: getSwitchVersion * Signature: ()I */ JNIEXPORT jint JNICALL Java_com_lfv_lanzius_application_FootSwitchController_getSwitchVersion (JNIEnv *, jclass); /* * Class: com_lfv_lanzius_application_FootSwitchController * Method: getSwitchState * Signature: ()I */ JNIEXPORT jint JNICALL Java_com_lfv_lanzius_application_FootSwitchController_getSwitchState (JNIEnv *, jclass); #ifdef __cplusplus } #endif #endif
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Code/Dev/appNativa/source/rareobjc/../rare/apple/com/appnativa/rare/net/HTTPResponseCache.java // // Created by decoteaud on 3/11/16. // #ifndef _RAREHTTPResponseCache_H_ #define _RAREHTTPResponseCache_H_ @class JavaIoFile; @class JavaIoInputStream; #import "JreEmulation.h" @interface RAREHTTPResponseCache : NSObject { } + (NSString *)defaultCache; + (void)setDefaultCache:(NSString *)defaultCache; + (void)cacheDataWithNSString:(NSString *)name withJavaIoInputStream:(JavaIoInputStream *)inArg; + (void)clearResponseCache; + (JavaIoFile *)createCacheFileWithNSString:(NSString *)name; + (void)deleteCachedDataWithNSString:(NSString *)name; + (void)installResponseCacheWithNSString:(NSString *)name withInt:(int)mbMaxSize withBoolean:(BOOL)deleteOnExit; + (JavaIoInputStream *)getCachedDataWithNSString:(NSString *)name; + (NSString *)createFileNameWithNSString:(NSString *)dir withNSString:(NSString *)name; - (id)init; @end typedef RAREHTTPResponseCache ComAppnativaRareNetHTTPResponseCache; #endif // _RAREHTTPResponseCache_H_
#ifndef EXPRESSION_H #define EXPRESSION_H #include <string> #include <map> #include <vector> #include "expression_parser.h" class Expression { public: Expression(const std::string &s); Expression(const Expression &e); Expression & operator=(const Expression &e); bool operator==(const Expression &e) const; bool operator!=(const Expression &e) const; Expression & operator+=(const Expression &e); Expression & operator-=(const Expression &e); Expression & operator*=(const Expression &e); Expression & operator/=(const Expression &e); Expression operator+(const Expression &e) const; Expression operator-(const Expression &e) const; Expression operator*(const Expression &e) const; Expression operator/(const Expression &e) const; bool isSubExpression(const Expression &e) const; std::map <std::string, double>& variables(); double getVar(size_t id) const; double getVar(const std::string &name) const; void setVar(size_t id, double val); void setVar(const std::string &name, double val); double eval(); void print(); protected: Functions<double>::const_iterator findFunction(const std::string &name, Function<double>::Type type); void addFunction(const Functions<double>::const_iterator &f, const Expression &e); Cell<double> *m_root; std::map <std::string, double> m_variables; std::vector <std::string> m_varnames; }; class ExpressionException : public std::exception { public: ExpressionException(const std::string &s) noexcept : m_s(s) {} virtual const char* what() const noexcept override { return m_s.c_str(); } protected: std::string m_s; }; #endif
/* * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ /* * File: mach/vm_prot.h * Author: Avadis Tevanian, Jr., Michael Wayne Young * * Virtual memory protection definitions. * */ #ifndef _MACH_VM_PROT_H_ #define _MACH_VM_PROT_H_ /* * Types defined: * * vm_prot_t VM protection values. */ typedef int vm_prot_t; /* * Protection values, defined as bits within the vm_prot_t type */ #define VM_PROT_NONE ((vm_prot_t) 0x00) #define VM_PROT_READ ((vm_prot_t) 0x01) /* read permission */ #define VM_PROT_WRITE ((vm_prot_t) 0x02) /* write permission */ #define VM_PROT_EXECUTE ((vm_prot_t) 0x04) /* execute permission */ /* * The default protection for newly-created virtual memory */ #define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE) /* * The maximum privileges possible, for parameter checking. */ #define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) /* * An invalid protection value. * Used only by memory_object_lock_request to indicate no change * to page locks. Using -1 here is a bad idea because it * looks like VM_PROT_ALL and then some. */ #define VM_PROT_NO_CHANGE ((vm_prot_t) 0x08) /* * When a caller finds that they cannot obtain write permission on a * mapped entry, the following flag can be used. The entry will * be made "needs copy" effectively copying the object (using COW), * and write permission will be added to the maximum protections * for the associated entry. */ #define VM_PROT_COPY ((vm_prot_t) 0x10) /* * Another invalid protection value. * Used only by memory_object_data_request upon an object * which has specified a copy_call copy strategy. It is used * when the kernel wants a page belonging to a copy of the * object, and is only asking the object as a result of * following a shadow chain. This solves the race between pages * being pushed up by the memory manager and the kernel * walking down the shadow chain. */ #define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10) #ifdef PRIVATE /* * The caller wants this memory region treated as if it had a valid * code signature. */ #define VM_PROT_TRUSTED ((vm_prot_t) 0x20) #endif /* PRIVATE */ /* * Another invalid protection value. * Indicates that the other protection bits are to be applied as a mask * against the actual protection bits of the map entry. */ #define VM_PROT_IS_MASK ((vm_prot_t) 0x40) #endif /* _MACH_VM_PROT_H_ */
#include "yapl/main.h" #include "yapl/memory.h" int main(char **argc, int argv) { yapl$memory$init(); return yapl$main(argc, argv); }
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: android/libcore/luni/src/main/java/java/io/StreamTokenizer.java // // Created by tball on 11/23/13. // #ifndef _JavaIoStreamTokenizer_H_ #define _JavaIoStreamTokenizer_H_ @class IOSByteArray; @class JavaIoInputStream; @class JavaIoReader; #import "JreEmulation.h" #define JavaIoStreamTokenizer_TOKEN_COMMENT 1 #define JavaIoStreamTokenizer_TOKEN_DIGIT 16 #define JavaIoStreamTokenizer_TOKEN_QUOTE 2 #define JavaIoStreamTokenizer_TOKEN_WHITE 4 #define JavaIoStreamTokenizer_TOKEN_WORD 8 #define JavaIoStreamTokenizer_TT_EOF -1 #define JavaIoStreamTokenizer_TT_EOL 10 #define JavaIoStreamTokenizer_TT_NUMBER -2 #define JavaIoStreamTokenizer_TT_UNKNOWN -4 #define JavaIoStreamTokenizer_TT_WORD -3 @interface JavaIoStreamTokenizer : NSObject { @public double nval_; NSString *sval_; int ttype_; IOSByteArray *tokenTypes_; int lineNumber_; BOOL forceLowercase_; BOOL isEOLSignificant_; BOOL slashStarComments__; BOOL slashSlashComments__; BOOL pushBackToken_; BOOL lastCr_; JavaIoInputStream *inStream_; JavaIoReader *inReader_; int peekChar_; } + (int)TT_EOF; + (int)TT_EOL; + (int)TT_NUMBER; + (int)TT_WORD; - (id)init; - (id)initWithJavaIoInputStream:(JavaIoInputStream *)is; - (id)initWithJavaIoReader:(JavaIoReader *)r; - (void)commentCharWithInt:(int)ch; - (void)eolIsSignificantWithBoolean:(BOOL)flag; - (int)lineno; - (void)lowerCaseModeWithBoolean:(BOOL)flag; - (int)nextToken; - (void)ordinaryCharWithInt:(int)ch; - (void)ordinaryCharsWithInt:(int)low withInt:(int)hi; - (void)parseNumbers; - (void)pushBack; - (void)quoteCharWithInt:(int)ch; - (int)read; - (void)resetSyntax; - (void)slashSlashCommentsWithBoolean:(BOOL)flag; - (void)slashStarCommentsWithBoolean:(BOOL)flag; - (NSString *)description; - (void)whitespaceCharsWithInt:(int)low withInt:(int)hi; - (void)wordCharsWithInt:(int)low withInt:(int)hi; - (void)copyAllFieldsTo:(JavaIoStreamTokenizer *)other; @end J2OBJC_FIELD_SETTER(JavaIoStreamTokenizer, sval_, NSString *) J2OBJC_FIELD_SETTER(JavaIoStreamTokenizer, tokenTypes_, IOSByteArray *) J2OBJC_FIELD_SETTER(JavaIoStreamTokenizer, inStream_, JavaIoInputStream *) J2OBJC_FIELD_SETTER(JavaIoStreamTokenizer, inReader_, JavaIoReader *) #endif // _JavaIoStreamTokenizer_H_
#ifndef _EVENT_H_ #define _EVENT_H_ #include "Structures.h" #include "Animation.h" #include <string> #include <vector> class Parameter { public: Parameter(); Parameter(const Parameter &p); Parameter(const std::string &name, const int32_t &value); std::string Name; int32_t Value; }; enum Difficulty { Easy, Normal, Hard }; class Event { private: EventID id; uint32_t SpriteId; Difficulty difficulty; bool Illuminate; bool Active; Difficulty diff; std::vector<Parameter> params; public: Event(const J2L_Event &event); const Animation *GetSprite(const Animations *anims) const; bool IsActive() const; float GetXVelocity() const; float GetYVelocity() const; }; #endif
/* This file is part of Ship Multi-Instrument Copyright(C) 2014 Carsten Agerskov 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 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, see <http://www.gnu.org/licenses/>. */ #ifndef _APPROX_MAX_TIME_FILTER_H #define _APPROX_MAX_TIME_FILTER_H #include <Arduino.h> #define MAX_TIME_FILTER_LENGTH 10 class ApproxMaxTimeFilter { float timeFilter[MAX_TIME_FILTER_LENGTH]; unsigned long windIntervalTimeStamp; int windIntervalIndex; int filterLength; unsigned long timeSlotMillis; public: ApproxMaxTimeFilter(int, unsigned long); void putValue(float); float getMax(); }; #endif
/*************************************************************** * Name: ThreadSearchLoggerTree * Purpose: ThreadSearchLoggerTree implements the * ThreadSearchLoggerBase interface with a wxTreeCtrl. * Author: Jerome ANTOINE * Created: 2007-07-28 * Copyright: Jerome ANTOINE * License: GPL **************************************************************/ #ifndef THREAD_SEARCH_LOGGER_TREE_H #define THREAD_SEARCH_LOGGER_TREE_H #include <wx/event.h> #include "ThreadSearchLoggerBase.h" class wxString; class wxWindow; class wxPanel; class wxTreeCtrl; class wxTreeEvent; class ThreadSearch; class ThreadSearchView; class sThreadSearchEvent; // MessageLog inheritance is necessary to be able to // add logger to Messages notebook. class ThreadSearchLoggerTree : public wxEvtHandler, public ThreadSearchLoggerBase { public: /** Constructor. */ ThreadSearchLoggerTree(ThreadSearchView& threadSearchView, ThreadSearch& threadSearchPlugin, InsertIndexManager::eFileSorting fileSorting, wxPanel* pParent, long id); /** Destructor. */ virtual ~ThreadSearchLoggerTree(); /** Getter */ virtual eLoggerTypes GetLoggerType() {return TypeTree;} /** Called by ThreadSearchView to process a sThreadSearchEvent * sent by worker thread. */ virtual void OnThreadSearchEvent(const sThreadSearchEvent& event); /** Removes all items from logger. */ virtual void Clear(); /** Returns the logger window. */ virtual wxWindow* GetWindow(); /** Sets focus on list window. */ virtual void SetFocus(); /** Single click event handler */ void OnLoggerTreeClick(wxTreeEvent& event); /** Double click event handler */ void OnLoggerTreeDoubleClick(wxTreeEvent& event); void SyncLoggerToPreview(); protected: /** GetFileLineFromTreeEvent * Return the file path at index from the list control using dir and file columns. * @param event : list control event * @param filepath : reference that will receive the path * @param line : reference that will receive the line index * @return true if successful. */ bool GetFileLineFromTreeEvent(wxTreeEvent& event, wxString& filepath, long &line); /** Dynamic events connection. */ virtual void ConnectEvents(wxEvtHandler* pEvtHandler); /** Dynamic events disconnection. */ virtual void DisconnectEvents(wxEvtHandler* pEvtHandler); void OnMouseWheelEvent(wxMouseEvent& event); wxTreeCtrl* m_pTreeLog; bool m_FirstItemProcessed; // Used to filter wxTree events and process useful ones only. }; #endif // THREAD_SEARCH_LOGGER_TREE_H
/* * RPbdb::LogController * * BDB logging implementation for applications described here: * http://www.oracle.com/technology/documentation/berkeley-db/db/ref/apprec/def.html * * Description of process for full backup with BDB: * http://www.oracle.com/technology/documentation/berkeley-db/db/ref/transapp/archival.html * */ #ifndef RPBDB_LOG_CONTROLLER #define RPBDB_LOG_CONTROLLER #include "BaseStandardInclude.h" /**************** * Prototypes * ****************/ RPbdb_LogController* RPbdb_LogController_new( RPbdb_Environment* parent_environment ); void RPbdb_LogController_free( RPbdb_LogController** log_controller ); RPbdb_LogSettingsController* RPbdb_LogController_settingsController( RPbdb_LogController* log_controller ); RPbdb_Environment* RPbdb_LogController_parentEnvironment( RPbdb_LogController* log_controller ); void RPbdb_LogController_appendStringToCurrentLog( RPbdb_LogController* log_controller, char* log_string, ... ); void RPbdb_LogController_appendLogRecord( RPbdb_LogController* log_controller, RPbdb_Record* log_record ); void RPbdb_LogController_flushLogsToDisk( RPbdb_LogController* log_controller, RPbdb_LogSequenceNumber* log_sequence_number ); RPbdb_LogCursorController* RPbdb_LogController_cursorController( RPbdb_LogController* log_controller ); #endif
// // INPopoverController.h // INPopoverController // // Created by John Daniel on 2016-10-25. // // #import <Cocoa/Cocoa.h> //! Project version number for INPopoverController. FOUNDATION_EXPORT double INPopoverControllerVersionNumber; //! Project version string for INPopoverController. FOUNDATION_EXPORT const unsigned char INPopoverControllerVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <INPopoverController/PublicHeader.h> #import <INPopoverController/INPopoverDelegate.h> #import <INPopoverController/INPopoverDefines.h> #import <INPopoverController/INPopover.h>
// XTPChartPanel.h // // This file is a part of the XTREME TOOLKIT PRO MFC class library. // (c)1998-2012 Codejock Software, All Rights Reserved. // // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN // CONSENT OF CODEJOCK SOFTWARE. // // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A // SINGLE COMPUTER. // // CONTACT INFORMATION: // support@codejock.com // http://www.codejock.com // ///////////////////////////////////////////////////////////////////////////// //{{AFX_CODEJOCK_PRIVATE #if !defined(__XTPCHARTPANEL_H__) #define __XTPCHARTPANEL_H__ //}}AFX_CODEJOCK_PRIVATE #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 class CXTPChartDiagram; class CXTPChartPanelCollection; class CXTPChartTitleCollection; //=========================================================================== // Summary: // This class abstracts a chart panel, used in panel charts. // Remarks: // Panel Charts are charts that have multiple regions which compare similar // data sets side by side (in separate panels) rather than right on top of // each other. Essentially a single chart is repeated across a grid, with // different data sets in each instance of the chart. //=========================================================================== class _XTP_EXT_CLASS CXTPChartPanel : public CXTPChartElement { DECLARE_DYNAMIC(CXTPChartPanel); public: //----------------------------------------------------------------------- // Summary: // Constructs a CXTPChartPanel object. // Remarks: //----------------------------------------------------------------------- CXTPChartPanel(); //------------------------------------------------------------------------- // Summary: // Destroys a CXTPChartMarker object, handles cleanup. //------------------------------------------------------------------------- virtual ~CXTPChartPanel(); public: //----------------------------------------------------------------------- // Summary: // Call this function to get the the title collection object. // Returns: // A pointer to CXTPChartTitleCollection object. // Remarks: //----------------------------------------------------------------------- CXTPChartTitleCollection* GetTitles() const; public: void Remove(); virtual void DoPropExchange(CXTPPropExchange* pPX); public: protected: CXTPChartTitleCollection* m_pTitles; protected: friend class CXTPChartPanelCollection; friend class CXTPChartContent; }; //=========================================================================== // Summary: // This class abstracts a chart panel collection, used in panel charts. // Remarks: // Panel Charts are charts that have multiple regions which compare similar // data sets side by side (in separate panels) rather than right on top of // each other. Essentially a single chart is repeated across a grid, with // different data sets in each instance of the chart. //=========================================================================== class _XTP_EXT_CLASS CXTPChartPanelCollection : public CXTPChartElementCollection { public: //----------------------------------------------------------------------- // Summary: // Constructs a CXTPChartPanelCollection object. // Remarks: //----------------------------------------------------------------------- CXTPChartPanelCollection(CXTPChartContent* pOwner); //------------------------------------------------------------------------- // Summary: // Destroys a CXTPChartPanelCollection object, handles cleanup. //------------------------------------------------------------------------- virtual ~CXTPChartPanelCollection(); public: //------------------------------------------------------------------------- // Summary: // Call this function to add a panel to the collection. // Parameters: // pPanel - A pointer to the panel object which is to be added. //------------------------------------------------------------------------- CXTPChartPanel* Add(CXTPChartPanel* pPanel); // Summary: // Call this function to get the panel at a particular index in the // collection. // Parameters: // nIndex - Zero based index of the panel to be fetched. // Returns: // A pointer to the chart panel object. //------------------------------------------------------------------------- CXTPChartPanel* GetAt(int nIndex) const; public: void DoPropExchange(CXTPPropExchange* pPX); protected: protected: friend class CXTPChartContent; }; AFX_INLINE CXTPChartPanel* CXTPChartPanelCollection::GetAt(int nIndex) const { return nIndex >= 0 && nIndex < m_arrElements.GetSize() ? (CXTPChartPanel*)m_arrElements.GetAt(nIndex) : NULL; } AFX_INLINE CXTPChartTitleCollection* CXTPChartPanel::GetTitles() const { return m_pTitles; } #endif //#if !defined(__XTPCHARTPANEL_H__)
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === * * Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org> * * Tomahawk 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. * * Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>. */ #ifndef PLAYLISTLARGEITEMDELEGATE_H #define PLAYLISTLARGEITEMDELEGATE_H #include <QStyledItemDelegate> #include <QTextDocument> #include <QTextOption> #include "PlaylistItemDelegate.h" #include "DllMacro.h" #include "Typedefs.h" namespace Tomahawk { class PixmapDelegateFader; } class PlayableItem; class PlayableProxyModel; class TrackView; class DLLEXPORT PlaylistLargeItemDelegate : public PlaylistItemDelegate { Q_OBJECT public: enum DisplayMode { LovedTracks, RecentlyPlayed, LatestAdditions }; PlaylistLargeItemDelegate( DisplayMode mode, TrackView* parent = 0, PlayableProxyModel* proxy = 0 ); virtual QSize sizeHint( const QStyleOptionViewItem& option, const QModelIndex& index ) const; protected: void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const; private slots: void doUpdateIndex( const QPersistentModelIndex& idx ); void modelChanged(); private: void drawRichText( QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect, int flags, QTextDocument& text ) const; QTextOption m_topOption; QTextOption m_centerRightOption; QTextOption m_bottomOption; mutable QHash< QPersistentModelIndex, QSharedPointer< Tomahawk::PixmapDelegateFader > > m_pixmaps; TrackView* m_view; PlayableProxyModel* m_model; DisplayMode m_mode; }; #endif // PLAYLISTLARGEITEMDELEGATE_H
#include "yaffut.h" #include "../lib/Infint.h" using namespace yaffut; class TesteInfintConstrutorPorUnsignedLongInt {}; TEST( TesteInfintConstrutorPorUnsignedLongInt, construir_infint_a_partir_de_um_unsigned_long_int_positivo ) { unsigned long int a = 132432345; Infint b(a); Infint valorEsperado("132432345"); YAFFUT_EQUAL( valorEsperado, b ); } TEST( TesteInfintConstrutorPorUnsignedLongInt, construir_infint_a_partir_de_um_unsigned_long_int_negativo ) { unsigned long int a = -14545678; Infint b(a); unsigned long int valorEsperadoInt = a + ( 4294967295 + 1 ); Infint valorEsperado( valorEsperadoInt ); YAFFUT_EQUAL( valorEsperado, b ); } TEST( TesteInfintConstrutorPorUnsignedLongInt, construir_infint_a_partir_de_um_unsigned_long_int_zero ) { unsigned long int a = 0; Infint b(a); Infint valorEsperado("0"); YAFFUT_EQUAL( valorEsperado, b ); }
/* * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. * Copyright (c) 2005, 2006, 2007, 2008 Mellanox Technologies. * All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * 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 MLX4_FW_QOS_H #define MLX4_FW_QOS_H #include <linux/mlx4/cmd.h> #include <linux/mlx4/device.h> #define MLX4_NUM_UP 8 #define MLX4_NUM_TC 8 /* Default supported priorities for VPP allocation */ #define MLX4_DEFAULT_QOS_PRIO (0) /* Derived from FW feature definition, 0 is the default vport fo all QPs */ #define MLX4_VPP_DEFAULT_VPORT (0) struct mlx4_vport_qos_param { u32 bw_share; u32 max_avg_bw; u8 enable; }; /** * mlx4_SET_PORT_PRIO2TC - This routine maps user priorities to traffic * classes of a given port and device. * * @dev: mlx4_dev. * @port: Physical port number. * @prio2tc: Array of TC associated with each priorities. * * Returns 0 on success or a negative mlx4_core errno code. **/ int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc); /** * mlx4_SET_PORT_SCHEDULER - This routine configures the arbitration between * traffic classes (ETS) and configured rate limit for traffic classes. * tc_tx_bw, pg and ratelimit are arrays where each index represents a TC. * The description for those parameters below refers to a single TC. * * @dev: mlx4_dev. * @port: Physical port number. * @tc_tx_bw: The percentage of the bandwidth allocated for traffic class * within a TC group. The sum of the bw_percentage of all the traffic * classes within a TC group must equal 100% for correct operation. * @pg: The TC group the traffic class is associated with. * @ratelimit: The maximal bandwidth allowed for the use by this traffic class. * * Returns 0 on success or a negative mlx4_core errno code. **/ int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, u8 *pg, u16 *ratelimit); /** * mlx4_ALLOCATE_VPP_get - Query port VPP availible resources and allocation. * Before distribution of VPPs to priorities, only availible_vpp is returned. * After initialization it returns the distribution of VPPs among priorities. * * @dev: mlx4_dev. * @port: Physical port number. * @availible_vpp: Pointer to variable where number of availible VPPs is stored * @vpp_p_up: Distribution of VPPs to priorities is stored in this array * * Returns 0 on success or a negative mlx4_core errno code. **/ int mlx4_ALLOCATE_VPP_get(struct mlx4_dev *dev, u8 port, u16 *availible_vpp, u8 *vpp_p_up); /** * mlx4_ALLOCATE_VPP_set - Distribution of VPPs among differnt priorities. * The total number of VPPs assigned to all for a port must not exceed * the value reported by availible_vpp in mlx4_ALLOCATE_VPP_get. * VPP allocation is allowed only after the port type has been set, * and while no QPs are open for this port. * * @dev: mlx4_dev. * @port: Physical port number. * @vpp_p_up: Allocation of VPPs to different priorities. * * Returns 0 on success or a negative mlx4_core errno code. **/ int mlx4_ALLOCATE_VPP_set(struct mlx4_dev *dev, u8 port, u8 *vpp_p_up); /** * mlx4_SET_VPORT_QOS_get - Query QoS proporties of a Vport. * Each priority allowed for the Vport is assigned with a share of the BW, * and a BW limitation. This commands query the current QoS values. * * @dev: mlx4_dev. * @port: Physical port number. * @vport: Vport id. * @out_param: Array of mlx4_vport_qos_param that will contain the values. * * Returns 0 on success or a negative mlx4_core errno code. **/ int mlx4_SET_VPORT_QOS_get(struct mlx4_dev *dev, u8 port, u8 vport, struct mlx4_vport_qos_param *out_param); /** * mlx4_SET_VPORT_QOS_set - Set QoS proporties of a Vport. * QoS parameters can be modified at any time, but must be initialized * before any QP is associated with the VPort. * * @dev: mlx4_dev. * @port: Physical port number. * @vport: Vport id. * @out_param: Array of mlx4_vport_qos_param which holds the requested values. * * Returns 0 on success or a negative mlx4_core errno code. **/ int mlx4_SET_VPORT_QOS_set(struct mlx4_dev *dev, u8 port, u8 vport, struct mlx4_vport_qos_param *in_param); #endif /* MLX4_FW_QOS_H */
/* * Generated by class-dump 3.1.2. * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2007 by Steve Nygard. */ #import "_ABCreateStringWithAddressDictionary.h" @class NBPhoneNumberDesc, NSMutableArray, NSNumber, NSString; @interface NBPhoneMetaData : _ABCreateStringWithAddressDictionary { BOOL _sameMobileAndFixedLinePattern; BOOL _mainCountryForCode; BOOL _leadingZeroPossible; NBPhoneNumberDesc *_generalDesc; NBPhoneNumberDesc *_fixedLine; NBPhoneNumberDesc *_mobile; NBPhoneNumberDesc *_tollFree; NBPhoneNumberDesc *_premiumRate; NBPhoneNumberDesc *_sharedCost; NBPhoneNumberDesc *_personalNumber; NBPhoneNumberDesc *_voip; NBPhoneNumberDesc *_pager; NBPhoneNumberDesc *_uan; NBPhoneNumberDesc *_emergency; NBPhoneNumberDesc *_voicemail; NBPhoneNumberDesc *_noInternationalDialling; NSString *_codeID; NSNumber *_countryCode; NSString *_internationalPrefix; NSString *_preferredInternationalPrefix; NSString *_nationalPrefix; NSString *_preferredExtnPrefix; NSString *_nationalPrefixForParsing; NSString *_nationalPrefixTransformRule; NSMutableArray *_numberFormats; NSMutableArray *_intlNumberFormats; NSString *_leadingDigits; } - (void)setLeadingZeroPossible:(BOOL)fp8; - (BOOL)leadingZeroPossible; - (void)setLeadingDigits:(id)fp8; - (id)leadingDigits; - (void)setMainCountryForCode:(BOOL)fp8; - (BOOL)mainCountryForCode; - (void)setIntlNumberFormats:(id)fp8; - (id)intlNumberFormats; - (void)setNumberFormats:(id)fp8; - (id)numberFormats; - (void)setSameMobileAndFixedLinePattern:(BOOL)fp8; - (BOOL)sameMobileAndFixedLinePattern; - (void)setNationalPrefixTransformRule:(id)fp8; - (id)nationalPrefixTransformRule; - (void)setNationalPrefixForParsing:(id)fp8; - (id)nationalPrefixForParsing; - (void)setPreferredExtnPrefix:(id)fp8; - (id)preferredExtnPrefix; - (void)setNationalPrefix:(id)fp8; - (id)nationalPrefix; - (void)setPreferredInternationalPrefix:(id)fp8; - (id)preferredInternationalPrefix; - (void)setInternationalPrefix:(id)fp8; - (id)internationalPrefix; - (void)setCountryCode:(id)fp8; - (id)countryCode; - (void)setCodeID:(id)fp8; - (id)codeID; - (void)setNoInternationalDialling:(id)fp8; - (id)noInternationalDialling; - (void)setVoicemail:(id)fp8; - (id)voicemail; - (void)setEmergency:(id)fp8; - (id)emergency; - (void)setUan:(id)fp8; - (id)uan; - (void)setPager:(id)fp8; - (id)pager; - (void)setVoip:(id)fp8; - (id)voip; - (void)setPersonalNumber:(id)fp8; - (id)personalNumber; - (void)setSharedCost:(id)fp8; - (id)sharedCost; - (void)setPremiumRate:(id)fp8; - (id)premiumRate; - (void)setTollFree:(id)fp8; - (id)tollFree; - (void)setMobile:(id)fp8; - (id)mobile; - (void)setFixedLine:(id)fp8; - (id)fixedLine; - (void)setGeneralDesc:(id)fp8; - (id)generalDesc; - (void).cxx_destruct; - (void)encodeWithCoder:(id)fp8; - (id)initWithCoder:(id)fp8; - (id)description; - (id)init; @end
#ifndef TYPEMOB_H_INCLUDED #define TYPEMOB_H_INCLUDED #include <string> #include "Caracteristiques.h" #include "Spell.h" class TypeMob { public: TypeMob(); TypeMob(std::string name,Caracteristiques baseAttributs,Caracteristiques xAttributs, std::vector<Spell*> sorts); std::string getName(); Caracteristiques getCaracteristiques(int level); const std::vector<Spell*>& getSpells(); private: const std::string m_name; const Caracteristiques m_baseAttributs; const Caracteristiques m_xAttributs; const std::vector<Spell*> m_sorts; }; #endif // TYPEMOB_H_INCLUDED
// // Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "TSErrorMessage.h" NS_ASSUME_NONNULL_BEGIN // This is a deprecated class, we're keeping it around to avoid YapDB serialization errors // TODO - remove this class, clean up existing instances, ensure any missed ones don't explode (UnknownDBObject) __attribute__((deprecated)) @interface OWSUnknownContactBlockOfferMessage : TSErrorMessage @property (nonatomic, readonly) NSString *contactId; // --- CODE GENERATION MARKER // This snippet is generated by /Scripts/sds_codegen/sds_generate.py. Do not manually edit it, instead run `sds_codegen.sh`. // clang-format off - (instancetype)initWithUniqueId:(NSString *)uniqueId receivedAtTimestamp:(uint64_t)receivedAtTimestamp sortId:(uint64_t)sortId timestamp:(uint64_t)timestamp uniqueThreadId:(NSString *)uniqueThreadId attachmentIds:(NSArray<NSString *> *)attachmentIds body:(nullable NSString *)body contactShare:(nullable OWSContact *)contactShare expireStartedAt:(uint64_t)expireStartedAt expiresAt:(uint64_t)expiresAt expiresInSeconds:(unsigned int)expiresInSeconds isViewOnceComplete:(BOOL)isViewOnceComplete isViewOnceMessage:(BOOL)isViewOnceMessage linkPreview:(nullable OWSLinkPreview *)linkPreview messageSticker:(nullable MessageSticker *)messageSticker quotedMessage:(nullable TSQuotedMessage *)quotedMessage schemaVersion:(NSUInteger)schemaVersion storedShouldStartExpireTimer:(BOOL)storedShouldStartExpireTimer errorMessageSchemaVersion:(NSUInteger)errorMessageSchemaVersion errorType:(TSErrorMessageType)errorType read:(BOOL)read recipientAddress:(nullable SignalServiceAddress *)recipientAddress contactId:(NSString *)contactId NS_SWIFT_NAME(init(uniqueId:receivedAtTimestamp:sortId:timestamp:uniqueThreadId:attachmentIds:body:contactShare:expireStartedAt:expiresAt:expiresInSeconds:isViewOnceComplete:isViewOnceMessage:linkPreview:messageSticker:quotedMessage:schemaVersion:storedShouldStartExpireTimer:errorMessageSchemaVersion:errorType:read:recipientAddress:contactId:)); // clang-format on // --- CODE GENERATION MARKER @end NS_ASSUME_NONNULL_END
/*================================================================= File created by Yohann NICOLAS. Loading parameters from ini file. =================================================================*/ #pragma once #define PLUGY_VERSION "11.01" #define LOG_FILE "PlugY.log" enum TargetMod { MOD_NO = 0, }; // Global variable (user parameters) extern char* modDataDirectory; extern bool active_plugin; extern bool active_DisableBattleNet; extern bool active_CheckMemory; extern char* dllFilenames; extern bool active_D2Mod; extern TargetMod selectModParam; void loadParameters(); /*================================= END OF FILE =================================*/
/* * GPInstruct - Programmed Instruction * Copyright (C) 2011-2012 Arnel A. Borja <kyoushuu@yahoo.com> * * 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 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 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, see <http://www.gnu.org/licenses/>. */ /* GtkSwitch widget implementation for GTK+ 2.x */ #include <config.h> #include <gtk/gtk.h> #if GTK_MAJOR_VERSION < 3 #include "gtk-switch.h" G_DEFINE_TYPE (GtkSwitch, gtk_switch, GTK_TYPE_TOGGLE_BUTTON); static void gtk_switch_init (GtkSwitch *object) { } static void gtk_switch_finalize (GObject *object) { G_OBJECT_CLASS (gtk_switch_parent_class)->finalize (object); } static void gtk_switch_class_init (GtkSwitchClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); /*GtkToggleButtonClass *parent_class = GTK_TOGGLE_BUTTON_CLASS (klass);*/ object_class->finalize = gtk_switch_finalize; } static void gtk_switch_activate (GtkToggleButton *togglebutton, gpointer user_data) { gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton)); gtk_button_set_label (GTK_BUTTON (togglebutton), active? GTK_STOCK_YES:GTK_STOCK_NO); } GtkWidget * gtk_switch_new (void) { GtkSwitch *sw = g_object_new (GTK_TYPE_SWITCH, NULL); g_signal_connect (GTK_TOGGLE_BUTTON (sw), "toggled", G_CALLBACK (gtk_switch_activate), NULL); g_object_set (sw, "use-stock", TRUE, "label", GTK_STOCK_NO, "active", FALSE, NULL); return GTK_WIDGET (sw); } void gtk_switch_set_active (GtkSwitch *sw, gboolean is_active) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sw), is_active); } gboolean gtk_switch_get_active (GtkSwitch *sw) { return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sw)); } #endif
/* * This file is part of uGB * Copyright (C) 2017 Alexandre Monti * * 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 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 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, see <http://www.gnu.org/licenses/>. */ #ifndef __UGB_OPCODES_H__ #define __UGB_OPCODES_H__ #include <stdint.h> #include <unistd.h> struct ugb_cpu; typedef struct ugb_opcode { uint16_t code; const char* mnemonic; uint8_t size; uint8_t cycles; const char* flags; int(*microcode)(struct ugb_cpu*, uint8_t[], size_t*); } ugb_opcode; extern ugb_opcode ugb_opcodes_table[]; extern ugb_opcode ugb_opcodes_tableCB[]; ssize_t ugb_read_opcode(uint8_t* buf, ugb_gbm* gbm, uint16_t addr); ssize_t ugb_disassemble(char* str, size_t size, uint8_t* code, ssize_t addr); #endif // __UGB_OPCODES_H__
////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2003, The Institute for Genomic Research (TIGR), Rockville, // Maryland, U.S.A. All rights reserved. ////////////////////////////////////////////////////////////////////////////// #ifndef IGR_H #define IGR_H #include "GeneModelType.h" /** * <b>Responsibilities:</b><br> * instance of a <i>GeneModelType</i>. Defines the behavior<br> * of a "single" exon.<br> * <br> * <b>Collaborator:</b><br> * GeneModelType */ class Igr : public GeneModelType { protected: Igr(); public: void print(std::ostream&,const string&) const; const int getScoreIdx() const { return 5; } const string& getTypeStr() const; static const Igr& getInstance() { return _igr; }; private: static Igr _igr; /** * @link * @shapeType PatternLink * @pattern Igrton * @supplierRole Igrton factory */ /*# Igr _single1; */ }; #endif // IGR_H
#ifndef _MISC_ #define _MISC_ u32 get_rtc_time(); void _putch(char ch); char _getch(); int _kbhit(); void puts(char *msg); int isdigit(int c); char *strncpy(char *dest, const char *src, int c); int isspace(int c); int tolower(int c); unsigned long strtoull (const char *str, char **end, int base); void fillchar (const char ch, int n); void printf (const char *fmt, ...); void print_dword(u32 val); #endif
#include <stdio.h> #include <math.h> /* https://www.urionlinejudge.com.br/judge/en/problems/view/1015 Read the four values corresponding to the x and y axes of two points in the plane, p1 (x1, y1) and p2 (x2, y2) and calculate the distance between them, showing four decimal places after the comma, according to the formula: Distance = https://urionlinejudge.r.worldssl.net/gallery/images/problems/UOJ_1015.png # Input # The input file contains two lines of data. The first one contains two double values: x1 y1 and the second one also contains two double values with one digit after the decimal point: x2 y2. # Output # Calculate and print the distance value using the provided formula, with 4 digits after the decimal point. */ struct point { double x; double y; }; int main(int argc, char const *argv[]) { struct point a; struct point b; scanf("%lf %lf", &a.x, &a.y); scanf("%lf %lf", &b.x, &b.y); double distance = sqrt( pow(b.x - a.x, 2) + pow(b.y - a.y, 2) ); printf("%.4f\n", distance); return 0; }
#ifndef LOADERDATAFILEPAGE_H #define LOADERDATAFILEPAGE_H #include<QtWidgets> #include<QWizardPage> #include<QLabel> #include<vector> #include"loaderwizard.h" #include<QMetaType> Q_DECLARE_METATYPE(QItemSelectionModel*) class LoaderDataFilePage : public QWizardPage { Q_OBJECT Q_PROPERTY(QItemSelectionModel* selectionModel READ selectionModel) public: LoaderDataFilePage(QWidget *parent = 0); int nextId() const; //bool validatePage(); bool checkForDelimiters(int _count_line,QString &word, QString _dataDelimiter,QString _textDelimiter,QChar character = 0); void process_line(const QString &); QItemSelectionModel * selectionModel(void) { return headerview->selectionModel(); } protected: using QWizardPage::isComplete; bool isComplete() const; void cleanupPage(); private: QStandardItemModel * model; QTableView * headerview; QPushButton * browseButton; QPushButton * loadButton; QSpinBox * ignoring_lines_button; QLabel * ignoring_lines_label; QString fileName; QLabel *Filename; QLineEdit *FilenameLineEdit; QLabel *dataDelimiter; QComboBox * selectDataDelimiter; QLabel *textDelimiter; QComboBox * selectTextDelimiter; std::vector<std::vector<QString> *> * tmpvec; int validated_counter; signals: //void data_loaded(std::vector<std::vector<QString> *> * _vectorData); private slots: void validate_page(QModelIndex); void load_file(); void improved_load_file(); void open_file(); }; #endif // LOADERDATAFILEPAGE_H
/** * Marlin 3D Printer Firmware * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * 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 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 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, see <https://www.gnu.org/licenses/>. * */ #pragma once /** * Arduino Mega or Due with RAMPS Duo pin assignments * * Applies to the following boards: * * RAMPS_DUO_EFB (Hotend, Fan, Bed) * RAMPS_DUO_EEB (Hotend0, Hotend1, Bed) * RAMPS_DUO_EFF (Hotend, Fan0, Fan1) * RAMPS_DUO_EEF (Hotend0, Hotend1, Fan) * RAMPS_DUO_SF (Spindle, Controller Fan) * * Differences between * RAMPS_14 | RAMPS_DUO * A9/D63 | A12/D66 * A10/D64 | A13/D67 * A11/D65 | A14/D68 * A12/D66 | A15/D69 * A13 | A9 * A14 | A10 * A15 | A11 */ #if !defined(__SAM3X8E__) && !defined(__AVR_ATmega2560__) #error "Oops! Select 'Arduino Due' or 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif #define BOARD_INFO_NAME "RAMPS Duo" #define IS_RAMPS_DUO #include "../ramps/pins_RAMPS.h" // // Temperature Sensors // #undef TEMP_0_PIN #define TEMP_0_PIN 9 // Analog Input #undef TEMP_1_PIN #define TEMP_1_PIN 11 // Analog Input #undef TEMP_BED_PIN #define TEMP_BED_PIN 10 // Analog Input // SPI for Max6675 or Max31855 Thermocouple #undef MAX6675_SS_PIN #if DISABLED(SDSUPPORT) #define MAX6675_SS_PIN 69 // Don't use 53 if using Display/SD card #else #define MAX6675_SS_PIN 69 // Don't use 49 (SD_DETECT_PIN) #endif // // LCD / Controller // #if HAS_SPI_LCD #if BOTH(NEWPANEL, PANEL_ONE) #undef LCD_PINS_D4 #define LCD_PINS_D4 68 #undef LCD_PINS_D5 #define LCD_PINS_D5 69 #undef LCD_PINS_D7 #define LCD_PINS_D7 67 #endif #if ENABLED(NEWPANEL) #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #undef BTN_EN1 #define BTN_EN1 67 #undef BTN_ENC #define BTN_ENC 66 #elif ENABLED(MINIPANEL) #undef DOGLCD_CS #define DOGLCD_CS 69 #undef LCD_BACKLIGHT_PIN #define LCD_BACKLIGHT_PIN 68 // backlight LED on A14/D68 #undef KILL_PIN #define KILL_PIN 67 #undef BTN_EN2 #define BTN_EN2 66 #else #if ENABLED(REPRAPWORLD_KEYPAD) #undef BTN_EN1 #define BTN_EN1 67 // encoder #undef BTN_ENC #define BTN_ENC 66 // enter button #elif ENABLED(PANEL_ONE) #undef BTN_EN2 #define BTN_EN2 66 // AUX2 PIN 4 #endif #endif #endif // NEWPANEL #endif // HAS_SPI_LCD
#include "../../../../../src/render/framegraph/qbuffercapture_p.h"
#ifndef __MYEVIC_H__ #define __MYEVIC_H__ #include "M451Series.h" #include "myprintf.h" #include "dtmacros.h" //========================================================================= #define __myevic__ __attribute__ ((section (".myevic"))) //------------------------------------------------------------------------- #define CPU_FREQ 72000000 #define PLL_FREQ (CPU_FREQ<<1) #define BBC_PWM_FREQ 150000 #define ENABLE_UART 0 //------------------------------------------------------------------------- #define ISMODETC(m) ((m)<=3) #define ISMODEVW(m) (((m)==4)||((m)==6)) #define ISMODEBY(m) ((m)==5) //------------------------------------------------------------------------- #define FWVERSION 330 #define __BUILD1 ( __DAY__ + __MONTH__ * 100 + ( __YEAR__ % 100 ) * 10000 ) #define __BUILD2 ( __DAY__ % 10 + ( __DAY__ / 10 << 4 ) \ + ( __MONTH__ % 10 << 8 ) + ( __MONTH__ / 10 << 12 ) \ + ( __YEAR__ % 10 << 16 ) + ( __YEAR__ / 10 % 10 << 20 ) ) #define __BUILD3 ( ( __YEAR__ % 100 ) + ( __MONTH__ << 8 ) + ( __DAY__ << 16 ) ) //------------------------------------------------------------------------- //------------------------------------------------------------------------- enum { BOX_VTCMINI, BOX_VTWOMINI, BOX_VTWO, BOX_PRESA75W, BOX_WRX75TC, BOX_PRESA100W, BOX_EVICAIO, BOX_EGRIPII, BOX_CUBOMINI, BOX_EVICBASIC, BOX_VTCDUAL, BOX_CUBOID, BOX_CUBO200, BOX_RX200S, BOX_RX23, BOX_RX300, BOX_RXMINI }; #define ISVTCMINI (BoxModel==BOX_VTCMINI) #define ISVTWOMINI (BoxModel==BOX_VTWOMINI) #define ISVTWO (BoxModel==BOX_VTWO) #define ISPRESA75W (BoxModel==BOX_PRESA75W) #define ISPRESA100W (BoxModel==BOX_PRESA100W) #define ISWRX75TC (BoxModel==BOX_WRX75TC) #define ISEVICAIO (BoxModel==BOX_EVICAIO) #define ISEGRIPII (BoxModel==BOX_EGRIPII) #define ISCUBOMINI (BoxModel==BOX_CUBOMINI) #define ISEVICBASIC (BoxModel==BOX_EVICBASIC) #define ISVTCDUAL (BoxModel==BOX_VTCDUAL) #define ISCUBOID (BoxModel==BOX_CUBOID) #define ISCUBO200 (BoxModel==BOX_CUBO200) #define ISRX200S (BoxModel==BOX_RX200S) #define ISRX23 (BoxModel==BOX_RX23) #define ISRX300 (BoxModel==BOX_RX300) #define ISRXMINI (BoxModel==BOX_RXMINI) //========================================================================= // Global flags bitfield //------------------------------------------------------------------------- typedef struct { /* 00000001 */ int tick_5khz:1; /* 00000002 */ int tick_1khz:1; /* 00000004 */ int tick_us:1; /* 00000008 */ int tick_100hz:1; /* 00000010 */ int tick_10hz:1; /* 00000020 */ int tick_5hz:1; /* 00000040 */ int tick_2hz:1; /* 00000080 */ int read_battery:1; /* 00000100 */ int firing:1; /* 00000200 */ int low_battery:1; /* 00000400 */ int usb_attached:1; /* 00000800 */ int refresh_battery:1; /* 00001000 */ int battery_charging:1; /* 00002000 */ int probing_ato:1; /* 00004000 */ int user_idle:1; /* 00008000 */ int sample_vbat:1; /* 00010000 */ int sample_btemp:1; /* 00020000 */ int refresh_display:1; /* 00040000 */ int draw_edited_item:1; /* 00080000 */ int battery_10pc:1; /* 00100000 */ int draw_battery:1; /* 00200000 */ int draw_battery_charging:1; /* 00400000 */ int decrease_voltage:1; /* 00800000 */ int check_mode:1; /* 01000000 */ int unused24:1; /* 02000000 */ int unused25:1; /* 04000000 */ int limit_ato_temp:1; /* 08000000 */ int new_rez_ti:1; /* 10000000 */ int new_rez_ni:1; /* 20000000 */ int limit_power:1; /* 40000000 */ int batteries_ooe:1; /* 80000000 */ int new_rez_ss:1; /* 00000001 */ int edit_value:1; /* 00000002 */ int new_rez_tcr:1; /* 00000004 */ int unused34:1; /* 00000008 */ int bad_cell:1; /* 00000010 */ int edit_capture_evt:1; /* 00000020 */ int osc_1hz:1; /* 00000040 */ int unused38:1; /* 00000080 */ int batt_unk:1; /* 00000100 */ int tick_1hz:1; /* 00000200 */ int playing_fb:1; /* 00000400 */ int has_x32:1; /* 00000800 */ int unused43:1; /* 00001000 */ int debug:1; /* 00002000 */ int noclock:1; /* 00004000 */ int read_bir:1; /* 00008000 */ int monitoring:1; /* 00010000 */ int anim3d:1; /* 00020000 */ int pwm_pll:1; /* 00040000 */ int rtcinit:1; /* 00080000 */ int light_sleep:1; /* 00100000 */ int wake_up:1; /* 00200000 */ int fading:1; /* 00400000 */ int led_on:1; /* 00800000 */ int splash:1; /* 01000000 */ int playing_tt:1; } gFlags_t; extern volatile gFlags_t gFlags; extern uint8_t BoxModel; //========================================================================= // Functions from assembly language part //------------------------------------------------------------------------- extern void MemCpy( void*, const void*, const uint32_t ); extern void MemCpy2( const void*, void*, const uint32_t ); extern void MemClear( void*, const uint32_t ); extern void MemClear2( void*, void*, const uint32_t ); extern void MemSet( void*, const char, const uint32_t ); extern void DrawHexDigit( int x, int y, int v ); extern void DrawHexLong( int x, int y, int v, int font ); //------------------------------------------------------------------------- extern uint32_t sqrtul( uint32_t v ); extern uint32_t GetFirmwareSize(); //========================================================================= #endif /* __MYEVIC_H__ */
/* * Cantata * * Copyright (c) 2011-2022 Craig Drummond <craig.p.drummond@gmail.com> * * ---- * * 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; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef NOTIFY_H #define NOTIFY_H #include <QObject> #include <QDateTime> class QImage; class QDBusPendingCallWatcher; class QDBusArgument; class OrgFreedesktopNotificationsInterface; QDBusArgument& operator<< (QDBusArgument &arg, const QImage &image); const QDBusArgument& operator>> (const QDBusArgument &arg, QImage &image); class Notify : public QObject { Q_OBJECT public: Notify(QObject *p); ~Notify() override { } enum Urgency { DefaultUrgency = -1, LowUrgency, NormalUrgency, CriticalUrgency }; void show(const QString &title, const QString &text, const QImage &img, Urgency urgency = DefaultUrgency); private Q_SLOTS: void callFinished(QDBusPendingCallWatcher *watcher); private: QDateTime lastTime; int lastId; OrgFreedesktopNotificationsInterface *iface; }; #endif
/* $Id: strtoupp.c,v 1.1.1.1 2006/09/14 01:59:06 root Exp $ */ /* * Copyright (c) 2000-2002 Opsycon AB (www.opsycon.se) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Opsycon AB. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #include <string.h> #include <ctype.h> void strtoupper(char *p) { if(!p) return; for (; *p; p++) *p = toupper (*p); }
// Copyright 2020 ETH Zurich. All Rights Reserved. #pragma once #include <mirheo/core/datatypes.h> #include <mirheo/core/utils/quaternion.h> #define RIGID_MOTIONS_DOUBLE namespace mirheo { #ifdef RIGID_MOTIONS_DOUBLE using RigidReal = double; ///< precision used for rigid states #else using RigidReal = float; ///< precision used for rigid states #endif using RigidReal3 = vec_traits::Vec<RigidReal, 3>::Type; ///< real3 using RigidReal4 = vec_traits::Vec<RigidReal, 4>::Type; ///< real4 using RigiQuaternion = Quaternion<RigidReal>; ///< quaternion /** \brief Holds the state of a rigid object A rigid object state is defined by its position and orientation as well as linear and angular velocities. For convenience, the force and torque are also stored in this structure. */ template <class RealType> struct __align__(16) TemplRigidMotion { /// real3 using R3 = typename vec_traits::Vec<RealType, 3>::Type; R3 r; ///< position of the center of mass Quaternion<RealType> q; ///< orientation R3 vel; ///< linear velocity R3 omega; ///< angular velocity R3 force; ///< force R3 torque; ///< torque }; using DoubleRigidMotion = TemplRigidMotion<double>; ///< Rigid state in double precision using RealRigidMotion = TemplRigidMotion<real>; ///< Rigid state in real precision using RigidMotion = TemplRigidMotion<RigidReal>; ///< Rigid state in RigidReal precision } // namespace mirheo
character*6 paraname(Pee,1:5) common /ltparanames/ paraname character*10 coeffname(Nee,1:5) common /ltcoeffnames/ coeffname
/* * This file is part of ROCKCLOCK firmware. * * Copyright (c) 2015 Alexander KΓΌhn <prj@alexkuehn.de> * * 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 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 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, see <http://www.gnu.org/licenses/>. */ #ifndef SRC_APP_CLOCK_CONFIG_H_ #define SRC_APP_CLOCK_CONFIG_H_ /* external standard includes */ /* external includes */ /* project includes */ /* component includes */ #define CFG_DBG_DCF_BINARY 0 /**< debug: display decoded DCF frame */ #define CFG_CLOCK_DISP_ROTATE 15 /**< rotation of display elements */ #endif /* SRC_APP_CLOCK_CONFIG_H_ */
/* * Context switch. * * Copyright (C) 2003 Juha Aatrokoski, Timo Lilja, * Leena Salmela, Teemu Takanen, Aleksi Virtanen. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $Id: asm.h,v 1.3 2003/02/10 08:45:34 lsalmela Exp $ * */ #ifndef KERNEL_ASM_H #define KERNEL_ASM_H #include "lib/registers.h" /* Get cpu number into register reg. */ #define _FETCH_CPU_NUM(reg) \ mfc0 reg, PRId, 0; \ srl reg, reg, 24; #endif /* KERNEL_ASM_H */
/****************************************************************************/ /// @file NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 /// @version $Id: NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h 13811 2013-05-01 20:31:43Z behrisch $ /// // /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. // SUMO 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. // /****************************************************************************/ #ifndef NIVissimSingleTypeParser_Reisezeitmessungsdefinition_h #define NIVissimSingleTypeParser_Reisezeitmessungsdefinition_h // =========================================================================== // included modules // =========================================================================== #ifdef _MSC_VER #include <windows_config.h> #else #include <config.h> #endif #include <iostream> #include "../NIImporter_Vissim.h" // =========================================================================== // class definitions // =========================================================================== /** * @class NIVissimSingleTypeParser_Reisezeitmessungsdefinition * */ class NIVissimSingleTypeParser_Reisezeitmessungsdefinition : public NIImporter_Vissim::VissimSingleTypeParser { public: /// Constructor NIVissimSingleTypeParser_Reisezeitmessungsdefinition(NIImporter_Vissim& parent); /// Destructor ~NIVissimSingleTypeParser_Reisezeitmessungsdefinition(); /// Parses the data type from the given stream bool parse(std::istream& from); }; #endif /****************************************************************************/
#pragma once #ifndef __AVX__ #error "Please enable AVX support" #endif #define __out #include <cassert> namespace SIMD { enum {WIDTH = 4}; typedef double _v4df __attribute__((vector_size(32))); struct dvec { _v4df val; dvec() {} dvec(_v4df _val) : val(_val) {}; dvec(const double f) : val((_v4df){f,f,f,f}) {} dvec(const double a, const double b, const double c, const double d) : val((_v4df){a,b,c,d}) {} dvec(const double *p, const bool aligned = true) : val(aligned ? *(_v4df*)p : __builtin_ia32_loadupd256(p)) {} operator _v4df() const {return val;} const dvec& operator =(const dvec a) {val = a.val; return *this;} const dvec& operator+=(const dvec a) {val += a.val; return *this;} const dvec& operator-=(const dvec a) {val -= a.val; return *this;} const dvec& operator*=(const dvec a) {val *= a.val; return *this;} const dvec& operator/=(const dvec a) {val /= a.val; return *this;} const dvec operator -() const {return dvec(-val);} const dvec operator +(const dvec a) const {return dvec(val + a.val);} const dvec operator -(const dvec a) const {return dvec(val - a.val);} const dvec operator *(const dvec a) const {return dvec(val * a.val);} const dvec operator /(const dvec a) const {return dvec(val / a.val);} operator bool() const {return true;} const dvec operator!=(const dvec a) const { return dvec(__builtin_ia32_cmppd256(val, a.val, 28)); } #if 0 const dvec operator==(const dvec a) const { return dvec(__builtin_ia32_cmpeqpd(val, a.val)); } const dvec operator<(const dvec &rhs) const{ return __builtin_ia32_cmpltpd(val, rhs.val); } const dvec operator<=(const dvec &rhs) const{ return __builtin_ia32_cmplepd(val, rhs.val); } const dvec operator>(const dvec &rhs) const{ return __builtin_ia32_cmpgtpd(val, rhs.val); } const dvec operator>=(const dvec &rhs) const{ return __builtin_ia32_cmpgepd(val, rhs.val); } const dvec operator|(const dvec &rhs) const{ return __builtin_ia32_orpd(val, rhs.val); } const dvec operator&(const dvec &rhs) const{ return __builtin_ia32_andpd(val, rhs.val); } #endif const double operator[] (const int i) const { union {_v4df v; double s[4];} test; test.v = val; return test.s[i]; #if 0 switch(i) { case 0: return __builtin_ia32_vec_ext_v4df(val, 0); case 1: return __builtin_ia32_vec_ext_v4df(val, 1); case 2: return __builtin_ia32_vec_ext_v4df(val, 2); case 3: return __builtin_ia32_vec_ext_v4df(val, 3); default: assert(0); } #endif } }; inline static void transpose( const dvec v0, const dvec v1, const dvec v2, const dvec v3, dvec &t0, dvec &t1, dvec &t2, dvec &t3) { #if 0 const _v4df a0 = __builtin_ia32_unpcklpd256(v0, v2); const _v4df a1 = __builtin_ia32_unpckhpd256(v0, v2); const _v4df a2 = __builtin_ia32_unpcklpd256(v1, v3); const _v4df a3 = __builtin_ia32_unpckhpd256(v1, v3); t0 = __builtin_ia32_unpcklpd256(a0, a2); t1 = __builtin_ia32_unpckhpd256(a0, a2); t2 = __builtin_ia32_unpcklpd256(a1, a3); t3 = __builtin_ia32_unpckhpd256(a1, a3); #else const _v4df a0 = __builtin_ia32_unpcklpd256(v0, v1); const _v4df a1 = __builtin_ia32_unpckhpd256(v0, v1); const _v4df a2 = __builtin_ia32_unpcklpd256(v2, v3); const _v4df a3 = __builtin_ia32_unpckhpd256(v2, v3); t0 = __builtin_ia32_vperm2f128_pd256(a0, a2, 0x20); t1 = __builtin_ia32_vperm2f128_pd256(a1, a3, 0x20); t2 = __builtin_ia32_vperm2f128_pd256(a0, a2, 0x31); t3 = __builtin_ia32_vperm2f128_pd256(a1, a3, 0x31); #endif } template<const int N> inline static void transpose(dvec *d) { if (N == 1) { transpose(d[0], d[1], d[2], d[3], d[0], d[1], d[2], d[3]); } else if (N == 2) { const dvec m11[4] = {d[0], d[ 2], d[ 4], d[ 6]}; const dvec m12[4] = {d[1], d[ 3], d[ 5], d[ 7]}; const dvec m21[4] = {d[8], d[10], d[12], d[14]}; const dvec m22[4] = {d[9], d[11], d[13], d[15]}; transpose(m11[0], m11[1], m11[2], m11[3], d[0], d[ 2], d[ 4], d[ 6]); transpose(m21[0], m21[1], m21[2], m21[3], d[1], d[ 3], d[ 5], d[ 7]); transpose(m12[0], m12[1], m12[2], m12[3], d[8], d[10], d[12], d[14]); transpose(m22[0], m22[1], m22[2], m22[3], d[9], d[11], d[13], d[15]); } else assert(N == 1); } template<class T> inline static void sstore(T &ptr, const dvec val) { __builtin_ia32_movntpd256((double*)&ptr, val); } template<const bool ALIGN, typename T> inline static dvec store(T &ptr, const dvec val) { if (ALIGN) { *(_v4df*)&ptr = val; } else { __builtin_ia32_storeupd256((double*)&ptr, val); } return val; } template<const bool ALIGN, typename T> inline static dvec load(const T &ptr) { return dvec((double*)&ptr, ALIGN); } template<const int N> inline static dvec broadcast(const dvec x) { const int mask = N == 0 ? (0 << 0) + (0 << 1) + (0 << 2) + (0 << 3) : N == 1 ? (1 << 0) + (1 << 1) + (0 << 2) + (0 << 3) : N == 2 ? (0 << 0) + (0 << 1) + (0 << 2) + (0 << 3) : (0 << 0) + (0 << 1) + (1 << 2) + (1 << 3); const dvec y = __builtin_ia32_shufpd256(x, x, mask); if (N < 2) return __builtin_ia32_vperm2f128_pd256(y, y, (0 << 0) + (0 << 4)); else return __builtin_ia32_vperm2f128_pd256(y, y, (1 << 0) + (1 << 4)); } typedef dvec real; } #define LDA(x) (SIMD::load<true >(x)) #define LDU(x) (SIMD::load<false>(x)) #define STU(x,y) (SIMD::store<false>(x, y)) #define STA(x) (*(SIMD::real*)&x)
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* Sonic Visualiser An audio file viewer and annotation editor. Centre for Digital Music, Queen Mary, University of London. This file copyright 2006 Chris Cannam and QMUL. 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. See the file COPYING included with this distribution for more information. */ #ifndef _REAL_TIME_EFFECT_TRANSFORMER_H_ #define _REAL_TIME_EFFECT_TRANSFORMER_H_ #include "ModelTransformer.h" #include "plugin/RealTimePluginInstance.h" class DenseTimeValueModel; class RealTimeEffectModelTransformer : public ModelTransformer { public: RealTimeEffectModelTransformer(Input input, const Transform &transform); virtual ~RealTimeEffectModelTransformer(); protected: virtual void run(); QString m_units; RealTimePluginInstance *m_plugin; int m_outputNo; // just casts DenseTimeValueModel *getConformingInput(); }; #endif
/* news-link.c * * Copyright (C) 2011 Christian Hergert <chris@dronelabs.com> * * 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 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 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, see <http://www.gnu.org/licenses/>. */ #include <glib/gi18n.h> #include "news-debug.h" #include "news-link.h" G_DEFINE_TYPE(NewsLink, news_link, GOM_TYPE_RESOURCE) /** * news_link_class_init: * @klass: (in): A #NewsLinkClass. * * Initializes the #NewsLinkClass and prepares the vtable. * * Returns: None. * Side effects: None. */ static void news_link_class_init (NewsLinkClass *klass) { GObjectClass *object_class; GomResourceClass *resource_class; ENTRY; object_class = G_OBJECT_CLASS(klass); object_class->get_property = gom_resource_get_property; object_class->set_property = gom_resource_set_property; resource_class = GOM_RESOURCE_CLASS(klass); gom_resource_class_table(resource_class, "links"); gom_resource_class_install_property( resource_class, g_param_spec_int64("id", _("Id"), _("The link identifier"), 0, G_MAXINT64, 0, G_PARAM_READWRITE), "key", TRUE, "serial", TRUE, NULL); gom_resource_class_install_property( resource_class, g_param_spec_string("base-uri", _("Base URI"), _("The base uri of the link"), NULL, G_PARAM_READWRITE), NULL); gom_resource_class_install_property( resource_class, g_param_spec_string("href", _("Href"), _("The link href"), NULL, G_PARAM_READWRITE), NULL); gom_resource_class_install_property( resource_class, g_param_spec_int64("length", _("Length"), _("The length of the content"), G_MININT64, G_MAXINT64, 0UL, G_PARAM_READWRITE), NULL); gom_resource_class_install_property( resource_class, g_param_spec_string("media-type", _("Media Type"), _("The link media type"), NULL, G_PARAM_READWRITE), NULL); gom_resource_class_install_property( resource_class, g_param_spec_string("relation", _("Relation"), _("The link relation"), NULL, G_PARAM_READWRITE), NULL); gom_resource_class_install_property( resource_class, g_param_spec_string("title", _("Title"), _("The link title"), NULL, G_PARAM_READWRITE), NULL); EXIT; } /** * news_link_init: * @: (in): A #NewsLink. * * Initializes the newly created #NewsLink instance. * * Returns: None. * Side effects: None. */ static void news_link_init (NewsLink *link_) { ENTRY; EXIT; }
/* func_ulog_t0cst_nd.c --- * * Filename: func_ulog_t0cst_nd.c * Author: Alexandre BIGUET * Created: Sun Mar 12 19:28:37 2017 (+0100) * Last-Updated: Sun Mar 12 19:28:41 2017 (+0100) * By: Alexandre BIGUET * Update #: 1 * * */ #include <utils/utils.h> #include <methnum/methnum.h> #include <param/model_param.h> #include "func.h" double func_dPhi_ulog_t0cst_num ( Model_param_t *Mp ) { double func ( double Phi ) { Model_param_Var_set_Phi ( Mp, Phi ); return func_ulog_t0cst (Mp); } double res, err ; int status = deriv ( Mp->M, DERIV_CENTRAL, func, Mp->Var->Phi, &res, &err ); if ( status ) WARNING(stdout,"num der failed (%d:%s) " " (res:%f) (err:%f) ",status, gsl_strerror(status), res, err ); return res ; } double func_dT_ulog_t0cst_num ( Model_param_t *Mp ) { double func ( double T ) { Model_param_Var_set_T ( Mp, T ); return func_ulog_t0cst (Mp); } double res, err ; int status = deriv ( Mp->M, DERIV_CENTRAL, func, Mp->Var->T, &res, &err ); if ( status ) WARNING(stdout,"num der failed (%d:%s) " " (res:%f) (err:%f) ",status, gsl_strerror(status), res, err ); return res ; } double func_dPhi_dPhi_ulog_t0cst_num(Model_param_t *Mp ) { double func ( double Phi ) { Model_param_Var_set_Phi ( Mp, Phi ); return func_dPhi_ulog_t0cst (Mp); } double res, err ; int status = deriv ( Mp->M, DERIV_CENTRAL, func, Mp->Var->Phi, &res, &err ); if ( status ) WARNING(stdout,"num der failed (%d:%s) " " (res:%f) (err:%f) ",status, gsl_strerror(status), res, err ); return res ; } double func_dPhi_dT_ulog_t0cst_num(Model_param_t *Mp ) { double func ( double Phi ) { Model_param_Var_set_Phi ( Mp, Phi ); return func_dT_ulog_t0cst (Mp); } double res, err ; int status = deriv ( Mp->M, DERIV_CENTRAL, func, Mp->Var->Phi, &res, &err ); if ( status ) WARNING(stdout,"num der failed (%d:%s) " " (res:%f) (err:%f) ",status, gsl_strerror(status), res, err ); return res ; } double func_dT_dT_ulog_t0cst_num(Model_param_t *Mp ) { double func ( double T ) { Model_param_Var_set_T ( Mp, T ); return func_dT_ulog_t0cst (Mp); } double res, err ; int status = deriv ( Mp->M, DERIV_CENTRAL, func, Mp->Var->T, &res, &err ); if ( status ) WARNING(stdout,"num der failed (%d:%s) " " (res:%f) (err:%f) ",status, gsl_strerror(status), res, err ); return res ; } double func_dPhi_dPhi_dPhi_ulog_t0cst_num(Model_param_t *Mp ) { double func ( double Phi ) { Model_param_Var_set_Phi ( Mp, Phi ); return func_dPhi_dPhi_ulog_t0cst (Mp); } double res, err ; int status = deriv ( Mp->M, DERIV_CENTRAL, func, Mp->Var->Phi, &res, &err ); if ( status ) WARNING(stdout,"num der failed (%d:%s) " " (res:%f) (err:%f) ",status, gsl_strerror(status), res, err ); return res ; } double func_dPhi_dPhi_dT_ulog_t0cst_num(Model_param_t *Mp ) { double func ( double Phi ) { Model_param_Var_set_Phi ( Mp, Phi ); return func_dPhi_dT_ulog_t0cst (Mp); } double res, err ; int status = deriv ( Mp->M, DERIV_CENTRAL, func, Mp->Var->Phi, &res, &err ); if ( status ) WARNING(stdout,"num der failed (%d:%s) " " (res:%f) (err:%f) ",status, gsl_strerror(status), res, err ); return res ; } double func_dPhi_dT_dT_ulog_t0cst_num(Model_param_t *Mp ) { double func ( double Phi ) { Model_param_Var_set_Phi ( Mp, Phi ); return func_dT_dT_ulog_t0cst (Mp); } double res, err ; int status = deriv ( Mp->M, DERIV_CENTRAL, func, Mp->Var->Phi, &res, &err ); if ( status ) WARNING(stdout,"num der failed (%d:%s) " " (res:%f) (err:%f) ",status, gsl_strerror(status), res, err ); return res ; } double func_dT_dT_dT_ulog_t0cst_num(Model_param_t *Mp ) { double func ( double T ) { Model_param_Var_set_T ( Mp, T ); return func_dT_dT_ulog_t0cst (Mp); } double res, err ; int status = deriv ( Mp->M, DERIV_CENTRAL, func, Mp->Var->T, &res, &err ); if ( status ) WARNING(stdout,"num der failed (%d:%s) " " (res:%f) (err:%f) ",status, gsl_strerror(status), res, err ); return res ; } /* func_ulog_t0cst_nd.c ends here */
/************************************************************************** ** ** Copyright (C) 2013 by Philip Schuchardt ** www.cavewhere.com ** **************************************************************************/ #ifndef CWNOTEINTERACTION_H #define CWNOTEINTERACTION_H //Our includes class cwNote; #include "cwBasePanZoomInteraction.h" class cwNoteInteraction : public cwInteraction { Q_OBJECT Q_PROPERTY(cwNote* note READ note WRITE setNote NOTIFY noteChanged) public: explicit cwNoteInteraction(QQuickItem *parent = 0); void setNote(cwNote* note); cwNote* note() const; signals: void noteChanged(); public slots: private: cwNote* Note; }; /** Sets the note that this interaction will modify */ inline cwNote* cwNoteInteraction::note() const { return Note; } #endif // CWNOTEINTERACTION_H
/* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * Copyright (C) 2011-2017 - Daniel De Matteis * * RetroArch 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 Found- * ation, either version 3 of the License, or (at your option) any later version. * * RetroArch 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 RetroArch. * If not, see <http://www.gnu.org/licenses/>. */ #if defined(__PSL1GHT__) || defined(__PS3__) #include "../defines/ps3_defines.h" #endif #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <retro_miscellaneous.h> #include <net/net_compat.h> #include <net/net_socket.h> #include "../verbosity.h" #if !defined(PC_DEVELOPMENT_IP_ADDRESS) #error "An IP address for the PC logging server was not set in the Makefile, cannot continue." #endif #if !defined(PC_DEVELOPMENT_UDP_PORT) #error "An UDP port for the PC logging server was not set in the Makefile, cannot continue." #endif /* TODO/FIXME - static global variables */ static int g_sid; static struct sockaddr_in target; void logger_init(void) { socket_target_t in_target; const char *server = PC_DEVELOPMENT_IP_ADDRESS; unsigned port = PC_DEVELOPMENT_UDP_PORT; if (!network_init()) { printf("Could not initialize network logger interface.\n"); return; } g_sid = socket_create( "ra_netlogger", SOCKET_DOMAIN_INET, SOCKET_TYPE_DATAGRAM, SOCKET_PROTOCOL_NONE); in_target.port = port; in_target.server = server; in_target.domain = SOCKET_DOMAIN_INET; socket_set_target(&target, &in_target); } void logger_shutdown(void) { if (socket_close(g_sid) < 0) printf("Could not close socket.\n"); network_deinit(); } void logger_send(const char *__format,...) { va_list args; va_start(args,__format); logger_send_v(__format, args); va_end(args); } void logger_send_v(const char *__format, va_list args) { static char sendbuf[4096]; int len; vsnprintf(sendbuf,4000,__format, args); len = strlen(sendbuf); sendto(g_sid, sendbuf, len, MSG_DONTWAIT, (struct sockaddr*)&target, sizeof(target)); }
/* * This file is part of EasyRPG Player. * * EasyRPG Player 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. * * EasyRPG Player 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 EasyRPG Player. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _SPRITE_BATTLER_H_ #define _SPRITE_BATTLER_H_ // Headers #include "sprite.h" #include "game_battler.h" struct FileRequestResult; /** * Sprite_Battler class, used for battle sprites */ class Sprite_Battler : public Sprite { public: enum AnimationState { AnimationState_Idle = 1, AnimationState_RightHand, AnimationState_LeftHand, AnimationState_SkillUse, AnimationState_Dead, AnimationState_Damage, AnimationState_BadStatus, AnimationState_Defending, AnimationState_WalkingLeft, AnimationState_WalkingRight, AnimationState_Victory, AnimationState_Item }; enum LoopState { LoopState_IdleAnimationAfterFinish, LoopState_LoopAnimation }; /** * Constructor. * * @param character game battler to display */ Sprite_Battler(Game_Battler* battler); ~Sprite_Battler(); /** * Updates sprite state. */ void Update(); Game_Battler* GetBattler() const; void SetBattler(Game_Battler* new_battler); void SetAnimationState(int state, LoopState loop = LoopState_LoopAnimation); /** * Returns true when the state is idle. * * @return Whether state is idle */ bool IsIdling(); protected: void CreateSprite(); void OnMonsterSpriteReady(FileRequestResult* result); void OnBattlercharsetReady(FileRequestResult* result, int battler_index); std::string sprite_name; int hue; Game_Battler* battler; BitmapRef graphic; int anim_state; int cycle; std::string sprite_file; int sprite_frame; int fade_out; int flash_counter; LoopState loop_state; bool old_hidden; }; #endif
// // ValueTracker.h // Quiz // // Created by Alexander Ignatenko on 9/20/13. // Copyright (c) 2013 Alexander Ignatenko. All rights reserved. // #import <UIKit/UIKit.h> @protocol ValueTracker; @protocol ValueTrackerDelegate <NSObject> - (void)valueTrackerDidTrackValue:(id<ValueTracker>)tracker; @end @protocol ValueTracker <NSObject> @property (nonatomic, readonly) id value; @property (copy, nonatomic) id tag; @property (weak, nonatomic) id<ValueTrackerDelegate> delegate; @end @protocol TextValueTracker <ValueTracker> @property (nonatomic, readonly) NSString *value; @end @interface TextViewValueTracker : NSObject <TextValueTracker, UITextViewDelegate> @property (nonatomic) BOOL onlyTrackDidEndEditing; @end /** Assign `TextFieldValueTracker` object as delegate of a text field to track did end editing events only. Pass text field to a `trackValueOfTextField:` method to track text did change events. */ @interface TextFieldValueTracker : NSObject <TextValueTracker, UITextFieldDelegate> // Has effect only when tracker is set as delegate of text field. Default is NO. @property (nonatomic) BOOL resignFirstResponderOnReturnKey; - (void)trackValueOfTextField:(UITextField *)textField; @end @interface ControlValueTracker : NSObject <ValueTracker> - (void)trackValueOfControl:(UIControl *)control forKey:(NSString *)key controlEvents:(UIControlEvents)events; @end
#pragma once #include <ios> class IosFlagSaver { public: explicit IosFlagSaver(std::ostream& _ios) : ios(_ios), f(_ios.flags()) { } ~IosFlagSaver() { ios.flags(f); } IosFlagSaver(const IosFlagSaver &rhs) = delete; IosFlagSaver& operator= (const IosFlagSaver& rhs) = delete; private: std::ostream& ios; std::ios::fmtflags f; };
//---------------------------------------------------------------------------- // XC program; finite element analysis code // for structural analysis and design. // // Copyright (C) Luis Claudio PΓ©rez Tato // // This program derives from OpenSees <http://opensees.berkeley.edu> // developed by the Β«Pacific earthquake engineering research centerΒ». // // Except for the restrictions that may arise from the copyright // of the original program (see copyright_opensees.txt) // XC 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. // // This software 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, see <http://www.gnu.org/licenses/>. //---------------------------------------------------------------------------- /* ****************************************************************** ** ** OpenSees - Open System for Earthquake Engineering Simulation ** ** Pacific Earthquake Engineering Research Center ** ** ** ** ** ** (C) Copyright 1999, The Regents of the University of California ** ** All Rights Reserved. ** ** ** ** Commercial use of this program without express permission of the ** ** University of California, Berkeley, is strictly prohibited. See ** ** file 'COPYRIGHT' in main directory for information on usage and ** ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. ** ** ** ** Developed by: ** ** Frank McKenna (fmckenna@ce.berkeley.edu) ** ** Gregory L. Fenves (fenves@ce.berkeley.edu) ** ** Filip C. Filippou (filippou@ce.berkeley.edu) ** ** ** ** ****************************************************************** */ // $Revision: 1.2 $ // $Date: 2003/02/14 23:01:36 $ // $Source: /usr/local/cvs/OpenSees/SRC/material/section/repres/cell/Cell.h,v $ // File: Cell.h // // Written by Remo M. de Souza // December 1998 #ifndef Cell_h #define Cell_h #include <iostream> #include <utility/matrix/Matrix.h> #include <utility/matrix/Vector.h> namespace XC { //! @ingroup MATSCCRepres //! //! @defgroup MATSCCCell Cells for cross-section discretization. // //! @ingroup MATSCCCell // //! @brief Base class for cells (cross-section discretization). class Cell { protected: Matrix vertCoord; Vector Centroid; void calcCentroidPosition(void); public: Cell(int numVert); explicit Cell(const Matrix &); virtual ~Cell(void) {} virtual Cell *getCopy(void) const= 0; void setVertCoords(const Matrix &vertexCoords); const Matrix &getVertCoords(void) const; virtual double getArea(void) const = 0; virtual const Vector &getCentroidPosition(void); virtual void Print(std::ostream &s, int flag =0) const = 0; friend std::ostream &operator<<(std::ostream &, const Cell &); }; std::ostream &operator<<(std::ostream &, const Cell &); } // end of XC namespace #endif
#include <stdio.h> #include <string.h> #include <gtk/gtk.h> #include "ui.h" #include "db.h" #if defined(_WIN32) || defined(WIN32) #include <direct.h> #define ChangeCurrentDir(x) _chdir(x) int GetCurrentDir(char * ownPth, size_t ownPth_size){ // Will contain exe path HMODULE hModule = GetModuleHandle(NULL); if (hModule != NULL){ // When passing NULL to GetModuleHandle, it returns handle of exe itself GetModuleFileName(hModule,ownPth, ownPth_size); int x = strlen(ownPth); bool found_before = false; while(x != 0){ if(ownPth[x] == '\\'){ ownPth[x] = '\0'; if(found_before) break; found_before = true; } --x; } return 1; }else{ return 0; } } #elif defined(__unix__) #include <unistd.h> #include <limits.h> #include <stdlib.h> #define min(a,b) \ ({ __typeof__ (a) _a = (a); \ __typeof__ (b) _b = (b); \ _a < _b ? _a : _b; }) #define ChangeCurrentDir(x) chdir(x) int GetCurrentDir(char * path, size_t path_size){ char tmp[256]; sprintf(tmp, "/proc/%d/exe", getpid()); ssize_t path_len = path_size - 1; int bytes = min(readlink(tmp, path, path_size), path_len); if(bytes > 0){ path[bytes] = '\0'; if(realpath(path, tmp)){ strcpy(path, tmp); } bool found_before = false; int x = strlen(path); while(x != 0){ if(path[x] == '/'){ path[x] = '\0'; if(found_before) break; found_before = true; } --x; } return bytes; } return 0; } #endif GtkBuilder * builder; int main(int argc, char * argv[]){ char home_dir[4096]; if(!GetCurrentDir(home_dir, 4096)){ wicherlog_err("Cannot get program directory!"); return -1; }else if(ChangeCurrentDir(home_dir)){ wicherlog_err("Cannot chdir to program directory!"); return -1; } gtk_init(&argc, &argv); builder = gtk_builder_new(); void window_set_default_icons(); if(!splash_init()){ wicherlog_err("Splash screen error. Exiting."); return -1; } if(!main_init()){ wicherlog_err("Main window error. Exiting."); return -1; } gtk_builder_connect_signals( builder, NULL ); splash_show(); //here starts the app gtk_main(); database_cleanup(); return 0; }
/** * @file native_functions_102.h * @brief Pointers to in game functions (NTSC 1.02) */ #ifndef MML_NATIVE_FUNCTIONS_102_H #define MML_NATIVE_FUNCTIONS_102_H /** Cast address to @c void* - make it a function pointer **/ #define VOID_PTR(x) ((void*) (x)) /************************* gamestate.h ************************/ /** u32 playerEntity(u32) */ #define PLAYER_ENTITY_FPTR VOID_PTR(0x80034110) /************************** random.h **************************/ /** u32 randInt(u32) */ #define RAND_INT_FPTR VOID_PTR(0x80380580) /************************** system.h **************************/ /** handle_t OSCreateHeap(void*, void*) */ #define OS_CREATE_HEAP_FPTR VOID_PTR(0x803440e8) /** void* OSAllocFromHeap(handle_t, size_t) */ #define OS_ALLOC_FROM_HEAP_FPTR VOID_PTR(0x80343ef0) /** void OSFreeToHeap(handle_t, void*) */ #define OS_FREE_TO_HEAP_FPTR VOID_PTR(0x80343fec) /************************** string.h **************************/ /** void* memchr(const void* ptr, int value, size_t num) */ #define MEM_CHR_FPTR VOID_PTR(0x8032390c) /** int memcmp(const void* ptr1, const void* ptr2, size_t num) */ #define MEM_CMP_FPTR VOID_PTR(0x803238c8) /** void* memcpy(void* destination, const void* source, size_t num) */ #define MEM_CPY_FPTR VOID_PTR(0x800031f4) /** void* memset(void* ptr, int value, size_t num) */ #define MEM_SET_FPTR VOID_PTR(0x80003130) /** char* strchr(const char* str, int character) */ #define STR_CHR_FPTR VOID_PTR(0x8032578) /** int strcmp(const char* str1, const char* str2) */ #define STR_CMP_FPTR VOID_PTR(0x803258e8) /** int strncmp(const char* str1, const char* str2, size_t num) */ #define STRN_CMP_FPTR VOID_PTR(0x803258a8) /** char* strcpy(char* destination, const char* source) */ #define STR_CPY_FPTR VOID_PTR(0x80325a50) /** char* strncpy(char* destination, const char* source, size_t num) */ #define STRN_CPY_FPTR VOID_PTR(0x80325a0c) /** size_t strlen(const char* str) */ #define STR_LEN_FPTR VOID_PTR(0x80325b04) /** uint32_t strtoul(const char* str, char** endptr, int base) */ #define STR_TO_UL_FPTR VOID_PTR(0x80325b24) /************************** print.h ***************************/ /** int sprintf(char* str, const char* format, ...) */ #define SPRINTF_FPTR VOID_PTR(0x80323cf4) /************************** math.h ****************************/ /** float sin(float x) */ #define SIN_FPTR VOID_PTR(0x80326220) /** float cos(float x) */ #define COS_FPTR VOID_PTR(0x80326200) /** float tan(float x) */ #define TAN_FPTR VOID_PTR(0x803261bc) /** float acos(float x) */ #define ACOS_FPTR VOID_PTR(0x80022d1c) /** float asin(float x) */ #define ASIN_FPTR VOID_PTR(0x80022dbc) /** float atan(float x) */ #define ATAN_FPTR VOID_PTR(0x80022e68) /** float atan2(float y, float x) */ #define ATAN2_FPTR VOID_PTR(0x80022c30) /** float exp(float x) */ #define EXP_FPTR VOID_PTR(0x8000ce50) /** float log(float x) */ #define LOG_FPTR VOID_PTR(0x803265a8) /** float fabs(float x) */ #define FABS_FPTR VOID_PTR(0x803261b4) /** float recipSqrt(float x) */ #define RECIP_SQRT_FPTR VOID_PTR(0x80022df8); /************************** profile.h *************************/ /** u32 OSGetTime() */ #define OS_GET_TIME_FPTR VOID_PTR(0x8034c3f0) /** u32 OSGetTick() */ #define OS_GET_TICK_FPTR VOID_PTR(0x8034c408) /** u32 OSGetSystemTime() */ #define OS_GET_SYSTEM_TIME_FPTR VOID_PTR(0x8034c410) /** u32 OSGetTick() */ #define OS_TIME_TO_SYSTEM_TIME_FPTR VOID_PTR(0x8034c474) /************************** memcard.h *************************/ #define CARD_INIT_FPTR VOID_PTR(0x803530e4) #endif
/* Copyright 2012 MaidSafe.net limited This MaidSafe Software is licensed under the MaidSafe.net Commercial License, version 1.0 or later, and The General Public License (GPL), version 3. By contributing code to this project You agree to the terms laid out in the MaidSafe Contributor Agreement, version 1.0, found in the root directory of this project at LICENSE, COPYING and CONTRIBUTOR respectively and also available at: http://www.novinet.com/license Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef MAIDSAFE_VAULT_MAID_ACCOUNT_HOLDER_MAID_ACCOUNT_HANDLER_INL_H_ #define MAIDSAFE_VAULT_MAID_ACCOUNT_HOLDER_MAID_ACCOUNT_HANDLER_INL_H_ #include "maidsafe/passport/types.h" #include "maidsafe/vault/utils.h" namespace maidsafe { namespace vault { namespace detail { template<typename Data> struct AccountRequired : std::true_type {}; template<> struct AccountRequired<passport::Anmaid> : std::false_type {}; template<> struct AccountRequired<passport::Maid> : std::false_type {}; } // namespace detail template<typename Data> void MaidAccountHandler::CreateAccount(const MaidName& account_name, AllowedAccountCreationType) { std::lock_guard<std::mutex> lock(mutex_); std::unique_ptr<MaidAccount> account(new MaidAccount(account_name, db_, kThisNodeId_)); // if account exists, this is a no-op (allow Maid and Anmaid to be stored several times) maid_accounts_.insert(std::move(std::make_pair(account_name, std::move(account)))); } template<typename Data> void MaidAccountHandler::DeleteData(const MaidName& account_name, const typename Data::name_type& data_name) { std::lock_guard<std::mutex> lock(mutex_); maid_accounts_.at(account_name)->DeleteData<Data>(data_name); } } // namespace vault } // namespace maidsafe #endif // MAIDSAFE_VAULT_MAID_ACCOUNT_HOLDER_MAID_ACCOUNT_HANDLER_INL_H_
// // This program 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 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see http://www.gnu.org/licenses/. // #ifndef __EPON_OLT_RELAY_H__ #define __EPON_OLT_RELAY_H__ #include <omnetpp.h> #include <map> #include <string.h> #include "EtherFrame_m.h" #include "EtherFrameVlans_m.h" #include "MACVlanRelayUnitBase.h" #include "EPON_CtrlInfo.h" #include "ONUTable.h" /** * The default relay way. As mentioned in the MACVlanRelayUnitBase this * module is responsible for packet differentiation. The specific module * is based on the destination MAC address and is going to forward the frame * to all the known LLIDs. If the LLID is -1 (UNDEFINED) then the frame is * going to be broadcasted. The same will happen if we do not know any LLID * for that MAC address. * * NOTE here that mapping to LLIDs could be done with various ways based on the * VLAN or on the DSCP in the IP header or even per-port or pre-defined per * destination. Depending on the scenario, someone can extend the MACVlanRelayUnitBase * and change the relay's behavior. */ class EPON_OLT_relayDefault : public MACVlanRelayUnitBase { public: virtual ~EPON_OLT_relayDefault(); protected: long numProcessedFrames; long numDroppedFrames; double throughput; double delayTDM; double delayWDM; int nbDelayTDM; int nbDelayWDM; ONUTable * onutbl; protected: virtual void initialize(); virtual void handleMessage(cMessage *msg); virtual void handleFromPON(EtherFrame *frame); virtual void handleFromLAN(EtherFrame *frame); virtual void finish(); virtual cModule * findModuleUp(const char * name); }; #endif
#if CONFIG_ALPHA_APECS && CONFIG_ALPHA_PRIMO // Kconfig dead on alpha, but missing on x86 #endif /* * check-name: CNF: correct identification of defects * check-command: undertaker -v -m cnfmodels $file * check-output-start I: loaded cnf model for alpha I: loaded cnf model for arm I: loaded cnf model for avr32 I: loaded cnf model for blackfin I: loaded cnf model for cris I: loaded cnf model for frv I: loaded cnf model for h8300 I: loaded cnf model for hexagon I: loaded cnf model for ia64 I: loaded cnf model for m32r I: loaded cnf model for m68k I: loaded cnf model for microblaze I: loaded cnf model for mips I: loaded cnf model for mn10300 I: loaded cnf model for openrisc I: loaded cnf model for parisc I: loaded cnf model for powerpc I: loaded cnf model for s390 I: loaded cnf model for score I: loaded cnf model for sh I: loaded cnf model for sparc I: loaded cnf model for tile I: loaded cnf model for um I: loaded cnf model for unicore32 I: loaded cnf model for x86 I: loaded cnf model for xtensa I: found 26 models I: Using x86 as primary model I: creating defect-identification_cnf.c.B0.kconfig.globally.dead * check-output-end */
/* * de-ess.h - header file for de-ess.c * * Copyright (C) 2008-2013 Theophilus (http://theaudiobible.org) * * http://theaudiobible.org/contact.php * */ #include <stdio.h> #include <math.h> #include <stdlib.h> #include <signal.h> #include <sys/types.h> #include <unistd.h> #include <fftw3.h> /* Note that N must be odd */ #define N 81 #define PI 3.14159265358979323846 #define EQ1_FILE "/etc/eq1.cfg" #define EQ2_FILE "/etc/eq2.cfg" #define MAX_CHAR_PER_LINE 9 /* Description of the following definition */ #define QUALIFYING_HALF_CYCLES_THRESHOLD 100 #define ARRAY_SIZE 100000 #define FALSE 0 #define TRUE !FALSE /***************************** Type definitions *****************************/ typedef unsigned char byte;
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QUNDOGROUP_H #define QUNDOGROUP_H #include <QtCore/qobject.h> #include <QtCore/qstring.h> QT_BEGIN_NAMESPACE class QUndoGroupPrivate; class QUndoStack; class QAction; #ifndef QT_NO_UNDOGROUP class Q_WIDGETS_EXPORT QUndoGroup : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QUndoGroup) public: explicit QUndoGroup(QObject *parent = Q_NULLPTR); ~QUndoGroup(); void addStack(QUndoStack *stack); void removeStack(QUndoStack *stack); QList<QUndoStack*> stacks() const; QUndoStack *activeStack() const; #ifndef QT_NO_ACTION QAction *createUndoAction(QObject *parent, const QString &prefix = QString()) const; QAction *createRedoAction(QObject *parent, const QString &prefix = QString()) const; #endif // QT_NO_ACTION bool canUndo() const; bool canRedo() const; QString undoText() const; QString redoText() const; bool isClean() const; public Q_SLOTS: void undo(); void redo(); void setActiveStack(QUndoStack *stack); Q_SIGNALS: void activeStackChanged(QUndoStack *stack); void indexChanged(int idx); void cleanChanged(bool clean); void canUndoChanged(bool canUndo); void canRedoChanged(bool canRedo); void undoTextChanged(const QString &undoText); void redoTextChanged(const QString &redoText); private: Q_DISABLE_COPY(QUndoGroup) }; #endif // QT_NO_UNDOGROUP QT_END_NAMESPACE #endif // QUNDOGROUP_H
/********************************************************************** * Copyright 2012 Arto Jalkanen * * This file is part of ProfileMatic. * * ProfileMatic 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. * * ProfileMatic 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 ProfileMatic. If not, see <http://www.gnu.org/licenses/> **/ #ifndef QMLACTIONEDITMODEL_H #define QMLACTIONEDITMODEL_H #include <QObject> #include "model/rule.h" #include "qmlbaseruleeditmodel.h" class QmlActionEditModel: public QmlBaseRuleEditModel { Q_OBJECT typedef QmlBaseRuleEditModel super; public: QmlActionEditModel(Rule *rule, QObject *parent = 0); }; #endif // QMLACTIONEDITMODEL_H
/* This file is part of Desperion. Copyright 2010, 2011 LittleScaraby, Nekkro Desperion 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. Desperion 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 Desperion. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __PADDOCK_PRIVATE_INFORMATIONS__ #define __PADDOCK_PRIVATE_INFORMATIONS__ class PaddockPrivateInformations : public PaddockAbandonnedInformations { public: GuildInformationsPtr guildInfo; uint16 GetProtocol() const { return PADDOCK_PRIVATE_INFORMATIONS; } PaddockPrivateInformations() { } PaddockPrivateInformations(int16 maxOutdoorMount, int16 maxItems, int price, bool locked, int guildId, GuildInformations* guildInfo) : PaddockAbandonnedInformations(maxOutdoorMount, maxItems, price, locked, guildId), guildInfo(guildInfo) { } void Serialize(ByteBuffer& data) const { PaddockAbandonnedInformations::Serialize(data); guildInfo->Serialize(data); } void Deserialize(ByteBuffer& data) { PaddockAbandonnedInformations::Deserialize(data); guildInfo.reset(new GuildInformations); guildInfo->Deserialize(data); } }; typedef boost::shared_ptr<PaddockPrivateInformations> PaddockPrivateInformationsPtr; #endif
// // PropertyViewController.h // GardenSketch // // Created by Arian Khosravi on 2014-06-13. // Copyright (c) 2014 Denim & Steel. All rights reserved. // #import <UIKit/UIKit.h> #import "SidebarContentViewController.h" #import "PropertyShapeButton.h" #import "GSButton.h" @interface PropertyViewController : SidebarContentViewController <UITextFieldDelegate> @property (strong, nonatomic) IBOutletCollection(PropertyShapeButton) NSArray *shapes; @property (weak, nonatomic) IBOutlet UITextField *firstField; @property (weak, nonatomic) IBOutlet UITextField *secondField; @property (weak, nonatomic) IBOutlet GSButton *doneButton; - (IBAction)shapeSelected:(id)sender; - (IBAction)doneTapped:(id)sender; @end
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_dom_CheckerboardReportService_h #define mozilla_dom_CheckerboardReportService_h #include <string> #include "js/TypeDecls.h" // for JSContext, JSObject #include "mozilla/ErrorResult.h" // for ErrorResult #include "mozilla/StaticPtr.h" // for StaticRefPtr #include "nsCOMPtr.h" // for nsCOMPtr #include "nsISupports.h" // for NS_INLINE_DECL_REFCOUNTING #include "nsWrapperCache.h" // for nsWrapperCache namespace mozilla { namespace dom { struct CheckerboardReport; } namespace layers { // CheckerboardEventStorage is a singleton that stores info on checkerboard // events, so that they can be accessed from about:checkerboard and visualized. // Note that this class is NOT threadsafe, and all methods must be called on // the main thread. class CheckerboardEventStorage { NS_INLINE_DECL_REFCOUNTING(CheckerboardEventStorage) public: /** * Get the singleton instance. */ static already_AddRefed<CheckerboardEventStorage> GetInstance(); /** * Get the stored checkerboard reports. */ void GetReports(nsTArray<dom::CheckerboardReport>& aOutReports); /** * Save a checkerboard event log, optionally dropping older ones that were * less severe or less recent. Zero-severity reports may be ignored entirely. */ static void Report(uint32_t aSeverity, const std::string& aLog); private: /* Stuff for refcounted singleton */ CheckerboardEventStorage() {} virtual ~CheckerboardEventStorage() {} static StaticRefPtr<CheckerboardEventStorage> sInstance; void ReportCheckerboard(uint32_t aSeverity, const std::string& aLog); private: /** * Struct that this class uses internally to store a checkerboard report. */ struct CheckerboardReport { uint32_t mSeverity; // if 0, this report is empty int64_t mTimestamp; // microseconds since epoch, as from JS_Now() std::string mLog; CheckerboardReport() : mSeverity(0) , mTimestamp(0) {} CheckerboardReport(uint32_t aSeverity, int64_t aTimestamp, const std::string& aLog) : mSeverity(aSeverity) , mTimestamp(aTimestamp) , mLog(aLog) {} }; // The first 5 (indices 0-4) are the most severe ones in decreasing order // of severity; the next 5 (indices 5-9) are the most recent ones that are // not already in the "severe" list. static const int SEVERITY_MAX_INDEX = 5; static const int RECENT_MAX_INDEX = 10; CheckerboardReport mCheckerboardReports[RECENT_MAX_INDEX]; }; } // namespace layers namespace dom { class GlobalObject; /** * CheckerboardReportService is a wrapper object that allows access to the * stuff in CheckerboardEventStorage (above). We need this wrapper for proper * garbage/cycle collection, since this can be accessed from JS. */ class CheckerboardReportService : public nsWrapperCache { public: /** * Check if the given page is allowed to access this object via the WebIDL * bindings. It only returns true if the page is about:checkerboard. */ static bool IsEnabled(JSContext* aCtx, JSObject* aGlobal); /* * Other standard WebIDL binding glue. */ static already_AddRefed<CheckerboardReportService> Constructor(const dom::GlobalObject& aGlobal, ErrorResult& aRv); explicit CheckerboardReportService(nsISupports* aSupports); JSObject* WrapObject(JSContext* aCtx, JS::Handle<JSObject*> aGivenProto) override; nsISupports* GetParentObject(); NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CheckerboardReportService) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CheckerboardReportService) public: /* * The methods exposed via the webidl. */ void GetReports(nsTArray<dom::CheckerboardReport>& aOutReports); bool IsRecordingEnabled() const; void SetRecordingEnabled(bool aEnabled); void FlushActiveReports(); private: virtual ~CheckerboardReportService() {} nsCOMPtr<nsISupports> mParent; }; } // namespace dom } // namespace mozilla #endif /* mozilla_layers_CheckerboardReportService_h */
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is the MRJ Carbon OJI Plugin. * * The Initial Developer of the Original Code is * Netscape Communications Corp. * Portions created by the Initial Developer are Copyright (C) 2001 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Patrick C. Beard <beard@netscape.com> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* JavaMessageQueue.h */ #pragma once #ifndef JNI_H #include "jni.h" #endif class Monitor; class JavaMessage { public: JavaMessage() : mNext(NULL) {} virtual ~JavaMessage() {} void setNext(JavaMessage* next) { mNext = next; } JavaMessage* getNext() { return mNext; } virtual void execute(JNIEnv* env) = 0; private: JavaMessage* mNext; }; class JavaMessageQueue { public: JavaMessageQueue(Monitor* monitor); void putMessage(JavaMessage* msg); JavaMessage* getMessage(); void enter(); void exit(); void wait(); void wait(long long millis); void notify(); private: // Message queue. JavaMessage* mFirst; JavaMessage* mLast; Monitor* mMonitor; };
/* * This file is a part of Xpiks - cross platform application for * keywording and uploading images for microstocks * Copyright (C) 2014-2018 Taras Kushnir <kushnirTV@gmail.com> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef THREADHELPERS_H #define THREADHELPERS_H #include <QMutex> #include <QSemaphore> #include <QWaitCondition> namespace Helpers { class ManualResetEvent { public: ManualResetEvent(); public: void set(); void reset(); void waitOne(); private: QWaitCondition m_WaitCondition; QMutex m_Mutex; volatile bool m_Flag; }; class Barrier { public: Barrier(int threadsNumber); public: void wait(); private: void phase1(); void phase2(); private: QMutex m_Mutex; QSemaphore m_Turnstile; QSemaphore m_Turnstile2; volatile int m_ThreadsNumber; volatile int m_Count; }; } #endif // THREADHELPERS_H
#ifndef SQLITEOUT_H #define SQLITEOUT_H #include <stdlib.h> #include <stdint.h> #include <sqlite3.h> void initDatabase(const char* filename, sqlite3 **db); void freeDatabase(sqlite3 **db); void insertPacket(uint8_t s2c, uint64_t time, uint16_t opcode, uint8_t *data, uint32_t data_len, void* db); #endif
ο»Ώ/************************************************************************ MeOS - Orienteering Software Copyright (C) 2009-2021 Melin Software HB 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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, see <http://www.gnu.org/licenses/>. Melin Software HB - software@melin.nu - www.melin.nu EksoppsvΓ€gen 16, SE-75646 UPPSALA, Sweden ************************************************************************/ // csvparser.h: interface for the csvparser class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_CSVPARSER_H__FD04656A_1D2A_4E6C_BE23_BD66052E276E__INCLUDED_) #define AFX_CSVPARSER_H__FD04656A_1D2A_4E6C_BE23_BD66052E276E__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <vector> #include <map> class oEvent; struct SICard; class ImportFormats; struct PunchInfo { int code; int card; int time; char date[28]; }; struct TeamLineup { struct TeamMember { wstring name; wstring club; int cardNo; wstring course; wstring cls; }; wstring teamName; wstring teamClass; wstring teamClub; vector<TeamMember> members; }; class csvparser { protected: ofstream fout; ifstream fin; int LineNumber; string ErrorMessage; // Returns true if a SI-manager line is identified bool checkSimanLine(const oEvent &oe, const vector<wstring> &sp, SICard &cards); // Check and setup header for SIConfig import void checkSIConfigHeader(const vector<wstring> &sp); // Return true if SIConfig line was detected bool checkSIConfigLine(const oEvent &oe, const vector<wstring> &sp, SICard &card); enum SIConfigFields { sicSIID, sicCheck, sicCheckTime, sicCheckDOW, sicStart, sicStartTime, sicStartDOW, sicFinish, sicFinishTime, sicFinishDOW, sicNumPunch, sicRecordStart, sicFirstName, sicLastName, }; map<SIConfigFields, int> siconfigmap; const wchar_t *getSIC(SIConfigFields sic, const vector<wstring> &sp) const; void parseUnicode(const wstring &file, list< vector<wstring> > &data); // Check and process a punch line static int selectPunchIndex(const wstring &competitionDate, const vector<wstring> &sp, int &cardIndex, int &timeIndex, int &dateIndex, wstring &processedTime, wstring &date); public: static void convertUTF(const wstring &file); void parse(const wstring &file, list< vector<wstring> > &dataOutput); void importTeamLineup(const wstring &file, const map<wstring, int> &classNameToNumber, vector<TeamLineup> &teams); bool openOutput(const wstring &file, bool writeUTF = false); bool closeOutput(); bool outputRow(const vector<string> &out); bool outputRow(const string &row); int nimport; bool importOCAD_CSV(oEvent &oe, const wstring &file, bool addClasses); bool importOS_CSV(oEvent &oe, const wstring &file); bool importRAID(oEvent &oe, const wstring &file); bool importOE_CSV(oEvent &oe, const wstring &file); bool importPunches(const oEvent &oe, const wstring &file, vector<PunchInfo> &punches); bool importCards(const oEvent &oe, const wstring &file, vector<SICard> &punches); int importRanking(oEvent &oe, const wstring &file, vector<wstring> & problems); static int split(char *line, vector<char *> &split); static int split(wchar_t *line, vector<wchar_t *> &split); enum class CSV { NoCSV, Unknown, RAID, OE, OS, }; static CSV iscsv(const wstring &file); csvparser(); virtual ~csvparser(); }; #endif // !defined(AFX_CSVPARSER_H__FD04656A_1D2A_4E6C_BE23_BD66052E276E__INCLUDED_)
/***************************************************************************** @(#) $Id: npi_ss7.h,v 1.1.2.2 2010-11-28 14:21:49 brian Exp $ ----------------------------------------------------------------------------- Copyright (c) 2008-2010 Monavacon Limited <http://www.monavacon.com/> Copyright (c) 2001-2008 OpenSS7 Corporation <http://www.openss7.com/> Copyright (c) 1997-2001 Brian F. G. Bidulock <bidulock@openss7.org> All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; version 3 of the License. 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>, or write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ----------------------------------------------------------------------------- U.S. GOVERNMENT RESTRICTED RIGHTS. If you are licensing this Software on behalf of the U.S. Government ("Government"), the following provisions apply to you. If the Software is supplied by the Department of Defense ("DoD"), it is classified as "Commercial Computer Software" under paragraph 252.227-7014 of the DoD Supplement to the Federal Acquisition Regulations ("DFARS") (or any successor regulations) and the Government is acquiring only the license rights granted herein (the license rights customarily provided to non-Government users). If the Software is supplied to any unit or agency of the Government other than DoD, it is classified as "Restricted Computer Software" and the Government's rights in the Software are defined in paragraph 52.227-19 of the Federal Acquisition Regulations ("FAR") (or any successor regulations) or, in the cases of NASA, in paragraph 18.52.227-86 of the NASA Supplement to the FAR (or any successor regulations). ----------------------------------------------------------------------------- Commercial licensing and support of this software is available from OpenSS7 Corporation at a fee. See http://www.openss7.com/ ----------------------------------------------------------------------------- Last Modified $Date: 2010-11-28 14:21:49 $ by $Author: brian $ ----------------------------------------------------------------------------- $Log: npi_ss7.h,v $ Revision 1.1.2.2 2010-11-28 14:21:49 brian - remove #ident, protect _XOPEN_SOURCE Revision 1.1.2.1 2009-06-21 11:25:37 brian - added files to new distro *****************************************************************************/ #ifndef _SYS_NPI_SS7_H #define _SYS_NPI_SS7_H /* This file can be processed with doxygen(1). */ /* * PROTOCOL VARIANTS * * Note: these values must be aligned with <ss7/lmi_ioctl.h> */ #define N_SS7_PVAR_ITUT 0x0100 #define N_SS7_PVAR_ETSI 0x0200 #define N_SS7_PVAR_ANSI 0x0300 #define N_SS7_PVAR_JTTC 0x0400 #define N_SS7_PVAR_CHIN 0x0500 #define N_SS7_PVAR_SING 0x0600 #define N_SS7_PVAR_SPAN 0x0700 #define N_SS7_PVAR_MASK 0xff00 #define N_SS7_PVAR_88 0x0000 #define N_SS7_PVAR_92 0x0001 #define N_SS7_PVAR_96 0x0002 #define N_SS7_PVAR_00 0x0003 #define N_SS7_PVAR_YR 0x00ff enum { N_SS7_PVAR_ITUT_88 = N_SS7_PVAR_ITUT | N_SS7_PVAR_88, /* ITU-T protocol variant */ N_SS7_PVAR_ITUT_93 = N_SS7_PVAR_ITUT | N_SS7_PVAR_92, /* ITU-T protocol variant */ N_SS7_PVAR_ITUT_96 = N_SS7_PVAR_ITUT | N_SS7_PVAR_96, /* ITU-T protocol variant */ N_SS7_PVAR_ITUT_00 = N_SS7_PVAR_ITUT | N_SS7_PVAR_00, /* ITU-T protocol variant */ N_SS7_PVAR_ETSI_88 = N_SS7_PVAR_ETSI | N_SS7_PVAR_88, /* ETSI protocol variant */ N_SS7_PVAR_ETSI_93 = N_SS7_PVAR_ETSI | N_SS7_PVAR_92, /* ETSI protocol variant */ N_SS7_PVAR_ETSI_96 = N_SS7_PVAR_ETSI | N_SS7_PVAR_96, /* ETSI protocol variant */ N_SS7_PVAR_ETSI_00 = N_SS7_PVAR_ETSI | N_SS7_PVAR_00, /* ETSI protocol variant */ N_SS7_PVAR_ANSI_88 = N_SS7_PVAR_ANSI | N_SS7_PVAR_88, /* ANSI protocol variant */ N_SS7_PVAR_ANSI_92 = N_SS7_PVAR_ANSI | N_SS7_PVAR_92, /* ANSI protocol variant */ N_SS7_PVAR_ANSI_96 = N_SS7_PVAR_ANSI | N_SS7_PVAR_96, /* ANSI protocol variant */ N_SS7_PVAR_ANSI_00 = N_SS7_PVAR_ANSI | N_SS7_PVAR_00, /* ANSI protocol variant */ N_SS7_PVAR_JTTC_94 = N_SS7_PVAR_JTTC | N_SS7_PVAR_92, /* JTTC protocol variant */ N_SS7_PVAR_CHIN_00 = N_SS7_PVAR_CHIN | N_SS7_PVAR_00, /* CHIN protocol variant */ }; enum { N_SS7_POPT_MPLEV = 0x00000001, /* multiple priority/congestion levels */ N_SS7_POPT_PCR = 0x00000002, /* preventative cyclic retranlmission */ N_SS7_POPT_HSL = 0x00000004, /* high speed links */ N_SS7_POPT_XSN = 0x00000008, /* extended sequence numbers */ N_SS7_POPT_ALL = 0x0000000f /* all options */ }; #endif /* _SYS_NPI_SS7_H */
/* * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) * From ASN.1 module "S1AP-IEs" * found in "../support/s1ap-r16.4.0/36413-g40.asn" * `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-UPER` */ #ifndef _S1AP_TAListforQMC_H_ #define _S1AP_TAListforQMC_H_ #include <asn_application.h> /* Including external dependencies */ #include "S1AP_TAC.h" #include <asn_SEQUENCE_OF.h> #include <constr_SEQUENCE_OF.h> #ifdef __cplusplus extern "C" { #endif /* S1AP_TAListforQMC */ typedef struct S1AP_TAListforQMC { A_SEQUENCE_OF(S1AP_TAC_t) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } S1AP_TAListforQMC_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_S1AP_TAListforQMC; extern asn_SET_OF_specifics_t asn_SPC_S1AP_TAListforQMC_specs_1; extern asn_TYPE_member_t asn_MBR_S1AP_TAListforQMC_1[1]; extern asn_per_constraints_t asn_PER_type_S1AP_TAListforQMC_constr_1; #ifdef __cplusplus } #endif #endif /* _S1AP_TAListforQMC_H_ */ #include <asn_internal.h>
/* * Copyright (c) 2007-2009 Digital Bazaar, Inc. All rights reserved. */ #ifndef monarch_io_ByteArrayInputStream_H #define monarch_io_ByteArrayInputStream_H #include "monarch/io/InputStream.h" #include "monarch/io/ByteBuffer.h" namespace monarch { namespace io { /** * A ByteArrayInputStream is used to read bytes from a byte array or, * alternatively, from a ByteBuffer. * * @author Dave Longley */ class ByteArrayInputStream : public monarch::io::InputStream { protected: /** * The byte array to read from. */ const char* mBytes; /** * The number of bytes remaining in the byte array. */ int mLength; /** * The ByteBuffer to read from. */ ByteBuffer* mBuffer; /** * True to clean up the ByteBuffer when destructing, false not to. */ bool mCleanupBuffer; public: /** * Creates a new ByteArrayInputStream. * * @param b the byte array to read from. * @param length the length of the byte array. */ ByteArrayInputStream(const char* b, int length); /** * Creates a new ByteArrayInputStream that reads from a ByteBuffer. * * @param b the ByteBuffer to read from. * @param cleanup true to clean up ByteBuffer when destructing, false not to. */ ByteArrayInputStream(ByteBuffer* b, bool cleanup = false); /** * Destructs this ByteArrayInputStream. */ virtual ~ByteArrayInputStream(); /** * Reads some bytes from the stream. This method will block until at least * one byte can be read or until the end of the stream is reached. A * value of 0 will be returned if the end of the stream has been reached, * a value of -1 will be returned if an IO exception occurred, otherwise * the number of bytes read will be returned. * * @param b the array of bytes to fill. * @param length the maximum number of bytes to read into the buffer. * * @return the number of bytes read from the stream or 0 if the end of the * stream has been reached or -1 if an IO exception occurred. */ virtual int read(char* b, int length); /** * Sets the byte array to read from. * * @param b the byte array to read from. * @param length the length of the byte array. */ virtual void setByteArray(const char* b, int length); /** * Sets the ByteBuffer to read from. * * @param b the ByteBuffer to read from. * @param cleanup true to clean up ByteBuffer when destructing, false not to. */ virtual void setByteBuffer(ByteBuffer* b, bool cleanup = false); }; } // end namespace io } // end namespace monarch #endif
/* Copyright (c) 2014-2021 AscEmu Team <http://www.ascemu.org> This file is released under the MIT license. See README-MIT for more information. */ #pragma once #include <cstdint> #include "ManagedPacket.h" #include "WorldPacket.h" namespace AscEmu::Packets { class CmsgSwapInvItem : public ManagedPacket { public: int8_t destSlot; int8_t srcSlot; CmsgSwapInvItem() : CmsgSwapInvItem(0, 0) { } CmsgSwapInvItem(int8_t destSlot, int8_t srcSlot) : ManagedPacket(CMSG_SWAP_INV_ITEM, 2), destSlot(destSlot), srcSlot(srcSlot) { } protected: bool internalSerialise(WorldPacket& /*packet*/) override { return false; } bool internalDeserialise(WorldPacket& packet) override { packet >> destSlot >> srcSlot; return true; } }; }
/** ****************************************************************************** * @file I2C/I2C_TwoBoards_ComPolling/Src/stm32f4xx_it.c * @author MCD Application Team * @version V1.0.1 * @date 29-January-2016 * @brief Main Interrupt Service Routines. * This file provides template for all exceptions handler and * peripherals interrupt service routine. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f4xx_it.h" /** @addtogroup STM32F4xx_HAL_Examples * @{ */ /** @addtogroup I2C_TwoBoards_ComPolling * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* I2C handler declared in "main.c" file */ extern I2C_HandleTypeDef hi2c; /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /******************************************************************************/ /* Cortex-M4 Processor Exceptions Handlers */ /******************************************************************************/ /** * @brief This function handles NMI exception. * @param None * @retval None */ void NMI_Handler(void) { } /** * @brief This function handles Hard Fault exception. * @param None * @retval None */ void HardFault_Handler(void) { /* Go to infinite loop when Hard Fault exception occurs */ while (1) { } } /** * @brief This function handles Memory Manage exception. * @param None * @retval None */ void MemManage_Handler(void) { /* Go to infinite loop when Memory Manage exception occurs */ while (1) { } } /** * @brief This function handles Bus Fault exception. * @param None * @retval None */ void BusFault_Handler(void) { /* Go to infinite loop when Bus Fault exception occurs */ while (1) { } } /** * @brief This function handles Usage Fault exception. * @param None * @retval None */ void UsageFault_Handler(void) { /* Go to infinite loop when Usage Fault exception occurs */ while (1) { } } /** * @brief This function handles SVCall exception. * @param None * @retval None */ void SVC_Handler(void) { } /** * @brief This function handles Debug Monitor exception. * @param None * @retval None */ void DebugMon_Handler(void) { } /** * @brief This function handles PendSVC exception. * @param None * @retval None */ void PendSV_Handler(void) { } /** * @brief This function handles SysTick Handler. * @param None * @retval None */ void SysTick_Handler(void) { HAL_IncTick(); } /******************************************************************************/ /* STM32F4xx Peripherals Interrupt Handlers */ /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ /* available peripheral interrupt handler's name please refer to the startup */ /* file (startup_stm32f4xx.s). */ /******************************************************************************/ /** * @brief This function handles PPP interrupt request. * @param None * @retval None */ /*void PPP_IRQHandler(void) { }*/ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#include <err.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "mem_io_utils.h" #include "mem_io_cl_params.h" #define BUFF_SIZE 1024 int main(int argc, char *argv[]) { Params params; initCL(&params); parseCL(&params, &argc, &argv); char *mem_io_id = mem_io_get_id(&params); mem_io_merge_params(mem_io_id, &params); if (params.verbose) dumpCL(stderr, "# ", &params); redisContext *context = mem_io_connect(params.host, params.port, params.timeout); mem_io_auth(context, params.password); int nr_channels = mem_io_get_nr_channels(context, mem_io_id); if (params.channel_id < 0 || params.channel_id >= nr_channels) errx(INVALID_CHANNEL_ERROR, "channel ID %d is invalid", params.channel_id); char *status_key = mem_io_create_channel_status_key(mem_io_id, params.channel_id); if (!mem_io_channel_status_is_set(context, status_key) || !mem_io_is_channel_open(context, status_key)) { mem_io_open_channel(context, status_key); char buffer[BUFF_SIZE]; char *key = mem_io_create_key(mem_io_id, params.channel_id); for (;;) { int count = fread(buffer, sizeof(char), BUFF_SIZE, stdin); if (count == 0) break; mem_io_push(context, key, buffer, count); } mem_io_close_channel(context, status_key); free(key); } else { errx(OPEN_CHANNEL_ERROR, "writing to open channel %d", params.channel_id); } mem_io_disconnect(context); free(status_key); free(mem_io_id); finalizeCL(&params); return EXIT_SUCCESS; }
/* * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) * From ASN.1 module "EUTRA-InterNodeDefinitions" * found in "36331-ac0.asn" * `asn1c -S /home/nyee/srsLTE/srslte/examples/src/asn1c/skeletons -fcompound-names -fskeletons-copy -gen-PER -pdu=auto` */ #ifndef _HandoverCommand_r8_IEs_H_ #define _HandoverCommand_r8_IEs_H_ #include <asn_application.h> /* Including external dependencies */ #include <OCTET_STRING.h> #include <constr_SEQUENCE.h> #ifdef __cplusplus extern "C" { #endif /* HandoverCommand-r8-IEs */ typedef struct HandoverCommand_r8_IEs { OCTET_STRING_t handoverCommandMessage; struct HandoverCommand_r8_IEs__nonCriticalExtension { /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } *nonCriticalExtension; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } HandoverCommand_r8_IEs_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_HandoverCommand_r8_IEs; #ifdef __cplusplus } #endif #endif /* _HandoverCommand_r8_IEs_H_ */ #include <asn_internal.h>
// // Created by mistlight on 1/7/17. // #ifndef NODOKANATIVE_AUDIOBOOKRECORDPROXY_H #define NODOKANATIVE_AUDIOBOOKRECORDPROXY_H #include <QSqlRecord> #include <QSqlQuery> #include <QVariant> #include <QHash> #include <QSharedPointer> #include <src/core/Setting.h> #include "src/model/MediaProperty.h" #include <QSettings> #include <memory> class AudiobookFileProxy { QSharedPointer<QSettings> currentFileSetting; Core::Setting* setting; QSqlRecord record; bool isNull; MediaProperty mediaProperty; bool durationFunctionSet = false; bool completenssFunctionSet = false; std::function<void ()> totalDurationUpdateFunction; std::function<void ()> totalCompletenessUpdateFunction; // calculate the hashsum for the current file and save it QString calcCheckSum(); bool fileExistFlag; public: AudiobookFileProxy(QSqlRecord record, Core::Setting* setting); AudiobookFileProxy(); void calcAndWriteCheckSum(bool forced = false); QString path(); QString name(); bool getNullState(); bool isPropertyParsed(); void setAsCurrent(); void saveCurrentTime(long long currentTime); void setAsComplete(); long long getCurrentTime(); bool currentTimeNull(); int getCompleteness(); bool fileExists(); bool hasNextFile(); AudiobookFileProxy getNextFile(); QSqlRecord getRecord(); void setTotalDurationUpdateFunction(std::function<void()> audiobookProxyUpdateFunction); void setCompletenessUpdateFunction(std::function<void()> func) ; void setProperty(MediaProperty property); void setMediaDuration(const long long duration); long long getMediaDuration(); // direct user actions void resetReadStatus(); void markAsRead(); void remove(); }; #endif //NODOKANATIVE_AUDIOBOOKRECORDPROXY_H
/*------------------------------------------------------------------------- * * plugin_helpers.h * * Helper function prototypes for PL/TSQL instrumentation plugins * * Portions Copyright (c) 2011-2012, TPOSTGRES. All Rights Reserved. * * Copyright 2006,2007 - EnterpriseDB, Inc. * * IDENTIFICATION * $EnterpriseDB: edb-postgres/contrib/debugger/plugin_helpers.h,v 1.0 2005/12/15 02:49:32 kad Exp $ * *------------------------------------------------------------------------- */ static char * copyLine( const char * src, size_t len ); /* Create a null-terminated copy of the given string */ static int scanSource( const char * dst[], const char * src ); /* Count (and optionally split) lines in given string */ static void xmlEncode( FILE * dst, const char * str, size_t len ); /* Translate reserved characters and write XML string */ static char * findSource( Oid oid, Oid pkgId, HeapTuple * tup, char ** funcName ); /* Find the source code for a function */ static Oid funcGetOid( PLTSQL_function * func ); /* Given a function descriptor, return the pg_proc OID */ static Oid funcGetPkgOid( PLTSQL_function * func ); /* Given a function descriptor, return the package OID */
/* * RECommons.h * * Copyright (C) 2014 Misgana Bayetta * * Author: Misgana Bayetta <misgana.bayetta@gmail.com> Oct 2014 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License v3 as * published by the Free Software Foundation and including the exceptions * at http://opencog.org/wiki/Licenses * * 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 Affero General Public License * along with this program; if not, write to: * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef PLNCOMMONS_H_ #define PLNCOMMONS_H_ #include <opencog/util/dorepeat.h> #include <opencog/util/random.h> #include <opencog/atomspace/AtomSpace.h> #include <opencog/atomspace/Handle.h> #include <opencog/atomspace/types.h> namespace opencog { using namespace std; /** * Reusable functions in the PLN module */ class URECommons { AtomSpace& _as; public: const float FITNESS_PARAM = 0.9; URECommons(AtomSpace& as); /** * creates a BindLink instance that could be passed to to * PatternMatching module * * @param himplicant - an implicant part of the BindLink must have * a variable node. * @return - a Handle to the BindLink instance created */ Handle create_bindLink(Handle himplicant, bool is_quoted = false) throw (opencog::InvalidParamException); Handle create_bindlink_from_implicationlink(Handle himplication, bool vnode_is_typedv = false) throw (opencog::InvalidParamException); /** * checks if a handle already exists in a HandleSeq */ bool exists_in(Handle& hlink, Handle& h); /* * Generate UUID */ string get_unique_name(Handle& h); /** * create a copy of the given implicatoin link with unique variables */ Handle replace_nodes_with_varnode(Handle& himplication_link, Type t = VARIABLE_NODE); /** * create a copy of the handle with a different variable name passed in @param var_uniq_var map input */ Handle change_node_types(Handle& h, map<Handle, Handle>& replacement_map); Handle change_node_types_em(Handle& h, map<Handle, Handle>& replacement_map); /** * Get top level parent of the handle * @return a Link or Handle::UNDEFINED if there is no */ void get_root_links(Handle h, HandleSeq& parents); /** * Randomly pick about half of the elements, and amongst those * return the fittest (higher is better). If tfitness_map is * empty, then return the default value (build with Type()). */ template<class Type> Type tournament_select(map<Type, float> tfitnes_map) { // Nothing to select, return the nullptr rule if (tfitnes_map.empty()) return Type(); // Something to select, randomly pick (without replacement) // about half of the rules and return the best // TODO change the way pick_size is calculated size_t pick_size = std::max(static_cast<size_t>(1), tfitnes_map.size() / 2); multimap<float, Type> winners; dorepeat(pick_size) { auto el = rand_element(tfitnes_map); winners.insert( { el.second, el.first }); } return winners.rbegin()->second; } /** * Calculates fitness values in source_list_atom_space (or * target_list_atom_space for the BC) using the formula * * F = s^x * c^(2-x) * * where s is strength,c is confidence and x is some fixed value * * @param h - a handle * @return a fitness value */ float tv_fitness(Handle h); }; } // ~namespace opencog #endif /* PLNCOMMONS_H_ */
// // InputTableViewController.h // FixMyStreet // // Created by Matthew on 26/09/2008. // Copyright 2008 UK Citizens Online Democracy. All rights reserved. // #import <UIKit/UIKit.h> #import "MyCLController.h" @interface InputTableViewController : UIViewController <UINavigationControllerDelegate,UIImagePickerControllerDelegate,MyCLControllerDelegate> { IBOutlet UIImageView* imageView; IBOutlet UITableView* actionsToDoView; IBOutlet UIButton* settingsButton; UIBarButtonItem* backButton; // Not sure what I made these for UITableViewCell* actionTakePhotoCell; UITableViewCell* actionFetchLocationCell; UITableViewCell* actionSubjectCell; UILabel* subjectLabel; UILabel* subjectContent; } -(void)enableSubmissionButton; -(void)uploadReport; -(void)reportUploaded:(BOOL)success; -(IBAction)addPhoto:(id) sender; -(IBAction)gotoSettings:(id)sender firstTime:(BOOL)firstTime; -(IBAction)gotoAbout:(id)sender; // UIImagePickerControllerDelegate - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo; - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker; -(BOOL)startLocation; //MyCLControllerDelegate -(void)newLocationUpdate:(CLLocation *)location; -(void)newLocationError:(NSString *)text; @end
/* * Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra * * This file is part of Essentia * * Essentia is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation (FSF), either version 3 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the Affero GNU General Public License * version 3 along with this program. If not, see http://www.gnu.org/licenses/ */ #ifndef ESSENTIA_POWERMEAN_H #define ESSENTIA_POWERMEAN_H #include "algorithmfactory.h" namespace essentia { namespace standard { class PowerMean : public Algorithm { private: Input<std::vector<Real> > _array; Output<Real> _powerMean; Algorithm* _geometricMean; public: PowerMean() { declareInput(_array, "array", "the input array (must contain only positive real numbers)"); declareOutput(_powerMean, "powerMean", "the power mean of the input array"); _geometricMean = AlgorithmFactory::create("GeometricMean"); } ~PowerMean() { delete _geometricMean; } void declareParameters() { declareParameter("power", "the power to which to elevate each element before taking the mean", "(-inf,inf)", 1.0); } void compute(); static const char* name; static const char* category; static const char* description; }; } // namespace standard } // namespace essentia #include "streamingalgorithmwrapper.h" namespace essentia { namespace streaming { class PowerMean : public StreamingAlgorithmWrapper { protected: Sink<std::vector<Real> > _array; Source<Real> _powerMean; public: PowerMean() { declareAlgorithm("PowerMean"); declareInput(_array, TOKEN, "array"); declareOutput(_powerMean, TOKEN, "powerMean"); } }; } // namespace streaming } // namespace essentia #endif // ESSENTIA_POWERMEAN_H
/* Copyright 2010 Daniele Rispoli, Valerio Genovese This file is part of ACL-Lean. ACL-Lean 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. ACL-Lean 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 ACL-Lean. If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <string.h> #define __GPROLOG_FOREIGN_STRICT__ #include "gprolog.h" static int Main_Wrapper(int argc, char *argv[]) { int func; PlTerm arg[3]; PlBool res; /*****************************************************************/ int not; int and; int or; int says; int implies; int colon; int geq; PlTerm plterm_0; PlTerm plterm_1[2]; PlTerm plterm_2; PlTerm plterm_3[2]; PlTerm plterm_4; PlTerm plterm_5[2]; PlTerm plterm_6; PlTerm plterm_7[2]; PlTerm plterm_8; PlTerm plterm_9[2]; PlTerm plterm_10; PlTerm plterm_11[2]; PlTerm plterm_12; PlTerm plterm_13; PlTerm plterm_14[2]; PlTerm plterm_15; PlTerm plterm_16; PlTerm plterm_17; PlTerm plterm_18[2]; PlTerm plterm_19; PlTerm plterm_20; PlTerm plterm_21; PlTerm plterm_22[2]; PlTerm plterm_23; PlTerm plterm_24[2]; PlTerm plterm_25; PlTerm plterm_26[2]; PlTerm plterm_27; PlTerm plterm_28; PlTerm plterm_29; PlTerm plterm_30; PlTerm plterm_31; PlTerm plterm_32[2]; PlTerm plterm_33; PlTerm plterm_34[2]; PlTerm plterm_35; PlTerm plterm_36; PlTerm plterm_37; PlTerm plterm_38[2]; PlTerm plterm_39; PlTerm plterm_40[2]; PlTerm plterm_41; PlTerm plterm_42; PlTerm plterm_43[2]; PlTerm plterm_44; PlTerm plterm_45; PlTerm plterm_46; PlTerm plterm_47; PlTerm plterm_48[2]; PlTerm plterm_49; PlTerm plterm_50; PlTerm plterm_51; /*****************************************************************/ Pl_Start_Prolog(argc, argv); func = Pl_Find_Atom("prove"); /*****************************************************************/ not = Pl_Find_Atom("~"); and = Pl_Find_Atom("and"); or = Pl_Find_Atom("or"); says = Pl_Find_Atom("says"); implies = Pl_Find_Atom("->"); colon = Pl_Find_Atom(":"); geq = Pl_Find_Atom(">="); /*****************************************************************/ Pl_Query_Begin(PL_TRUE); /*****************************************************************/ plterm_12 = Pl_Mk_String("a_1"); plterm_15 = Pl_Mk_String("suu_1"); plterm_16 = Pl_Mk_String("wpu_1"); plterm_14[0] = plterm_15; plterm_14[1] = plterm_16; plterm_13 = Pl_Mk_Compound(implies, 2, plterm_14); plterm_11[0] = plterm_12; plterm_11[1] = plterm_13; plterm_10 = Pl_Mk_Compound(says, 2, plterm_11); plterm_19 = Pl_Mk_String("a_2"); plterm_20 = Pl_Mk_String("suu_1"); plterm_18[0] = plterm_19; plterm_18[1] = plterm_20; plterm_17 = Pl_Mk_Compound(says, 2, plterm_18); plterm_9[0] = plterm_10; plterm_9[1] = plterm_17; plterm_8 = Pl_Mk_Compound(and, 2, plterm_9); plterm_27 = Pl_Mk_String("a_1"); plterm_28 = Pl_Mk_String("a_2"); plterm_26[0] = plterm_27; plterm_26[1] = plterm_28; plterm_25 = Pl_Mk_Compound(and, 2, plterm_26); plterm_29 = Pl_Mk_String("df_1"); plterm_24[0] = plterm_25; plterm_24[1] = plterm_29; plterm_23 = Pl_Mk_Compound(says, 2, plterm_24); plterm_30 = Pl_Mk_String("df_1"); plterm_22[0] = plterm_23; plterm_22[1] = plterm_30; plterm_21 = Pl_Mk_Compound(implies, 2, plterm_22); plterm_7[0] = plterm_8; plterm_7[1] = plterm_21; plterm_6 = Pl_Mk_Compound(and, 2, plterm_7); plterm_35 = Pl_Mk_String("a_1"); plterm_36 = Pl_Mk_String("a_2"); plterm_34[0] = plterm_35; plterm_34[1] = plterm_36; plterm_33 = Pl_Mk_Compound(and, 2, plterm_34); plterm_41 = Pl_Mk_String("wpu_1"); plterm_44 = Pl_Mk_String("u_1"); plterm_45 = Pl_Mk_String("df_1"); plterm_43[0] = plterm_44; plterm_43[1] = plterm_45; plterm_42 = Pl_Mk_Compound(says, 2, plterm_43); plterm_40[0] = plterm_41; plterm_40[1] = plterm_42; plterm_39 = Pl_Mk_Compound(and, 2, plterm_40); plterm_46 = Pl_Mk_String("df_1"); plterm_38[0] = plterm_39; plterm_38[1] = plterm_46; plterm_37 = Pl_Mk_Compound(implies, 2, plterm_38); plterm_32[0] = plterm_33; plterm_32[1] = plterm_37; plterm_31 = Pl_Mk_Compound(says, 2, plterm_32); plterm_5[0] = plterm_6; plterm_5[1] = plterm_31; plterm_4 = Pl_Mk_Compound(and, 2, plterm_5); plterm_49 = Pl_Mk_String("u_1"); plterm_50 = Pl_Mk_String("df_1"); plterm_48[0] = plterm_49; plterm_48[1] = plterm_50; plterm_47 = Pl_Mk_Compound(says, 2, plterm_48); plterm_3[0] = plterm_4; plterm_3[1] = plterm_47; plterm_2 = Pl_Mk_Compound(and, 2, plterm_3); plterm_51 = Pl_Mk_String("df_1"); plterm_1[0] = plterm_2; plterm_1[1] = plterm_51; plterm_0 = Pl_Mk_Compound(implies, 2, plterm_1); arg[0] = plterm_0; /*****************************************************************/ res = Pl_Query_Call(func, 1, arg); printf("Query:\n\t|- u : ((a_1 says (suu_1 -> wpu_1)) and (a_2 says suu_1) and (((a_1 and a_2) says df_1) -> df_1) and (a_1 and a_2 says ((wpu_1 and (u_1 says df_1)) -> df_1)) and (u_1 says df_1)) -> df_1\n%s.\n", res ? "true" : "false"); Pl_Query_End(PL_RECOVER); Pl_Stop_Prolog(); return 0; } int main(int argc, char *argv[]) { return Main_Wrapper(argc, argv); }
#include <stdlib.h> #include <string.h> #include <stdio.h> #include "spatial_validity.h" OpenAPI_spatial_validity_t *OpenAPI_spatial_validity_create( OpenAPI_list_t* presence_info_list ) { OpenAPI_spatial_validity_t *spatial_validity_local_var = OpenAPI_malloc(sizeof(OpenAPI_spatial_validity_t)); if (!spatial_validity_local_var) { return NULL; } spatial_validity_local_var->presence_info_list = presence_info_list; return spatial_validity_local_var; } void OpenAPI_spatial_validity_free(OpenAPI_spatial_validity_t *spatial_validity) { if (NULL == spatial_validity) { return; } OpenAPI_lnode_t *node; OpenAPI_list_for_each(spatial_validity->presence_info_list, node) { OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; OpenAPI_presence_info_free(localKeyValue->value); ogs_free(localKeyValue); } OpenAPI_list_free(spatial_validity->presence_info_list); ogs_free(spatial_validity); } cJSON *OpenAPI_spatial_validity_convertToJSON(OpenAPI_spatial_validity_t *spatial_validity) { cJSON *item = NULL; if (spatial_validity == NULL) { ogs_error("OpenAPI_spatial_validity_convertToJSON() failed [SpatialValidity]"); return NULL; } item = cJSON_CreateObject(); cJSON *presence_info_list = cJSON_AddObjectToObject(item, "presenceInfoList"); if (presence_info_list == NULL) { ogs_error("OpenAPI_spatial_validity_convertToJSON() failed [presence_info_list]"); goto end; } cJSON *localMapObject = presence_info_list; OpenAPI_lnode_t *presence_info_list_node; if (spatial_validity->presence_info_list) { OpenAPI_list_for_each(spatial_validity->presence_info_list, presence_info_list_node) { OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)presence_info_list_node->data; cJSON *itemLocal = localKeyValue->value ? OpenAPI_presence_info_convertToJSON(localKeyValue->value) : cJSON_CreateNull(); if (itemLocal == NULL) { ogs_error("OpenAPI_spatial_validity_convertToJSON() failed [presence_info_list]"); goto end; } cJSON_AddItemToObject(presence_info_list, localKeyValue->key, itemLocal); } } end: return item; } OpenAPI_spatial_validity_t *OpenAPI_spatial_validity_parseFromJSON(cJSON *spatial_validityJSON) { OpenAPI_spatial_validity_t *spatial_validity_local_var = NULL; cJSON *presence_info_list = cJSON_GetObjectItemCaseSensitive(spatial_validityJSON, "presenceInfoList"); if (!presence_info_list) { ogs_error("OpenAPI_spatial_validity_parseFromJSON() failed [presence_info_list]"); goto end; } OpenAPI_list_t *presence_info_listList; cJSON *presence_info_list_local_map; if (!cJSON_IsObject(presence_info_list)) { ogs_error("OpenAPI_spatial_validity_parseFromJSON() failed [presence_info_list]"); goto end; } presence_info_listList = OpenAPI_list_create(); OpenAPI_map_t *localMapKeyPair = NULL; cJSON_ArrayForEach(presence_info_list_local_map, presence_info_list) { cJSON *localMapObject = presence_info_list_local_map; if (cJSON_IsObject(presence_info_list_local_map)) { localMapKeyPair = OpenAPI_map_create( localMapObject->string, OpenAPI_presence_info_parseFromJSON(localMapObject)); } else if (cJSON_IsNull(presence_info_list_local_map)) { localMapKeyPair = OpenAPI_map_create(localMapObject->string, NULL); } else { ogs_error("OpenAPI_spatial_validity_parseFromJSON() failed [presence_info_list]"); goto end; } OpenAPI_list_add(presence_info_listList , localMapKeyPair); } spatial_validity_local_var = OpenAPI_spatial_validity_create ( presence_info_listList ); return spatial_validity_local_var; end: return NULL; } OpenAPI_spatial_validity_t *OpenAPI_spatial_validity_copy(OpenAPI_spatial_validity_t *dst, OpenAPI_spatial_validity_t *src) { cJSON *item = NULL; char *content = NULL; ogs_assert(src); item = OpenAPI_spatial_validity_convertToJSON(src); if (!item) { ogs_error("OpenAPI_spatial_validity_convertToJSON() failed"); return NULL; } content = cJSON_Print(item); cJSON_Delete(item); if (!content) { ogs_error("cJSON_Print() failed"); return NULL; } item = cJSON_Parse(content); ogs_free(content); if (!item) { ogs_error("cJSON_Parse() failed"); return NULL; } OpenAPI_spatial_validity_free(dst); dst = OpenAPI_spatial_validity_parseFromJSON(item); cJSON_Delete(item); return dst; }
///////////////////////////////////////////////////////////////////////////// // This file is part of the Journey MMORPG client // // Copyright Β© 2015-2016 Daniel Allendorf // // // // This program is free software: you can redistribute it and/or modify // // it under the terms of the GNU Affero General Public License as // // published by the Free Software Foundation, either version 3 of the // // License, or (at your option) any later version. // // // // This program is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU Affero General Public License for more details. // // // // You should have received a copy of the GNU Affero General Public License // // along with this program. If not, see <http://www.gnu.org/licenses/>. // ////////////////////////////////////////////////////////////////////////////// //Define things here. // JOURNEY_USE_ASIO : Use asio for networking, if not defined use Winsock. //#define JOURNEY_USE_ASIO // JOURNEY_USE_XXHASH : Use xxhash for file check (additional dependency) //#define JOURNEY_USE_XXHASH // JOURNEY_USE_CRYPTO : Use cryptography for communication with the server. #define JOURNEY_USE_CRYPTO // JOURNEY_PRINT_WARNINGS : Print warnings and minor errors to the console. #define JOURNEY_PRINT_WARNINGS
// Heirs of Avalon: A real-time civilization building game // Copyright (C) 2014 - 2015 David Ulrich // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published // by the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef HOA_GFX_H #define HOA_GFX_H #include "components.h" #include "defines.h" #include "gl.h" #include <SDL.h> int gfx_compile_shader(GLuint *shader,GLenum type,const GLchar *source); void gfx_draw_3d(World *w,GLfloat *rgb,SDL_Rect *r,GLuint texture); void gfx_blit_sprite(World *w,SDL_Surface *sprite,SDL_Rect *r); GLuint gfx_load_asset_img(const char *path); void gfx_free_asset_img(GLuint texture); #endif // HOA_GFX_H
ο»Ώ/* * (c) Copyright Ascensio System SIA 2010-2014 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, * EU, LV-1021. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ #pragma once #include "../PPTShape.h" class CActionButtonHelpType : public CPPTShape { public: CActionButtonHelpType() { m_bConcentricFill = true; m_eJoin = NSOfficeDrawing::lineJoinMiter; m_strPath = _T("m,l,21600r21600,l21600,xem@0@0nfl@0@2@1@2@1@0xem,nfl@0@0em,21600nfl@0@2em21600,21600nfl@1@2em21600,nfl@1@0em@33@27nfqy@3@9@40@27@39@4@37@29l@37@30@36@30@36@29qy@37@28@39@27@3@26@34@27xem@3@31nfqx@35@32@3@10@38@32@3@31xe"); AddGuide(_T("val #0")); AddGuide(_T("sum width 0 #0")); AddGuide(_T("sum height 0 #0")); AddGuide(_T("prod width 1 2")); AddGuide(_T("prod height 1 2")); AddGuide(_T("prod #0 1 2")); AddGuide(_T("prod #0 3 2")); AddGuide(_T("sum @1 @5 0")); AddGuide(_T("sum @2 @5 0")); AddGuide(_T("sum @0 @4 8100")); AddGuide(_T("sum @2 8100 @4")); AddGuide(_T("sum @0 @3 8100")); AddGuide(_T("sum @1 8100 @3")); AddGuide(_T("sum @10 0 @9")); AddGuide(_T("prod @13 1 7")); AddGuide(_T("prod @13 3 14")); AddGuide(_T("prod @13 2 7")); AddGuide(_T("prod @13 5 14")); AddGuide(_T("prod @13 11 28")); AddGuide(_T("prod @13 3 7")); AddGuide(_T("prod @13 4 7")); AddGuide(_T("prod @13 17 28")); AddGuide(_T("prod @13 9 14")); AddGuide(_T("prod @13 21 28")); AddGuide(_T("prod @13 11 14")); AddGuide(_T("prod @13 25 28")); AddGuide(_T("sum @9 @14 0")); AddGuide(_T("sum @9 @16 0")); AddGuide(_T("sum @9 @18 0")); AddGuide(_T("sum @9 @21 0")); AddGuide(_T("sum @9 @23 0")); AddGuide(_T("sum @9 @24 0")); AddGuide(_T("sum @9 @25 0")); AddGuide(_T("sum @11 @15 0")); AddGuide(_T("sum @11 @17 0")); AddGuide(_T("sum @11 @18 0")); AddGuide(_T("sum @11 @19 0")); AddGuide(_T("sum @11 @20 0")); AddGuide(_T("sum @11 @21 0")); AddGuide(_T("sum @11 @22 0")); AddGuide(_T("sum @11 @24 0")); AddGuide(_T("sum @3 @5 0")); AddGuide(_T("sum @4 @5 0")); AddGuide(_T("sum @9 @5 0")); AddGuide(_T("sum @10 @5 0")); AddGuide(_T("sum @11 @5 0")); AddGuide(_T("sum @12 @5 0")); AddGuide(_T("sum @26 @5 0")); AddGuide(_T("sum @27 @5 0")); AddGuide(_T("sum @28 @5 0")); AddGuide(_T("sum @29 @5 0")); AddGuide(_T("sum @30 @5 0")); AddGuide(_T("sum @31 @5 0")); AddGuide(_T("sum @32 @5 0")); AddGuide(_T("sum @33 @5 0")); AddGuide(_T("sum @34 @5 0")); AddGuide(_T("sum @35 @5 0")); AddGuide(_T("sum @36 @5 0")); AddGuide(_T("sum @37 @5 0")); AddGuide(_T("sum @38 @5 0")); AddGuide(_T("sum @39 @5 0")); AddGuide(_T("sum @40 @5 0")); m_arAdjustments.Add(1350); LoadConnectorsList(_T("0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0")); LoadTextRect(_T("@0,@0,@1,@2")); CHandle_ oHandle1; oHandle1.position = _T("#0,topLeft"); oHandle1.switchHandle = _T("true"); oHandle1.xrange = _T("0,5400"); m_arHandles.Add(oHandle1); m_lLimoX = 10800; m_lLimoY = 10800; } };
/* * Copyright (C) 2007-2012 Red Hat, Inc. * Copyright (C) 2010 Satoru SATOH <satoru.satoh@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.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. * * based on iptables.h */ #ifndef __DNSMASQ_H__ # define __DNSMASQ_H__ # include "virobject.h" # include "virsocketaddr.h" typedef struct { /* * Each entry holds a string, "<mac_addr>,<hostname>,<ip_addr>" such as * "01:23:45:67:89:0a,foo,10.0.0.3". */ char *host; } dnsmasqDhcpHost; typedef struct { unsigned int nhosts; dnsmasqDhcpHost *hosts; char *path; /* Absolute path of dnsmasq's hostsfile. */ } dnsmasqHostsfile; typedef struct { unsigned int nhostnames; char *ip; char **hostnames; } dnsmasqAddnHost; typedef struct { unsigned int nhosts; dnsmasqAddnHost *hosts; char *path; /* Absolute path of dnsmasq's hostsfile. */ } dnsmasqAddnHostsfile; typedef struct { char *config_dir; dnsmasqHostsfile *hostsfile; dnsmasqAddnHostsfile *addnhostsfile; } dnsmasqContext; typedef enum { DNSMASQ_CAPS_BIND_DYNAMIC = 0, /* support for --bind-dynamic */ DNSMASQ_CAPS_LAST, /* this must always be the last item */ } dnsmasqCapsFlags; typedef struct _dnsmasqCaps dnsmasqCaps; typedef dnsmasqCaps *dnsmasqCapsPtr; dnsmasqContext * dnsmasqContextNew(const char *network_name, const char *config_dir); void dnsmasqContextFree(dnsmasqContext *ctx); int dnsmasqAddDhcpHost(dnsmasqContext *ctx, const char *mac, virSocketAddr *ip, const char *name, bool ipv6); int dnsmasqAddHost(dnsmasqContext *ctx, virSocketAddr *ip, const char *name); int dnsmasqSave(const dnsmasqContext *ctx); int dnsmasqDelete(const dnsmasqContext *ctx); int dnsmasqReload(pid_t pid); dnsmasqCapsPtr dnsmasqCapsNewFromBuffer(const char *buf, const char *binaryPath); dnsmasqCapsPtr dnsmasqCapsNewFromFile(const char *dataPath, const char *binaryPath); dnsmasqCapsPtr dnsmasqCapsNewFromBinary(const char *binaryPath); int dnsmasqCapsRefresh(dnsmasqCapsPtr *caps, const char *binaryPath); bool dnsmasqCapsGet(dnsmasqCapsPtr caps, dnsmasqCapsFlags flag); const char *dnsmasqCapsGetBinaryPath(dnsmasqCapsPtr caps); unsigned long dnsmasqCapsGetVersion(dnsmasqCapsPtr caps); # define DNSMASQ_DHCPv6_MAJOR_REQD 2 # define DNSMASQ_DHCPv6_MINOR_REQD 64 # define DNSMASQ_RA_MAJOR_REQD 2 # define DNSMASQ_RA_MINOR_REQD 64 # define DNSMASQ_DHCPv6_SUPPORT(CAPS) \ (dnsmasqCapsGetVersion(CAPS) >= \ (DNSMASQ_DHCPv6_MAJOR_REQD * 1000000) + \ (DNSMASQ_DHCPv6_MINOR_REQD * 1000)) # define DNSMASQ_RA_SUPPORT(CAPS) \ (dnsmasqCapsGetVersion(CAPS) >= \ (DNSMASQ_RA_MAJOR_REQD * 1000000) + \ (DNSMASQ_RA_MINOR_REQD * 1000)) #endif /* __DNSMASQ_H__ */
#include <stdio.h> #include <stdlib.h> #include "dllist.h" /*---------------------------------------------------------------------* * PROCEDURES FOR MANIPULATING DOUBLY LINKED LISTS * Each list contains a sentinal node, so that * the first item in list l is l->flink. If l is * empty, then l->flink = l->blink = l. *---------------------------------------------------------------------*/ Dllist new_dllist() { Dllist d; d = malloc(sizeof(struct dllist)); d->flink = d; d->blink = d; return d; } /** Inserts before a given node. */ void dll_insert_b(Dllist node, Jval v) { Dllist newnode; newnode = (Dllist) malloc (sizeof(struct dllist)); newnode->val = v; newnode->flink = node; newnode->blink = node->blink; newnode->flink->blink = newnode; newnode->blink->flink = newnode; } /** Inserts after a given node. */ void dll_insert_a(Dllist n, Jval val) { dll_insert_b(n->flink, val); } /** Inserts at the end of the list. */ void dll_append(Dllist l, Jval val) { dll_insert_b(l, val); } /** Inserts at the beginning of the list. */ void dll_prepend(Dllist l, Jval val) { dll_insert_b(l->flink, val); } /** Deletes an arbitrary item. */ void dll_delete_node(Dllist node) { node->flink->blink = node->blink; node->blink->flink = node->flink; free(node); } int dll_empty(Dllist l) { return (l->flink == l); } void free_dllist(Dllist l) { while (!dll_empty(l)) { dll_delete_node(dll_first(l)); } free(l); } Jval dll_val(Dllist l) { return l->val; }
namespace measure::guessing { template<typename eT> eT prior(const Prob<eT>& pi) { Prob<eT> sorted = sort(pi); eT sum(0); for(uint x = 1; x <= sorted.n_cols; ++x) { sum += x * sorted.at(sorted.n_cols - x); } return sum; } template<typename eT> eT posterior(const Prob<eT>& pi, const Chan<eT>& C) { channel::check_prior_size(pi, C); eT result(0); for(uint y = 0; y < C.n_cols; y++) { //create the vector vy = pi(1)* C[1,y] ... pi(x)* C[x,y] Prob<eT> vy = pi % arma::trans(C.col(y)); result += prior<eT>(vy); } return result; } template<typename eT> eT add_leakage(const Prob<eT>& pi, const Chan<eT>& C) { return prior(pi) - posterior(pi, C); } template<typename eT> eT mult_leakage(const Prob<eT>& pi, const Chan<eT>& C) { return prior(pi) / posterior(pi, C); } } // namespace guessing
/* ***** BEGIN LICENSE BLOCK ***** * * Copyright (C) 2014-2015, Peter Hatina <phatina@redhat.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.1 of the * License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA * * ***** END LICENSE BLOCK ***** */ #ifndef LMIWBEM_CLASS_H # define LMIWBEM_CLASS_H # include <list> # include <boost/python/object.hpp> # include "lmiwbem.h" # include "lmiwbem_refcountedptr.h" # include "obj/lmiwbem_cimbase.h" # include "util/lmiwbem_string.h" PEGASUS_BEGIN class CIMClass; class CIMConstMethod; class CIMConstProperty; class CIMConstQualifier; PEGASUS_END namespace bp = boost::python; class CIMClass: public CIMBase<CIMClass> { public: CIMClass(); CIMClass( const bp::object &classname, const bp::object &properties, const bp::object &qualifiers, const bp::object &methods, const bp::object &superclass); static void init_type(); static bp::object create(const Pegasus::CIMClass &cls); static bp::object create(const Pegasus::CIMObject &object); Pegasus::CIMClass asPegasusCIMClass(); # if PY_MAJOR_VERSION < 3 int cmp(const bp::object &other); # else bool eq(const bp::object &other); bool gt(const bp::object &other); bool lt(const bp::object &other); bool ge(const bp::object &other); bool le(const bp::object &other); # endif // PY_MAJOR_VERSION bp::object repr(); bp::object copy(); String getClassname() const; String getSuperClassname() const; bp::object getPyClassname() const; bp::object getPySuperClassname() const; bp::object getPyProperties(); bp::object getPyQualifiers(); bp::object getPyMethods(); void setClassname(const String &classname); void setSuperClassname(const String &super_classname); void setPyClassname(const bp::object &classname); void setPySuperClassname(const bp::object &super_classname); void setPyProperties(const bp::object &properties); void setPyQualifiers(const bp::object &qualifiers); void setPyMethods(const bp::object &methods); private: String m_classname; String m_super_classname; bp::object m_properties; bp::object m_qualifiers; bp::object m_methods; RefCountedPtr<std::list<Pegasus::CIMConstProperty> > m_rc_class_properties; RefCountedPtr<std::list<Pegasus::CIMConstQualifier> > m_rc_class_qualifiers; RefCountedPtr<std::list<Pegasus::CIMConstMethod> > m_rc_class_methods; }; #endif // LMIWBEM_CLASS_H
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Messaging Framework. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.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 the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QMFDATACLIENTSERVERCOMMON_H #define QMFDATACLIENTSERVERCOMMON_H #include <e32base.h> _LIT(KQMFDataServer, "QMFDataServer"); enum TQMFDataServerPanic { EBadRequest = 1, EBadDescriptor = 2, ESrvCreateServer = 3, EMainSchedulerError = 4, ECreateTrapCleanup = 5, ESrvSessCreateTimer = 6, EReqAlreadyPending = 7 }; // Constants _LIT(KQMFDataServerName,"QMFDataServer"); _LIT(KQMFDataServerSemaphoreName, "QMFDataServerSemaphore"); const TUint KQMFDataServerMajorVersionNumber=0; const TUint KQMFDataServerMinorVersionNumber=1; const TUint KQMFDataServerBuildVersionNumber=1; enum TQMFDataServerRequest { EQMFDataServerRequestCreateDatabase, EQMFDataServerRequestOpenFile, EQMFDataServerRequestOpenOrCreateFile, EQMFDataServerRequestFileExists, EQMFDataServerRequestRenameFile, EQMFDataServerRequestDirExists, EQMFDataServerRequestMakeDir, EQMFDataServerRequestRemoveFile, EQMFDataServerRequestRemoveDir, EQMFDataServerRequestRemovePath, EQMFDataServerRequestDirListingSize, EQMFDataServerRequestDirListing }; #endif // QMFDATACLIENTSERVERCOMMON_H // End of File
/*************************************************************************** * Copyright (C) 2005-2013 by the FIFE team * * http://www.fifengine.net * * This file is part of FIFE. * * * * FIFE is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef FIFE_VFS_VFSSOURCE_H #define FIFE_VFS_VFSSOURCE_H // Standard C++ library includes #include <string> // 3rd party library includes // FIFE includes // These includes are split up in two parts, separated by one empty line // First block: files included from the FIFE root src directory // Second block: files included from the same folder #include "vfs.h" namespace FIFE { class RawData; /** VFSSource abstract baseclass * * VFSSources are used to provide transparent access to diffrent archives/filesystems etc. * Examples are VFSHostSystem * @see VFS * @see VFSSourceProvider */ class VFSSource { public: VFSSource(VFS* vfs); virtual ~VFSSource(); /** check if the given file exists * * @param file filename to check * @return true if it exists, false otherwise */ virtual bool fileExists(const std::string& file) const = 0; /** get the VFS this source is associated with. */ VFS* getVFS() const { return m_vfs; } /** open a file inside this source * * @param file the file to open * @return a new RawData* * @throws CannotOpenFile if the file can't be found */ virtual RawData* open(const std::string& file) const = 0; /** list all files in a directory of this source * * @param path path to list files in * Will return an empty list on \b any error */ virtual std::set<std::string> listFiles(const std::string& path) const = 0; /** list all directories in a directory of this source * * @param path path to list directories in * Will return an empty list on \b any error */ virtual std::set<std::string> listDirectories(const std::string& path) const = 0; protected: std::string fixPath(std::string path) const; private: VFS* m_vfs; }; } #endif
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSENSORLOG_P_H #define QSENSORLOG_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #ifdef ENABLE_RUNTIME_SENSORLOG static bool logEnabled() { static int state = -1; if (state == -1) { QByteArray sensorlog = qgetenv("SENSORLOG"); if (sensorlog == "1") state = 1; else state = 0; } return state; } #define SENSORLOG() if (!logEnabled()); else qDebug() #else // Do nothing (compiles to almost nothing) #define SENSORLOG() if (1); else qDebug() #endif #endif
/* * kinetic-c * Copyright (C) 2015 Seagate Technology. * * 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "kinetic_client.h" #include "kinetic_types.h" #include "byte_array.h" #include <stdlib.h> #include <getopt.h> #include <stdio.h> #include <sys/param.h> #include <sys/stat.h> #include <sys/file.h> typedef struct { char ip[16]; KineticSession* session; char keyPrefix[KINETIC_DEFAULT_KEY_LEN]; uint8_t key[KINETIC_DEFAULT_KEY_LEN]; uint8_t version[KINETIC_DEFAULT_KEY_LEN]; uint8_t tag[KINETIC_DEFAULT_KEY_LEN]; uint8_t value[KINETIC_OBJ_SIZE]; KineticEntry entry; ByteBuffer data; KineticStatus status; } write_args; void store_data(write_args* args) { KineticEntry* entry = &(args->entry); int32_t objIndex = 0; while (ByteBuffer_BytesRemaining(args->data) > 0) { // Configure entry meta-data ByteBuffer_Reset(&entry->key); ByteBuffer_AppendCString(&entry->key, args->keyPrefix); char keySuffix[8]; snprintf(keySuffix, sizeof(keySuffix), "%02d", objIndex); ByteBuffer_AppendCString(&entry->key, keySuffix); // Prepare entry with the next object to store ByteBuffer_Reset(&entry->value); ByteBuffer_AppendArray( &entry->value, ByteBuffer_Consume( &args->data, MIN(ByteBuffer_BytesRemaining(args->data), KINETIC_OBJ_SIZE)) ); // Store the object KineticStatus status = KineticClient_Put(args->session, entry, NULL); if (status != KINETIC_STATUS_SUCCESS) { fprintf(stderr, "Kinetic PUT of object %d to host %s failed w/ status: %s\n", objIndex, args->ip, Kinetic_GetStatusDescription(status)); exit(-1); } objIndex++; } printf("File stored on Kinetic Device across %d entries\n", objIndex); } int main(int argc, char** argv) { (void)argc; (void)argv; // Initialize kinetic-c and configure sessions KineticSession* session; KineticClientConfig clientConfig = { .logFile = "stdout", .logLevel = 1, }; KineticClient * client = KineticClient_Init(&clientConfig); if (client == NULL) { return 1; } const char HmacKeyString[] = "asdfasdf"; KineticSessionConfig sessionConfig = { .host = "localhost", .port = KINETIC_PORT, .clusterVersion = 0, .identity = 1, .hmacKey = ByteArray_CreateWithCString(HmacKeyString), }; KineticStatus status = KineticClient_CreateSession(&sessionConfig, client, &session); if (status != KINETIC_STATUS_SUCCESS) { fprintf(stderr, "Failed connecting to the Kinetic device w/status: %s\n", Kinetic_GetStatusDescription(status)); exit(1); } // Read in file contents to store const char* dataFile = "test/support/data/test.data"; struct stat st; stat(dataFile, &st); char* buf = malloc(st.st_size); int fd = open(dataFile, O_RDONLY); long dataLen = read(fd, buf, st.st_size); close(fd); if (dataLen <= 0) { fprintf(stderr, "Failed reading data file to store: %s\n", dataFile); exit(-1); } write_args* writeArgs = calloc(1, sizeof(write_args)); writeArgs->session = session; // Create a ByteBuffer for consuming chunks of data out of for overlapped PUTs writeArgs->data = ByteBuffer_Create(buf, dataLen, 0); // Configure common meta-data for the entries struct timeval now; gettimeofday(&now, NULL); snprintf(writeArgs->keyPrefix, sizeof(writeArgs->keyPrefix), "%010ld_", now.tv_sec); ByteBuffer verBuf = ByteBuffer_Create(writeArgs->version, sizeof(writeArgs->version), 0); ByteBuffer_AppendCString(&verBuf, "v1.0"); ByteBuffer tagBuf = ByteBuffer_Create(writeArgs->tag, sizeof(writeArgs->tag), 0); ByteBuffer_AppendCString(&tagBuf, "some_value_tag..."); writeArgs->entry = (KineticEntry) { .key = ByteBuffer_Create(writeArgs->key, sizeof(writeArgs->key), 0), // .newVersion = verBuf, .tag = tagBuf, .algorithm = KINETIC_ALGORITHM_SHA1, .value = ByteBuffer_Create(writeArgs->value, sizeof(writeArgs->value), 0), .synchronization = KINETIC_SYNCHRONIZATION_WRITEBACK, }; strcpy(writeArgs->ip, sessionConfig.host); // Store the data printf("\nWriting data file to the Kinetic device...\n"); store_data(writeArgs); // Shutdown client connection and cleanup KineticClient_DestroySession(writeArgs->session); KineticClient_Shutdown(client); free(writeArgs); free(buf); return 0; }
// // Bareflank Hypervisor // // Copyright (C) 2015 Assured Information Security, Inc. // Author: Rian Quinn <quinnr@ainfosec.com> // Author: Brendan Kerrigan <kerriganb@ainfosec.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.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #ifndef PROCESS_LIST_DATA_H #define PROCESS_LIST_DATA_H #include <gsl/gsl> #include <user_data.h> class domain; class process_list_data : public user_data { public: process_list_data() noexcept : m_domain(nullptr) { } ~process_list_data() override = default; domain *m_domain; public: process_list_data(process_list_data &&) = default; process_list_data &operator=(process_list_data &&) = default; process_list_data(const process_list_data &) = delete; process_list_data &operator=(const process_list_data &) = delete; }; #endif
#pragma once #include "DllModule.h" DLL_API int DllSum1(); DLL_API int DllSum2(); DLL_API int DllSum3(); DLL_API int DllSum4();
/* IteratorDictIDNoContiguous.h * Copyright (C) 2014, Francisco Claude & Rodrigo Canovas & Miguel A. Martinez-Prieto * all rights reserved. * * Iterator class for scanning streams of no contiguous IDs. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * * Contacting the authors: * Francisco Claude: fclaude@recoded.cl * Rodrigo Canovas: rcanovas@student.unimelb.edu.au * Miguel A. Martinez-Prieto: migumar2@infor.uva.es */ #ifndef _ITERATORDICTIDNOCONTIGUOUS_H #define _ITERATORDICTIDNOCONTIGUOUS_H #include <iostream> using namespace std; class IteratorDictIDNoContiguous : public IteratorDictID { public: /** ID Iterator Constructor for streams of contiguous elements. @param ids: the array of ids @param scanneable: the number of ids in the array */ IteratorDictIDNoContiguous(size_t *ids, size_t scanneable) { this->ids = ids; this->scanneable = scanneable; this->processed = 0; } /** Extracts the next ID in the stream. @returns the next ID. */ size_t next() { return ids[processed++]; } /** Generic destructor */ ~IteratorDictIDNoContiguous() { delete [] ids; } protected: size_t *ids; // Array of ids }; #endif
/* @file rm_core.c * @brief Daemon's start up. * @author Piotr Gregor <piotrgregor@rsyncme.org> * @date 02 Jan 2016 02:50 PM * @copyright LGPLv2.1 */ #include "rm_core.h" #include "rm_do_msg.h" #include "twlist.h" enum rm_error rm_core_init(struct rsyncme *rm, struct rm_core_options *opt) { assert(rm != NULL); memset(rm, 0, sizeof(struct rsyncme)); twhash_init(rm->sessions); TWINIT_LIST_HEAD(&rm->sessions_list); memcpy(&rm->opt, opt, sizeof(struct rm_core_options)); rm->state = RM_CORE_ST_INITIALIZED; RM_LOG_INFO("%s", "Starting main work queue"); if (rm_wq_workqueue_init(&rm->wq, RM_WORKERS_N, "main_queue") != RM_ERR_OK) { /* TODO CPU checking, choose optimal number of threads */ return RM_ERR_WORKQUEUE_CREATE; } return RM_ERR_OK; } enum rm_error rm_core_deinit(struct rsyncme *rm) { if (twhash_empty(rm->sessions) != 0) { return RM_ERR_BUSY; } if (twlist_empty(&rm->sessions_list) != 1) { return RM_ERR_FAIL; } RM_LOG_INFO("%s", "Stopping main work queue"); if (rm_wq_workqueue_stop(&rm->wq) != RM_ERR_OK) { return RM_ERR_WORKQUEUE_STOP; } if (rm_wq_workqueue_deinit(&rm->wq) != RM_ERR_OK) { return RM_ERR_MEM; } return RM_ERR_OK; } struct rm_session* rm_core_session_find(struct rsyncme *rm, unsigned char session_id[RM_UUID_LEN]) { struct rm_session *s; uint32_t h; uint16_t key; assert(rm != NULL); pthread_mutex_lock(&rm->mutex); memcpy(&key, session_id, rm_min(RM_UUID_LEN, sizeof(key))); h = twhash_min(key, RM_SESSION_HASH_BITS); twhlist_for_each_entry(s, &rm->sessions[h], hlink) { if (memcmp(&s->id, session_id, RM_UUID_LEN) == 0) { pthread_mutex_lock(&s->mutex); return s; } } pthread_mutex_unlock(&rm->mutex); return NULL; } void rm_core_session_add(struct rsyncme *rm, struct rm_session *s) { assert(rm != NULL); assert(s != NULL); pthread_mutex_lock(&rm->mutex); twlist_add(&rm->sessions_list, &s->link); /* TODO temporary hash using first 4 bytes from hash.data -> do it better */ twhash_add(rm->sessions, &s->hlink, (long)s->hash.data); /* TODO temporary hash using long from 16 byte hash.data -> do it better */ uint32_t key; memcpy(&key, s->hash.data, sizeof(key)); s->hashed_hash = twhash_min(key, TWHASH_BITS(rm->sessions)); /* save the hashed_hash */ rm->sessions_n++; pthread_mutex_unlock(&rm->mutex); return; } void rm_core_session_del(struct rsyncme *rm, struct rm_session *s) { assert(s != NULL); pthread_mutex_lock(&rm->mutex); twlist_del(&s->link); twhash_del(&s->hlink); pthread_mutex_unlock(&rm->mutex); } enum rm_error rm_core_authenticate(struct sockaddr_in *cli_addr) { char a[INET_ADDRSTRLEN]; /* IPv4 * cli_ip = cli_addr.sin_addr.s_addr; * inet_ntop(AF_INET, &cli_ip, cli_ip_str, INET_ADDRSTRLEN); * cli_port = ntohs(cli_addr.sin_port); */ inet_ntop(AF_INET, &cli_addr->sin_addr, a, INET_ADDRSTRLEN); if (strcmp(a, RM_IP_AUTH) != 0) return RM_ERR_FAIL; return RM_ERR_OK; } uint32_t rm_core_hdr_hash(struct rm_msg_hdr *hdr) { return twhash_32(((hdr->pt << 24) | (hdr->flags << 16) | hdr->len), RM_CORE_HASH_CHALLENGE_BITS); } enum rm_error rm_core_validate_hash(unsigned char *buf) { uint32_t hash, challenge; uint8_t pt, flags; uint16_t len; hash = rm_get_msg_hdr_hash(buf); pt = rm_get_msg_hdr_pt(buf); flags = rm_get_msg_hdr_flags(buf); len = rm_get_msg_hdr_len(buf); challenge = twhash_32(((pt << 24) | (flags << 16) | len), RM_CORE_HASH_CHALLENGE_BITS); if (hash != challenge) { return RM_ERR_FAIL; } return RM_ERR_OK; } enum rm_error rm_core_tcp_msg_valid_pt(unsigned char* buf) { uint8_t pt = rm_get_msg_hdr_pt(buf); if (pt == RM_PT_MSG_PUSH || pt == RM_PT_MSG_PUSH_ACK || pt == RM_PT_MSG_PULL || pt == RM_PT_MSG_PULL_ACK || pt == RM_PT_MSG_BYE) { return RM_ERR_OK; } return RM_ERR_FAIL; } enum rm_error rm_core_tcp_msg_hdr_validate(unsigned char *buf, int read_n) { if ((size_t)read_n < sizeof(struct rm_msg_hdr)) { return RM_ERR_FAIL; } if (rm_core_validate_hash(buf) != RM_ERR_OK) { return RM_ERR_FAIL; } if (rm_core_tcp_msg_valid_pt(buf) != RM_ERR_OK) { return RM_ERR_MSG_PT_UNKNOWN; } /* TODO validate all fields */ return RM_ERR_OK; } enum rm_error rm_core_tcp_msg_ack_validate(unsigned char *buf, int read_n) { return rm_core_tcp_msg_hdr_validate(buf, read_n); } int rm_core_select(int fd, enum rm_io_direction io_direction, uint16_t timeout_s, uint16_t timeout_us) { fd_set fdset; struct timeval tv; tv.tv_sec = timeout_s; tv.tv_usec = timeout_us; FD_ZERO(&fdset); FD_SET(fd, &fdset); switch (io_direction) { case RM_READ: return select(fd + 1, &fdset, NULL, NULL, &tv); case RM_WRITE: return select(fd + 1, NULL, &fdset, NULL, &tv); default: return -1; } } enum rm_error rm_core_tcp_msg_assemble(int fd, enum rm_pt_type pt, void **body_raw, size_t bytes_n) { enum rm_error err; switch (pt) { case RM_PT_MSG_PUSH: case RM_PT_MSG_PULL: *body_raw = malloc(bytes_n); if (*body_raw == NULL) { return RM_ERR_MEM; } err = rm_tcp_rx(fd, *body_raw, bytes_n); if (err != RM_ERR_OK) { free(*body_raw); *body_raw = NULL; return RM_ERR_READ; } break; case RM_PT_MSG_BYE: break; default: break; } return RM_ERR_OK; } enum rm_error rm_core_reload_config(struct rsyncme *rm) /* TODO */ { (void) rm; return RM_ERR_OK; }
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** ** GNU Lesser General Public License Usage ** ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this file. ** Please review the following information to ensure the GNU Lesser General ** Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** Other Usage ** ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** **************************************************************************/ #ifndef IOUTILS_H #define IOUTILS_H #include <QtCore/QString> QT_USE_NAMESPACE namespace ProFileEvaluatorInternal { /*! This class provides replacement functionality for QFileInfo, QFile & QDir, as these are abysmally slow. */ class IoUtils { public: enum FileType { FileNotFound = 0, FileIsRegular = 1, FileIsDir = 2 }; static FileType fileType(const QString &fileName); static bool exists(const QString &fileName) { return fileType(fileName) != FileNotFound; } static bool isRelativePath(const QString &fileName); static bool isAbsolutePath(const QString &fileName) { return !isRelativePath(fileName); } static QStringRef fileName(const QString &fileName); // Requires normalized path static QString resolvePath(const QString &baseDir, const QString &fileName); #ifdef QT_BOOTSTRAPPED static QString shellQuote(const QString &arg); #endif }; } #endif // IOUTILS_H
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** Commercial Usage ** ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** **************************************************************************/ #ifndef DESIGNERSETTINGS_H #define DESIGNERSETTINGS_H #include <QtCore/QtGlobal> QT_BEGIN_NAMESPACE class QSettings; QT_END_NAMESPACE namespace QmlDesigner { struct DesignerSettings { DesignerSettings(); void fromSettings(QSettings *); void toSettings(QSettings *) const; bool equals(const DesignerSettings &other) const; bool snapToGrid; bool showBoundingRectangles; bool onlyShowItemsWithContents; }; inline bool operator==(const DesignerSettings &s1, const DesignerSettings &s2) { return s1.equals(s2); } inline bool operator!=(const DesignerSettings &s1, const DesignerSettings &s2) { return !s1.equals(s2); } } // namespace QmlDesigner #endif // DESIGNERSETTINGS_H
#ifndef EVIEW_H #define EVIEW_H #include <QDialog> #include "plaintextedit.h" // --------------------------------------------------------------------- class Eview : public PlainTextEditLn { Q_OBJECT public: Eview(QWidget *parent = 0); }; // --------------------------------------------------------------------- class TextView : public QDialog { Q_OBJECT public: TextView(QString t,QString h,QString s); private: void closeall(); void closeme(); void closeEvent(QCloseEvent *event); void help(); void keyPressEvent(QKeyEvent *e); void reject(); void savepos(); void togglemax(); void togglenos(); void zoom(int); Eview *ev; bool max; }; void textview(QString t,QString s); void textview(QString t,QStringList s); void textview(QString t,QString c,QString s); void textview(QString s); void textview(QStringList s); #endif
/* * This file is part of meego-keyboard * * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * Contact: Nokia Corporation (directui@nokia.com) * * If you have questions regarding the use of this file, please contact * Nokia at directui@nokia.com. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1 as published by the Free Software Foundation * and appearing in the file LICENSE.LGPL included in the packaging * of this file. */ #ifndef MTOOLBARLABELVIEW_H #define MTOOLBARLABELVIEW_H #include <MLabelView> #include "mtoolbarlabelstyle.h" class MToolbarLabel; class MToolbarLabelView : public MLabelView { Q_OBJECT M_VIEW(MLabelModel, MToolbarLabelStyle) public: explicit MToolbarLabelView(MToolbarLabel *controller); }; #endif
// $Id: matrix_LTI.h 30606 2009-10-02 10:01:02Z tdelaet $ // Copyright (C) 2002 Klaas Gadeyne <first dot last at gmail dot com> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation; either version 2.1 of the License, or // (at your option) any later version. // // This 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 Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser 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. // #include "../config.h" #ifdef __MATRIXWRAPPER_LTI__ #ifndef __MATRIX_LTI__ #define __MATRIX_LTI__ #include "matrix_wrapper.h" #include "vector_wrapper.h" #include <ltilib/ltiMatrix.h> #include <assert.h> // To avoid problems and clarify things // with namespaces, we use some macros #define ltiMatrix lti::matrix<double> #define ltiSymmetricMatrix lti::matrix<double> #define ltiColumnVector lti::vector<double> /// Wrapper class for Matrix using LTI class MyMatrix : public ltiMatrix, public MatrixWrapper::Matrix_Wrapper { private: // No private members: We don't add anything. public: // Public Members /// Constructor Matrix(); /// Constructor Matrix(int m, int n); /// Destructor virtual ~Matrix(); /// Copy constructor Matrix (const MyMatrix& a); /// Copy constructor Matrix(const ltiMatrix & a); virtual unsigned int rows() const; virtual unsigned int columns() const; virtual double& operator()(unsigned int,unsigned int); virtual const double operator()(unsigned int,unsigned int) const; virtual const bool operator==(const MyMatrix& a) const; virtual MyMatrix& operator =(double a); virtual MyMatrix& operator +=(double a); virtual MyMatrix& operator -=(double a); virtual MyMatrix& operator *=(double b); virtual MyMatrix& operator /=(double b); virtual MyMatrix operator+ (double b) const; virtual MyMatrix operator- (double b) const; virtual MyMatrix operator* (double b) const; virtual MyMatrix operator/ (double b) const; virtual MyMatrix& operator =(const MySymmetricMatrix& a); virtual MyMatrix& operator +=(const MyMatrix& a); virtual MyMatrix& operator -=(const MyMatrix& a); virtual MyMatrix operator+ (const MyMatrix &a) const; virtual MyMatrix operator- (const MyMatrix &a) const; virtual MyMatrix operator* (const MyMatrix &a) const; virtual MyColumnVector operator* ( const MyColumnVector &b) const; virtual MyRowVector rowCopy(unsigned int r) const; virtual MyColumnVector columnCopy(unsigned int c) const; virtual void resize(unsigned int i, unsigned int j, bool copy=true, bool initialize=true); virtual MyMatrix inverse() const; virtual MyMatrix transpose() const; virtual double determinant() const; virtual int convertToSymmetricMatrix(MySymmetricMatrix& sym); virtual MyMatrix sub(int i_start, int i_end, int j_start , int j_end) const; }; class MySymmetricMatrix : public ltiSymmetricMatrix, public SymmetricMatrix_Wrapper { public: // Constructors SymmetricMatrix(); SymmetricMatrix(int n); // Copy constructors SymmetricMatrix(const SymmetricMatrix& a); SymmetricMatrix(const ltiSymmetricMatrix & a); // Destructor virtual ~SymmetricMatrix(); virtual unsigned int rows() const; virtual unsigned int columns() const; virtual MySymmetricMatrix inverse() const; virtual MySymmetricMatrix transpose() const; virtual double determinant() const; virtual double& operator()(unsigned int,unsigned int); virtual const double operator()(unsigned int,unsigned int) const; virtual const bool operator==(const MySymmetricMatrix& a) const; virtual MySymmetricMatrix& operator=(double a); virtual MySymmetricMatrix& operator +=(double a); virtual MySymmetricMatrix& operator -=(double a); virtual MySymmetricMatrix& operator *=(double b); virtual MySymmetricMatrix& operator /=(double b); virtual MySymmetricMatrix operator + (double b) const; virtual MySymmetricMatrix operator - (double b) const; virtual MySymmetricMatrix operator * (double b) const; virtual MySymmetricMatrix operator / (double b) const; virtual MyMatrix& operator +=(const MyMatrix& a); virtual MyMatrix& operator -=(const MyMatrix& a); virtual MyMatrix operator + (const MyMatrix &a) const; virtual MyMatrix operator - (const MyMatrix &a) const; virtual MyMatrix operator * (const MyMatrix &a) const; virtual MySymmetricMatrix& operator +=(const MySymmetricMatrix& a); virtual MySymmetricMatrix& operator -=(const MySymmetricMatrix& a); virtual MySymmetricMatrix operator + (const MySymmetricMatrix &a) const; virtual MySymmetricMatrix operator - (const MySymmetricMatrix &a) const; virtual MyMatrix operator * (const MySymmetricMatrix& a) const; virtual MyColumnVector operator* (const MyColumnVector &b) const; //virtual void multiply (const MyColumnVector &b, MyColumnVector &result) const; virtual void resize(unsigned int i, bool copy=true, bool initialize=true); virtual MyMatrix sub(int i_start, int i_end, int j_start , int j_end) const; }; #endif #endif