text
stringlengths
4
6.14k
/* * Copyright (C) 2009, 2010 Nick Johnson <nickbjohnson4224 at gmail.com> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef DEBUG_H #define DEBUG_H #include <stdint.h> #include <stddef.h> /**************************************************************************** * SCREEN * * possible settings: * NONE - do not output from the kernel * VGA_FULL - use whole VGA text console for kernel output * VGA_RIGHT - use (and scroll) only left half of VGA text console * SERIAL - output via serial port */ #define NONE 1 #define VGA_FULL 2 #define VGA_RIGHT 3 #define SERIAL 4 #define SCREEN SERIAL /* debug screen state ******************************************************/ #if (SCREEN == VGA_FULL) || (SCREEN == VGA_RIGHT) extern uint16_t *__vga_video_mem; extern size_t __vga_cursor_base; extern size_t __vga_cursor_pos; extern uint8_t __vga_cursor_attr; #endif /* debug screen operations *************************************************/ void debug_init (void); void debug_clear (void); void debug_scroll(size_t lines); void debug_char (char c); void debug_string(const char *s); void debug_color (uint32_t color); #if (SCREEN == NONE) || (SCREEN == SERIAL) #define COLOR_BLACK 0x00 #define COLOR_DBLUE 0x00 #define COLOR_DGREEN 0x00 #define COLOR_DCYAN 0x00 #define COLOR_DRED 0x00 #define COLOR_DMAGENTA 0x00 #define COLOR_DORANGE 0x00 #define COLOR_LGRAY 0x00 #define COLOR_DGRAY 0x00 #define COLOR_BLUE 0x00 #define COLOR_GREEN 0x00 #define COLOR_CYAN 0x00 #define COLOR_RED 0x00 #define COLOR_MAGENTA 0x00 #define COLOR_ORANGE 0x00 #define COLOR_WHITE 0x00 #endif #if (SCREEN == VGA_FULL) || (SCREEN == VGA_RIGHT) #define COLOR_BLACK 0x00 #define COLOR_DBLUE 0x01 #define COLOR_DGREEN 0x02 #define COLOR_DCYAN 0x03 #define COLOR_DRED 0x04 #define COLOR_DMAGENTA 0x05 #define COLOR_DORANGE 0x06 #define COLOR_LGRAY 0x07 #define COLOR_DGRAY 0x08 #define COLOR_BLUE 0x09 #define COLOR_GREEN 0x0A #define COLOR_CYAN 0x0B #define COLOR_RED 0x0C #define COLOR_MAGENTA 0x0D #define COLOR_ORANGE 0x0E #define COLOR_WHITE 0x0F #endif /* high level debugging output *********************************************/ void __itoa(char *buffer, size_t number, size_t base); void debug_printf(const char *fmt, ...); void debug_panic (const char *message); void debug_dumpi (uintptr_t *base, int count); /* debugger - TODO *********************************************************/ #endif/*DEBUG_H*/
/* * Copyright (c) 2014, Thorben Hasenpusch <t.hasenpusch@icloud.com> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "uefi/types.h" // {0379BE4E-D706-437d-B037-EDB82FB772A4} constexpr EFI_GUID EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID = { 0x379be4e, 0xd706, 0x437d, 0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 }; struct EFI_DEVICE_PATH_PROTOCOL; using EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE = EFIAPI UINTN (*)(CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath); using EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH = EFIAPI EFI_DEVICE_PATH_PROTOCOL *(*)(CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath); using EFI_DEVICE_PATH_UTILS_APPEND_PATH = EFIAPI EFI_DEVICE_PATH_PROTOCOL *(*)(CONST EFI_DEVICE_PATH_PROTOCOL *Src1, CONST EFI_DEVICE_PATH_PROTOCOL *Src2); using EFI_DEVICE_PATH_UTILS_APPEND_NODE = EFIAPI EFI_DEVICE_PATH_PROTOCOL *(*)(CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode); using EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE = EFIAPI EFI_DEVICE_PATH_PROTOCOL *( *)(CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance); using EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE = EFIAPI EFI_DEVICE_PATH_PROTOCOL *(*)(EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance, UINTN *DevicePathInstanceSize); using EFI_DEVICE_PATH_UTILS_CREATE_NODE = EFIAPI EFI_DEVICE_PATH_PROTOCOL *(*)(UINT8 Nodetype, UINT8 NodeSubType, UINT16 NodeLength); using EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE = EFIAPI BOOLEAN (*)(CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath); struct EFI_DEVICE_PATH_UTILITIES_PROTOCOL { EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize; EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath; EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath; EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode; EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance; EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance; EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance; EFI_DEVICE_PATH_UTILS_CREATE_NODE CreateDeviceNode; };
#ifndef _SYS_UIO_H #define _SYS_UIO_H #include <sys/types.h> #include <limits.h> struct iovec { void* iov_base; size_t iov_len; }; #ifdef __cplusplus extern "C" { #endif ssize_t readv(int fildes, const struct iovec *iov, int iovcnt); ssize_t writev(int fildes, const struct iovec *iov, int iovcnt); #ifdef __cplusplus } #endif #endif
// // ATERCLabel.h // ATERichContent // // Created by David Martinez on 5/3/15. // Copyright (c) 2015 Atenea. All rights reserved. // #import "ATERC.h" @interface ATERCLabel : ATERC @property (nonatomic, strong) NSString *mText; @end
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2012-2015 The Deuscoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef DEUSCOIN_UI_INTERFACE_H #define DEUSCOIN_UI_INTERFACE_H #include <stdint.h> #include <string> #include <boost/signals2/last_value.hpp> #include <boost/signals2/signal.hpp> class CBasicKeyStore; class CWallet; class uint256; class CBlockIndex; /** General change type (added, updated, removed). */ enum ChangeType { CT_NEW, CT_UPDATED, CT_DELETED }; /** Signals for UI communication. */ class CClientUIInterface { public: /** Flags for CClientUIInterface::ThreadSafeMessageBox */ enum MessageBoxFlags { ICON_INFORMATION = 0, ICON_WARNING = (1U << 0), ICON_ERROR = (1U << 1), /** * Mask of all available icons in CClientUIInterface::MessageBoxFlags * This needs to be updated, when icons are changed there! */ ICON_MASK = (ICON_INFORMATION | ICON_WARNING | ICON_ERROR), /** These values are taken from qmessagebox.h "enum StandardButton" to be directly usable */ BTN_OK = 0x00000400U, // QMessageBox::Ok BTN_YES = 0x00004000U, // QMessageBox::Yes BTN_NO = 0x00010000U, // QMessageBox::No BTN_ABORT = 0x00040000U, // QMessageBox::Abort BTN_RETRY = 0x00080000U, // QMessageBox::Retry BTN_IGNORE = 0x00100000U, // QMessageBox::Ignore BTN_CLOSE = 0x00200000U, // QMessageBox::Close BTN_CANCEL = 0x00400000U, // QMessageBox::Cancel BTN_DISCARD = 0x00800000U, // QMessageBox::Discard BTN_HELP = 0x01000000U, // QMessageBox::Help BTN_APPLY = 0x02000000U, // QMessageBox::Apply BTN_RESET = 0x04000000U, // QMessageBox::Reset /** * Mask of all available buttons in CClientUIInterface::MessageBoxFlags * This needs to be updated, when buttons are changed there! */ BTN_MASK = (BTN_OK | BTN_YES | BTN_NO | BTN_ABORT | BTN_RETRY | BTN_IGNORE | BTN_CLOSE | BTN_CANCEL | BTN_DISCARD | BTN_HELP | BTN_APPLY | BTN_RESET), /** Force blocking, modal message box dialog (not just OS notification) */ MODAL = 0x10000000U, /** Do not print contents of message to debug log */ SECURE = 0x40000000U, /** Predefined combinations for certain default usage cases */ MSG_INFORMATION = ICON_INFORMATION, MSG_WARNING = (ICON_WARNING | BTN_OK | MODAL), MSG_ERROR = (ICON_ERROR | BTN_OK | MODAL) }; /** Show message box. */ boost::signals2::signal<bool (const std::string& message, const std::string& caption, unsigned int style), boost::signals2::last_value<bool> > ThreadSafeMessageBox; /** Progress message during initialization. */ boost::signals2::signal<void (const std::string &message)> InitMessage; /** Number of network connections changed. */ boost::signals2::signal<void (int newNumConnections)> NotifyNumConnectionsChanged; /** * New, updated or cancelled alert. * @note called with lock cs_mapAlerts held. */ boost::signals2::signal<void (const uint256 &hash, ChangeType status)> NotifyAlertChanged; /** A wallet has been loaded. */ boost::signals2::signal<void (CWallet* wallet)> LoadWallet; /** Show progress e.g. for verifychain */ boost::signals2::signal<void (const std::string &title, int nProgress)> ShowProgress; /** New block has been accepted */ boost::signals2::signal<void (bool, const CBlockIndex *)> NotifyBlockTip; /** Banlist did change. */ boost::signals2::signal<void (void)> BannedListChanged; }; extern CClientUIInterface uiInterface; #endif // DEUSCOIN_UI_INTERFACE_H
#ifndef _CONSOLE_H #define _CONSOLE_H #include <motors.h> #include <balance.h> #include <position.h> class Console { public: Console(Motors* motors, Balance* balance, Position* position, structPid* balancePid, structPid* positionPid); void init(); void loop(unsigned long, double); private: Motors* motors; Balance* balance; Position* position; structPid* balancePid; structPid* positionPid; String inputString; void analyse(); float getFloatValue(); }; #endif
// // CeldaTableViewCell.h // Lista // // Created by Bryan A Bolivar M on 5/9/15. // Copyright (c) 2015 Bolivar. All rights reserved. // #import <UIKit/UIKit.h> @interface CeldaTableViewCell : UITableViewCell @property (weak, nonatomic) IBOutlet UILabel *nombre; @property (weak, nonatomic) IBOutlet UILabel *posicion; @property (weak, nonatomic) IBOutlet UILabel *goles; @property (weak, nonatomic) IBOutlet UIImageView *foto; -(void)cargarFotoDesdeURL:(NSURL *)url; @end
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_TXDB_H #define BITCOIN_TXDB_H #include <coins.h> #include <dbwrapper.h> #include <chain.h> #include <primitives/block.h> #include <memory> #include <string> #include <utility> #include <vector> class CBlockIndex; class CCoinsViewDBCursor; class uint256; //! No need to periodic flush if at least this much space still available. static constexpr int MAX_BLOCK_COINSDB_USAGE = 10; //! -dbcache default (MiB) static const int64_t nDefaultDbCache = 450; //! -dbbatchsize default (bytes) static const int64_t nDefaultDbBatchSize = 16 << 20; //! max. -dbcache (MiB) static const int64_t nMaxDbCache = sizeof(void*) > 4 ? 16384 : 1024; //! min. -dbcache (MiB) static const int64_t nMinDbCache = 4; //! Max memory allocated to block tree DB specific cache, if no -txindex (MiB) static const int64_t nMaxBlockDBCache = 2; //! Max memory allocated to block tree DB specific cache, if -txindex (MiB) // Unlike for the UTXO database, for the txindex scenario the leveldb cache make // a meaningful difference: https://github.com/bitcoin/bitcoin/pull/8273#issuecomment-229601991 static const int64_t nMaxTxIndexCache = 1024; //! Max memory allocated to all block filter index caches combined in MiB. static const int64_t max_filter_index_cache = 1024; //! Max memory allocated to coin DB specific cache (MiB) static const int64_t nMaxCoinsDBCache = 8; /** CCoinsView backed by the coin database (chainstate/) */ class CCoinsViewDB final : public CCoinsView { protected: CDBWrapper db; public: /** * @param[in] ldb_path Location in the filesystem where leveldb data will be stored. */ explicit CCoinsViewDB(fs::path ldb_path, size_t nCacheSize, bool fMemory, bool fWipe); bool GetCoin(const COutPoint &outpoint, Coin &coin) const override; bool HaveCoin(const COutPoint &outpoint) const override; uint256 GetBestBlock() const override; std::vector<uint256> GetHeadBlocks() const override; bool GetName(const valtype &name, CNameData &data) const override; bool GetNameHistory(const valtype &name, CNameHistory &data) const override; bool GetNamesForHeight(unsigned nHeight, std::set<valtype>& data) const override; CNameIterator* IterateNames() const override; bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock, const CNameCache &names) override; CCoinsViewCursor *Cursor() const override; bool ValidateNameDB() const override; //! Attempt to update from an older database format. Returns whether an error occurred. bool Upgrade(); size_t EstimateSize() const override; }; /** Specialization of CCoinsViewCursor to iterate over a CCoinsViewDB */ class CCoinsViewDBCursor: public CCoinsViewCursor { public: ~CCoinsViewDBCursor() {} bool GetKey(COutPoint &key) const override; bool GetValue(Coin &coin) const override; unsigned int GetValueSize() const override; bool Valid() const override; void Next() override; private: CCoinsViewDBCursor(CDBIterator* pcursorIn, const uint256 &hashBlockIn): CCoinsViewCursor(hashBlockIn), pcursor(pcursorIn) {} std::unique_ptr<CDBIterator> pcursor; std::pair<char, COutPoint> keyTmp; friend class CCoinsViewDB; }; /** Access to the block database (blocks/index/) */ class CBlockTreeDB : public CDBWrapper { public: explicit CBlockTreeDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false); bool WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo); bool ReadBlockFileInfo(int nFile, CBlockFileInfo &info); bool ReadLastBlockFile(int &nFile); bool WriteReindexing(bool fReindexing); void ReadReindexing(bool &fReindexing); bool WriteFlag(const std::string &name, bool fValue); bool ReadFlag(const std::string &name, bool &fValue); bool LoadBlockIndexGuts(const Consensus::Params& consensusParams, std::function<CBlockIndex*(const uint256&)> insertBlockIndex); }; #endif // BITCOIN_TXDB_H
// // SSAppDelegate.h // FlipFlobjc // // Created by Sam Stone on 07/03/2015. // Copyright (c) 2015 Sam Stone. All rights reserved. // @import UIKit; @interface SSAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* * Copyright 2017 Ian Johnson * * This is free software, distributed under the MIT license. A copy of the * license can be found in the LICENSE file in the project root, or at * https://opensource.org/licenses/MIT. */ /** * @file * The Chip-8 assembler. */ #ifndef CHIP8_ASSEMBLER_H #define CHIP8_ASSEMBLER_H #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include "instruction.h" /** * Options which can be set for the assembler. */ struct chip8asm_options { /** * Whether to enable shift quirks mode (default false). */ bool shift_quirks; }; /** * An assembled Chip-8 program. */ struct chip8asm_program { /** * The bytes of the assembled program. * * This is only the memory of the program itself, and does not include the * reserved area for the interpreter, which ends at CHIP8_PROG_START. */ uint8_t mem[CHIP8_PROG_SIZE]; /** * The length of the assembled program. */ size_t len; }; /** * Contains the state of the assembler. */ struct chip8asm; /** * Initializes a new assembler. */ struct chip8asm *chip8asm_new(struct chip8asm_options opts); /** * Destroys the given assembler. */ void chip8asm_destroy(struct chip8asm *chipasm); /** * Emits parsed assembly code into the given program. * * This will take all instructions which have been processed using * `chip8asm_process_line`, run the second pass (which substitutes labels for * their corresponding addresses, etc.), and put the corresponding binary code * into the given program buffer. Note that only labels and constants which * have been defined using invocations of `chip8asm_process_line` up to this * point will be defined; if an attempt is made to reference a label or * constant which has not yet been defined by some line processed by this * assembler, an error will result. * * @return An error code. */ int chip8asm_emit(struct chip8asm *chipasm, struct chip8asm_program *prog); /** * Attempts to evaluate the given expression. * * The current state of the assembler will be used to access label addresses and * constant values. * * @param line The line that the expression appears on (for error messages). * @param[out] value The result of the evaluation. * @return 0 if parsed successfully, and a nonzero value if not. */ int chip8asm_eval(const struct chip8asm *chipasm, const char *expr, int line, uint16_t *value); /** * Processes the given line of assembly code as part of the first pass. * * More specifically, the line will be parsed into an internal "instruction" * format and added to the list of instructions to be processed during the * second pass (which can be triggered using `chip8_emit`). * * @return An error code. */ int chip8asm_process_line(struct chip8asm *chipasm, const char *line); /** * Returns the default set of options for the assembler. */ struct chip8asm_options chip8asm_options_default(void); /** * Returns a new program with an empty buffer. */ struct chip8asm_program *chip8asm_program_new(void); /** * Destroys the given program. */ void chip8asm_program_destroy(struct chip8asm_program *prog); /** * Returns the opcode of the instruction at the given address. * * Note that this does not check whether the address you give is aligned, so be * careful! */ uint16_t chip8asm_program_opcode( const struct chip8asm_program *prog, uint16_t addr); #endif
#ifndef RTC_H__ #define RTC_H__ /** @defgroup rtc rtc * @{ * Constants and functions for managing RTC driver */ #define RTC_ADDR_REG 0x70 #define RTC_DATA_REG 0x71 #define RTC_SECONDS 0x0 #define RTC_SECONDS_ALARM 0x1 #define RTC_MINUTES 0x2 #define RTC_MINUTES_ALARM 0x3 #define RTC_HOURS 0x4 #define RTC_HOURS_ALARM 0x5 #define RTC_DAY_OF_WEEK 0x6 #define RTC_DAY_OF_MONTH 0x7 #define RTC_MONTH 0x8 #define RTC_YEAR 0x9 #define RTC_REG_A 0xA #define RTC_REG_B 0xB #define RTC_REG_C 0xC #define RTC_REG_D 0xD /* RTC_REG_A BITS */ #define RTC_RS0_BIT 0 #define RTC_RS1_BIT 1 #define RTC_RS2_BIT 2 #define RTC_RS3_BIT 3 #define RTC_DV0_BIT 4 #define RTC_DV1_BIT 5 #define RTC_DV2_BIT 6 #define RTC_UIP_BIT 7 /* RTC_REG_B BITS */ #define RTC_DSE_BIT 0 #define RTC_MODE_BIT 1 #define RTC_DM_BIT 2 #define RTC_SQWE_BIT 3 #define RTC_UIE_BIT 4 #define RTC_AIE_BIT 5 #define RTC_PIE_BIT 6 #define RTC_SET_BIT 7 /* RTC_REG_C BITS */ #define RTC_UF_BIT 4 #define RTC_AF_BIT 5 #define RTC_PF_BIT 6 #define RTC_IRQF_BIT 7 /* RTC_REG_D BITS */ #define RTC_VRT_BIT 7 #define RTC_IRQ 0x8 /// Represents date and time retrieved from RTC typedef struct { int Seconds; int Minutes; int Hours; int Year; int SecondsAlarm; int MinutesAlarm; int HoursAlarm; } rtc_time_t; static const char* week_day_s[] = { "Thu", "Fri", "Sat", "Sun", "Mon", "Tue", "Wed" }; ///< Week days strings static const char* month_s[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Set", "Oct", "Nov", "Dec" }; ///< Months strings unsigned long bcd_to_decimal(unsigned long bcd); ///< Converts bcd number to decimal void rtc_wait_valid(); ///< Waits for RTC to be available int rtc_read_register(unsigned long reg, unsigned long* value); ///< Reads byte from RTC from a specific register int rtc_write_register(unsigned long reg, unsigned long value); ///< Write byte to RTC to a specific register char* rtc_get_date(); ///< Returns string representation of date and time from RTC /**@}*/ #endif /* RTC_H__ */
#include "shutdown_normal.h" #include "unity.h" #include "unity_fixture.h" // TODO Finish up these tests!!! TEST_GROUP(Shutdown_Normal_Test); STATE state; HEARTBEAT_DATA heartbeat_data; TEST_SETUP(Shutdown_Normal_Test) { state.heartbeat_data = &heartbeat_data; } TEST_TEAR_DOWN(Shutdown_Normal_Test) { } TEST(Shutdown_Normal_Test, test_Shutdown_Normal_Cleanup) { state.dsm_mode = MODE_DRIVE; state.direction = DRIVE_FORWARD; state.time_started_init_tests_ms = 42; state.time_started_close_contactors_request_ms = 1337; state.time_started_PDM_tests_ms = 1729; state.time_started_module_shutdown_ms = 43770; state.time_started_velocity_zero_ms = 376006; state.time_started_open_contactors_ms = 37047734; state.critical_systems_relay_on = true; state.low_voltage_relay_on = false; } TEST(Shutdown_Normal_Test, test_Shutdown_Normal_Step) { } TEST_GROUP_RUNNER(Shutdown_Normal_Test) { RUN_TEST_CASE(Shutdown_Normal_Test, test_Shutdown_Normal_Cleanup); RUN_TEST_CASE(Shutdown_Normal_Test, test_Shutdown_Normal_Step); }
#ifndef FONTXMLLOADER_H #define FONTXMLLOADER_H #include "nau/geometry/font.h" using namespace nau::geometry; namespace nau { namespace loader { class FontXMLLoader { public: static void loadFont (Font *aFont, std::string &aFilename); private: FontXMLLoader(void) {}; ~FontXMLLoader(void) {}; }; }; }; #endif //FONTXMLLOADER_H
#include <signal.h> #include <ncurses.h> volatile sig_atomic_t doresize; void resize(int sig) { doresize = 1; (void)sig; } int main(void) { int ch; initscr(); raw(); // when a resize event happens, the terminal will send a signal that we can handle signal(SIGWINCH, resize); for (;;) { ch = getch(); if (ch == 27) break; // on resize, need to reinit everything if (doresize) { endwin(); initscr(); clear(); refresh(); } clear(); mvprintw(LINES / 2, COLS / 2, "key %x %dx%d\n", ch, LINES, COLS); refresh(); } endwin(); return 0; }
#pragma once /* ...And this is string processing in a pre-processor. Look away now. */ #define STR_UNREDIR(s) #s #define STR_REDIR(s) STR_UNREDIR(s) #define C_COMPILER_DEFINE_STRING(name, maj, min, lev) \ name " " STR_REDIR(maj) "." STR_REDIR(min) "." STR_REDIR(lev) #undef C_SYSTEM_BITNESS #define C_SYSTEM_BITNESS 0 /* Pre-processors are stupid. Very stupid. They would suffocate with a glass of * water in their hand. */ #undef C_COMPILER_NAME #undef C_COMPILER_VER_MAJ #undef C_COMPILER_VER_MIN #undef C_COMPILER_VER_REV #define C_COMPILER_NAME "Unknown" #define C_COMPILER_VER_MAJ 0 #define C_COMPILER_VER_MIN 0 #define C_COMPILER_VER_REV 0 /* GCC compiler identification */ #if defined(__GNUC__) #undef C_SYSTEM_BITNESS #if __x86_64__ || __ppc64__ || __aarch64__ #define C_SYSTEM_BITNESS 64 #else #define C_SYSTEM_BITNESS 32 #endif #define COFFEE_GCC #undef C_COMPILER_NAME #undef C_COMPILER_VER_MAJ #undef C_COMPILER_VER_MIN #undef C_COMPILER_VER_REV #define C_COMPILER_NAME "GCC/G++" #define C_COMPILER_VER_MAJ __GNUC__ #define C_COMPILER_VER_MIN __GNUC_MINOR__ #define C_COMPILER_VER_REV __GNUC_PATCHLEVEL__ #endif /* Clang can identify as an apache attack helicopter at times. */ #if defined(__clang__) #undef COFFEE_GCC #define COFFEE_CLANG #undef C_COMPILER_NAME #undef C_COMPILER_VER_MAJ #undef C_COMPILER_VER_MIN #undef C_COMPILER_VER_REV #if defined(__APPLE_CC__) // Apple Clang is a variation of Clang #define C_COMPILER_NAME "Apple Clang" #else #define C_COMPILER_NAME "Clang" #endif #define C_COMPILER_VER_MAJ __clang_major__ #define C_COMPILER_VER_MIN __clang_minor__ #define C_COMPILER_VER_REV __clang_patchlevel__ #endif #if defined(_WIN32) || defined(_WIN64) #undef C_SYSTEM_BITNESS #define C_SYSTEM_BITNESS 32 #if defined(_WIN64) #undef C_SYSTEM_BITNESS #define C_SYSTEM_BITNESS 64 #endif #endif /* This wasn't so hard, really. */ #if defined(_MSC_VER) #define COFFEE_MSVCXX #define C_COMPILER_STRING "MSVC++" _MSC_VER #undef C_COMPILER_NAME #undef C_COMPILER_VER_MAJ #undef C_COMPILER_VER_MIN #undef C_COMPILER_VER_REV #define C_COMPILER_NAME "MSVC++" #define C_COMPILER_VER_MAJ _MSC_FULL_VER #define C_COMPILER_VER_MIN 0 #define C_COMPILER_VER_REV 0 #endif #define C_STR_HELPER(x) #x #define C_STR(x) C_STR_HELPER(x)
#ifndef __MINUTE_IOBUF_H__ #define __MINUTE_IOBUF_H__ /** \brief A simple input/output ring buffer. The iobuf represents an i/o ring buffer, with absolute read and write offsets. Both read and write increase, and only the access is wrapped, thus either may well be larger than the size of the buffer, but they may never be further than the buffer size apart. If read and write are equal, the buffer is empty. The buffer is full if read is less than write, but both map to the same data index. \note The size of the buffer must be a power of two, as all accesses are masked with the mask value to properly wrap the index. */ typedef struct iobuf { unsigned read; unsigned write; unsigned mask; unsigned flags; char *data; } iobuf; #define IOBUF_EOF 0x01 #define minute_iobuf_used(io) (((io).write-(io).read)) #define minute_iobuf_free(io) ((io).mask+1-(minute_iobuf_used(io))) /** \brief Constructor function for initializing an iobuf buffer */ iobuf minute_iobuf_init (unsigned size, char *data); /** \brief Clear I/O buffer */ void minute_iobuf_clear (iobuf *io); /** \brief Append a character to the end of the buffer. \param c the character to append. \param io the io buffer. \returns the number of characters written, 1 if succesful, 0 if the buffer is full. */ int minute_iobuf_put (char c, iobuf *io); /** \brief Replace a character in the buffer. The offset is a positive number from the start of the buffer, 0 being the first character (i.e. at the read index), or a negative number from the end of the buffer, with -1 being the last character in the buffer. \param offset the offset to replace. \param c the character set. \param io the io buffer. \returns the number of characters written, 1 if succesful. */ int minute_iobuf_replace (int offset, char c, iobuf *io); /** \brief Write nelem number of bytes to the IO buffer. \param data the data buffer to be read from. \param nelem the number of bytes to write \param io the io buffer to write to. \returns the number of bytes actually written, or -1 if an error occurs, i.e. the data did not fit in the buffer. */ int minute_iobuf_write (const char *data, unsigned nelem, iobuf *io); /**\brief Write zero-terminated string to the IO buffer. \param data the data buffer to be read from. \param io the io buffer to write to. \returns the number of bytes actually written, or -1 if an error occurs, i.e. the data did not fit in the buffer. */ int minute_iobuf_writesz (const char *text, iobuf *io); /** \brief Read at most nelem number of bytes to the IO buffer. \param data the data buffer to be written to. \param nelem the space available in the data buffer. \param io the io buffer to read from. \returns the number of bytes actually written to the data buffer, 0 if there's currently no more data in the buffer or if nelem is 0. */ int minute_iobuf_read (char *data, unsigned nelem, iobuf *io); #endif /* idempotent include guard */
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "../../src/QDynamicDataExchange.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private Q_SLOTS: void onProtocolActivate(const QUrl& url); private: Ui::MainWindow *ui; win32::QUrlProtocolHandler urlProtocolHandler; }; #endif // MAINWINDOW_H
// // AFHTTPClientEncodingType.h // MTFoundation-OSX // // Created by Matias Piipari on 21/05/2015. // Copyright (c) 2015 Mekentosj BV. All rights reserved. // #ifndef MTFoundation_OSX_AFHTTPClientEncodingType_h #define MTFoundation_OSX_AFHTTPClientEncodingType_h typedef NS_ENUM(NSInteger, AFHTTPClientParameterEncoding) { AFFormURLParameterEncoding, AFJSONParameterEncoding, AFPropertyListParameterEncoding, }; #endif
/* * Copyright (c) 2007 - 2021 Joseph Gaeddert * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // // Generic dot product // #include <stdlib.h> #include <string.h> #include <stdio.h> // portable structured dot product object struct DOTPROD(_s) { TC * h; // coefficients array unsigned int n; // length }; // basic dot product // _h : coefficients array [size: 1 x _n] // _x : input array [size: 1 x _n] // _n : input lengths // _y : output dot product int DOTPROD(_run)(TC * _h, TI * _x, unsigned int _n, TO * _y) { // initialize accumulator TO r=0; unsigned int i; for (i=0; i<_n; i++) r += _h[i] * _x[i]; // return result *_y = r; return LIQUID_OK; } // basic dotproduct, unrolling loop // _h : coefficients array [size: 1 x _n] // _x : input array [size: 1 x _n] // _n : input lengths // _y : output dot product int DOTPROD(_run4)(TC * _h, TI * _x, unsigned int _n, TO * _y) { // initialize accumulator TO r=0; // t = 4*(floor(_n/4)) unsigned int t=(_n>>2)<<2; // compute dotprod in groups of 4 unsigned int i; for (i=0; i<t; i+=4) { r += _h[i] * _x[i]; r += _h[i+1] * _x[i+1]; r += _h[i+2] * _x[i+2]; r += _h[i+3] * _x[i+3]; } // clean up remaining for ( ; i<_n; i++) r += _h[i] * _x[i]; // return result *_y = r; return LIQUID_OK; } // // structured dot product // // create vector dot product object // _h : coefficients array [size: 1 x _n] // _n : dot product length DOTPROD() DOTPROD(_create)(TC * _h, unsigned int _n) { DOTPROD() q = (DOTPROD()) malloc(sizeof(struct DOTPROD(_s))); q->n = _n; // allocate memory for coefficients q->h = (TC*) malloc((q->n)*sizeof(TC)); // move coefficients memmove(q->h, _h, (q->n)*sizeof(TC)); // return object return q; } // create vector dot product object with time-reversed coefficients // _h : coefficients array [size: 1 x _n] // _n : dot product length DOTPROD() DOTPROD(_create_rev)(TC * _h, unsigned int _n) { DOTPROD() q = (DOTPROD()) malloc(sizeof(struct DOTPROD(_s))); q->n = _n; // allocate memory for coefficients q->h = (TC*) malloc((q->n)*sizeof(TC)); // copy coefficients in time-reversed order unsigned int i; for (i=0; i<_n; i++) q->h[i] = _h[_n-i-1]; // return object return q; } // re-create dot product object // _q : old dot dot product object // _h : new coefficients [size: 1 x _n] // _n : new dot product size DOTPROD() DOTPROD(_recreate)(DOTPROD() _q, TC * _h, unsigned int _n) { // check to see if length has changed if (_q->n != _n) { // set new length _q->n = _n; // re-allocate memory _q->h = (TC*) realloc(_q->h, (_q->n)*sizeof(TC)); } // move new coefficients memmove(_q->h, _h, (_q->n)*sizeof(TC)); // return re-structured object return _q; } // re-create dot product object with coefficients in reverse order // _q : old dot dot product object // _h : time-reversed new coefficients [size: 1 x _n] // _n : new dot product size DOTPROD() DOTPROD(_recreate_rev)(DOTPROD() _q, TC * _h, unsigned int _n) { // check to see if length has changed if (_q->n != _n) { // set new length _q->n = _n; // re-allocate memory _q->h = (TC*) realloc(_q->h, (_q->n)*sizeof(TC)); } // copy coefficients in time-reversed order unsigned int i; for (i=0; i<_n; i++) _q->h[i] = _h[_n-i-1]; // return re-structured object return _q; } // destroy dot product object int DOTPROD(_destroy)(DOTPROD() _q) { free(_q->h); // free coefficients memory free(_q); // free main object memory return LIQUID_OK; } // print dot product object int DOTPROD(_print)(DOTPROD() _q) { printf("dotprod [portable, %u coefficients]:\n", _q->n); unsigned int i; for (i=0; i<_q->n; i++) { #if TC_COMPLEX==0 printf(" %4u: %12.8f\n", i, _q->h[i]); #else printf(" %4u: %12.8f + j*%12.8f\n", i, crealf(_q->h[i]), cimagf(_q->h[i])); #endif } return LIQUID_OK; } // execute structured dot product // _q : dot product object // _x : input array [size: 1 x _n] // _y : output dot product int DOTPROD(_execute)(DOTPROD() _q, TI * _x, TO * _y) { // run basic dot product with unrolled loops DOTPROD(_run4)(_q->h, _x, _q->n, _y); return LIQUID_OK; }
#import <Foundation/Foundation.h> #import "FIRDynamicLink.h" NS_ASSUME_NONNULL_BEGIN /** * @file FIRDynamicLinks.h * @abstract Firebase Dynamic Links */ /** * @abstract The definition of the block used by |resolveShortLink:completion:| */ typedef void (^FIRDynamicLinkResolverHandler)(NSURL * _Nullable url, NSError * _Nullable error); /** * @abstract The definition of the block used by |handleUniversalLink:completion:| */ typedef void (^FIRDynamicLinkUniversalLinkHandler)(FIRDynamicLink * _Nullable dynamicLink, NSError * _Nullable error); /** * @class FIRDynamicLinks * @abstract A class that checks for pending Dynamic Links and parses URLs. */ @interface FIRDynamicLinks : NSObject /** * @method sharedInstance * @abstract Shared instance of FIRDynamicLinks. Returns nil on iOS versions prior to 8. * @return Shared instance of FIRDynamicLinks. */ + (nullable instancetype)dynamicLinks NS_SWIFT_NAME(dynamicLinks()); /** * @method shouldHandleDynamicLinkFromCustomSchemeURL: * @abstract Determine whether FIRDynamicLinks should handle the given URL. This does not * guarantee that |dynamicLinkFromCustomSchemeURL:| will return a non-nil value, but it means * the client should not attempt to handle the url. * @param url custom scheme url. * @return whether it can be handled by GINDurableDeepLinkService. */ - (BOOL)shouldHandleDynamicLinkFromCustomSchemeURL:(NSURL *)url; /** * @method dynamicLinkFromCustomSchemeURL: * @abstract Get a Dynamic Link from a custom scheme URL. This method could parse URLs with custom * scheme, for instance, "comgoogleapp://google/link?deep_link_id=abc123". It is suggested to * call it inside your |UIApplicationDelegate|'s * |application:openURL:sourceApplication:annotation| and|application:openURL:options:|. * @param url custom scheme url. * @return Dynamic Link object if url is valid and has link parameter, or nil. */ - (nullable FIRDynamicLink *)dynamicLinkFromCustomSchemeURL:(NSURL *)url; /** * @method dynamicLinkFromUniversalLinkURL: * @abstract Get a Dynamic Link from a universal link URL. This method could parse universal link * URLs, for instance, * "https://example.app.goo.gl?link=https://www.google.com&ibi=com.google.app&ius=comgoogleapp". * It is suggested to call it inside your |UIApplicationDelegate|'s * |application:continueUserActivity:restorationHandler:|. * @param url Custom scheme url. * @return Dynamic Link object if url is valid and has link parameter, or nil. */ - (nullable FIRDynamicLink *)dynamicLinkFromUniversalLinkURL:(NSURL *)url; /** * @method handleUniversalLink:completion: * @abstract Convenience method to handle a Universal Link whether it is long or short. A long link * will call the handler immediately, but a short link may not. * @param universalLinkURL A Universal Link URL. * @param completion A block that handles the outcome of attempting to create a FIRDynamicLink. * @return YES if the SDK is handling the link, otherwise, NO. */ - (BOOL)handleUniversalLink:(NSURL *)url completion:(FIRDynamicLinkUniversalLinkHandler)completion; /** * @method resolveShortLink:completion:linkResolver: * @abstract Retrieves the details of the Dynamic Link that the shortened URL represents * @param url A Short Dynamic Link. * @param completion Block to be run upon completion. */ - (void)resolveShortLink:(NSURL *)url completion:(FIRDynamicLinkResolverHandler)completion; /** * @method matchesShortLinkFormat: * @abstract Determines if a given URL matches the given short Dynamic Link format. * @param url A URL. * @return YES if the URL is a short Dynamic Link, otherwise, NO. */ - (BOOL)matchesShortLinkFormat:(NSURL *)url; @end NS_ASSUME_NONNULL_END
#include <stdio.h> main () { int num1, num2, num3; char ch2; num1 = 5; num3 = 4; printf("Please enter 1 number and 1 character: \n"); scanf("%d", &num2); flushall(); scanf("%c", &ch2); flushall(); printf("\nYou entered %d and %c\n", num2, ch2); printf("The other numbers are %d, %d", num1, num3); getchar(); }
#ifndef LOGGER_H_ # define LOGGER_H_ # include <syslog.h> # include <stdarg.h> # define MONIKOR_LOG_SEP ": " # define MONIKOR_LOG_MIN_PRIO LOG_EMERG # define MONIKOR_LOG_MAX_PRIO LOG_DEBUG # define MONIKOR_LOG_DEFAULT -1 # define LOG_ERROR LOG_ERR extern int monikor_log_level; int monikor_logger_level(void); void monikor_logger_init(int prio, const char *file); void monikor_logger_cleanup(void); int monikor_vlog(int prio, const char *message, va_list ap); int monikor_log(int prio, const char *message, ...); int monikor_vlog_mod(int prio, const char *mod_name, const char *message, va_list ap); int monikor_log_mod(int prio, const char *mod_name, const char *message, ...); #endif /* end of include guard: LOGGER_H_ */
/* * Copyright 2003,2006,2009 Red Hat, Inc. * * 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, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 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. * * ALTERNATIVELY, this product may be distributed under the terms of the * GNU Lesser General Public License, in which case the provisions of the * LGPL are required INSTEAD OF the above restrictions. * * THIS SOFTWARE IS PROVIDED ``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. */ #ifndef pam_krb5_prompter_h #define pam_krb5_prompter_h struct _pam_krb5_prompter_data { krb5_context ctx; pam_handle_t *pamh; const char *previous_password; struct _pam_krb5_user_info *userinfo; struct _pam_krb5_options *options; }; /* Ask the user. */ krb5_error_code _pam_krb5_always_prompter(krb5_context context, void *data, const char *name, const char *banner, int num_prompts, krb5_prompt prompts[]); /* Ask the user, except for the password. */ krb5_error_code _pam_krb5_normal_prompter(krb5_context context, void *data, const char *name, const char *banner, int num_prompts, krb5_prompt prompts[]); /* Always pretend we couldn't get anything. */ krb5_error_code _pam_krb5_always_fail_prompter(krb5_context context, void *data, const char *name, const char *banner, int num_prompts, krb5_prompt prompts[]); /* Always return the previous_password stored in the data item, which is a * _pam_krb5_prompter_data structure. */ krb5_error_code _pam_krb5_previous_prompter(krb5_context context, void *data, const char *name, const char *banner, int num_prompts, krb5_prompt prompts[]); /* Wrap calls to the PAM conversation function. */ int _pam_krb5_prompt_for(pam_handle_t *pamh, const char *prompt, char **response); int _pam_krb5_prompt_for_2(pam_handle_t *pamh, const char *prompt, char **response, const char *prompt2, char **response2); void _pam_krb5_maybe_free_responses(struct pam_response *responses, int n_responses); #endif
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "adminlogindlg.h" #include "qwertykb.h" #include "postableview.h" #include "posmaintablemodel.h" #include "maintabledelegate.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); QwertyKb *kb; bool isadminable; private slots: void on_transferOwnershipBut_pressed(); void on_outgoingTransfersBut_pressed(); void on_incomingTransfersBut_pressed(); void on_finalSaleBut_pressed(); void on_returnedItemsBut_pressed(); void on_forensicsBut_pressed(); void on_activateItemsBut_pressed(); void on_adminBut_pressed(); private: Ui::MainWindow *ui; AdminLoginDlg *adminLogin; QAbstractTableModel *model; }; #endif // MAINWINDOW_H
/* * ofShape.h * openFrameworks * * Created by theo on 28/10/2009. * Copyright 2009 __MyCompanyName__. All rights reserved. * */ #pragma once #include "ofMain.h" #define DRAW_WITH_MESHIES #ifdef DRAW_WITH_MESHIES /// hack until ofMesh is available typedef struct _meshy { GLint mode; vector<ofPoint>vertices; } meshy; #else #include "ofMesh.h" #endif /** ofPolyline A line composed of straight line segments. */ class ofPolyline { public: /// remove all the points void clear() { points.clear(); } /// add a vertex void addVertex( const ofPoint& p ) { points.push_back(p); } void addVertexes( const vector<ofPoint>& verts ) { points.insert( points.end(), verts.begin(), verts.end() ); } /// draw as line segments, with the current line style void draw() const; /// points vector access size_t size() const { return points.size(); } const ofPoint& operator[] (int index) const { return points[index]; } /// closed void setClosed( bool tf ) { bClosed = tf; } bool getClosed() const { return bClosed; } private: vector<ofPoint> points; bool bClosed; }; #include "ofTessellator.h" /** ofShape Represents a 'shape'. */ class ofShape{ public: ofShape(); void setCurveResolution(int numPoints); void clear(); /// Add a vertex. Can be used to create straight lines or to specify start points for Bezier or /// Catmull-Rom curves. void addVertex(ofPoint p1); void addVertex( float x, float y, float z=0 ) { addVertex( ofPoint( x,y,z ) ); } /// Add a Bezier vertex by specifying ( control point out from previous point, control point in to /// next point, next point ). void addBezierVertex(ofPoint cp1, ofPoint cp2, ofPoint p); void addBezierVertex( float cp1x, float cp1y, float cp2x, float cp2y, float px, float py ) { addBezierVertex( ofPoint(cp1x,cp1y), ofPoint(cp2x,cp2y), ofPoint(px,py) ); } void addBezierVertex( float cp1x, float cp1y, float cp1z, float cp2x, float cp2y, float cp2z, float px, float py, float pz ) { addBezierVertex( ofPoint(cp1x,cp1y,cp1z), ofPoint(cp2x,cp2y,cp2z), ofPoint(px,py,pz) ); } /// Add a Catmull-Rom curve vertex. You must add a minimum of vertices to make a Catmull-Rom spline, /// and the first and last points will be used only as control points. void addCurveVertex(ofPoint p); void addCurveVertex( float x, float y, float z=0 ) { addCurveVertex( ofPoint( x,y,z ) ); } /// close the shape void close(); /// next contour void nextContour( bool bClosePrev=true ); /// must call tessellate before calling draw, if the shape has changed void tessellate(); void draw(); /// drawing style /// polygon winding mode for tessellation void setPolyWindingMode( int newMode ); /// filled/outline void setFilled( bool bFill ) { bFilled = bFill; bNeedsTessellation = true; } /// set line + fill color simultaneously void setColor( const ofColor& color ) { setFillColor( color ); setLineColor( color ); } void setHexColor( int hex ) { setColor( ofColor().fromHex( hex ) ); }; /// set line color void setLineColor( const ofColor& color ) { lineColor = color; } void setLineHexColor( int hex ) { setLineColor( ofColor().fromHex( hex ) ); }; /// set fill color void setFillColor( const ofColor& color ) { fillColor = color; } void setFillHexColor( int hex ) { setFillColor( ofColor().fromHex( hex ) ); }; private: typedef enum { OFSHAPE_SEG_LINE, OFSHAPE_SEG_BEZIER, OFSHAPE_SEG_CURVE } segmentType; class ofShapeSegment { public: ofShapeSegment( segmentType _type ){ type = _type; } /// up to you to call the correct function void addSegmentVertex(const ofPoint& p) { points.push_back(p) ; } void addSegmentCurveVertex(const ofPoint& p) { type = OFSHAPE_SEG_CURVE; points.push_back(p); } void addSegmentBezierVertex(const ofPoint& c1, const ofPoint& c2, const ofPoint& p) { type = OFSHAPE_SEG_BEZIER; points.push_back( c1 ); points.push_back( c2 ); points.push_back( p ); } int getType() const { return type; } const vector<ofPoint>& getPoints() const { return points; } const ofPoint& getPoint( int index ) const { return points[index]; } size_t getNumPoints() const { return points.size(); } private: segmentType type; vector<ofPoint> points; }; void curveSegmentToPolyline(const ofShapeSegment & seg, ofPolyline& polyline); void bezierSegmentToPolyline(const ofShapeSegment & seg, ofPolyline& polyline); ofColor lineColor; bool bFilled; ofColor fillColor; // true if this shape should be closed int resolution; vector<vector<ofShapeSegment> > segmentVectors; vector<bool> bShouldClose; int polyWindingMode; bool bNeedsTessellation; vector<ofPolyline> cachedPolylines; // resulting mesh and outline bool bNeedsOutlineDraw; ofPolyline cachedOutline; #ifdef DRAW_WITH_MESHIES vector<meshy> cachedMeshies; #else ofMesh cachedTessellation; #endif }; /** ofShapeCollection An ofShapeCollection holds one or more shapes. It knows its own position. @author Damian */ /* class ofShapeCollection { public: /// add shapes to this collection void addShape( const ofShape& shape, ofPoint relativePosition = ofPoint( 0,0,0 ) ); void addShape( const ofShapeCollection& collection, ofPoint relativePosition = ofPoint( 0,0,0 ) ); /// set the position (relative to parent) of this shape collection void setPosition( ofPoint position ); void draw(); private: vector<ofShapeCollection> children; ofPoint position; }; */
#pragma once namespace LiteCppDB_Tests { class ShrinkDatabaseTest { public: }; }
#pragma once class CScene; class CSceneMgr { private: CSceneMgr(); virtual ~CSceneMgr(); public: DECLARE_SINGLETON(CSceneMgr) private: CScene* m_pScene; map<Scene_Tyep, CScene*> m_mapScene; public: Scene_Tyep m_eType; public: HRESULT AddScene(Scene_Tyep _eType, CScene* _pScene); HRESULT ChangeScene(Scene_Tyep _eType); int Update(void); void Render(void); CScene* GetScene(void); void Release(void); };
#ifndef _VALUE_H_ #define _VALUE_H_ #include "supoo.h" typedef enum atom_type atom_type; typedef struct value value; enum atom_type { AT_INT, AT_FLOAT, AT_SYMBOL, AT_STRING, AT_LIST, AT_FUNCPTR, AT_BOOL, AT_UNKNOWN }; struct value { atom_type type; int size; union { bool b; int i; double f; char* s; value** a; void* fp; }; char flag; }; #define AF_NONE 0x0 #define AF_QUOTE 0x1 value* value_new(void); value* int_new(int val); value int_value(int val); value* float_new(double val); value float_value(double val); value* sym_new(char* const val); value sym_value(char* const val); value* str_new(char* const val); value str_value(char* const val); value* fp_new(void* val); value fp_value(void* val); value* bool_new_true(void); value bool_true(void); value* bool_new_false(void); value bool_false(void); bool is_true(value* val); value* bool_not(value* val); value* value_copy(value* val); #endif
/* * data.h * pragma * * Created by Victor on 26/12/10. * Copyright 2010 #Pragma Studios. All rights reserved. * */ #include <pragma/types.h> #include <vector> namespace pragma { bool PropertyList_UnitTest(); class Value { public: enum Type { eString = 0, eFloat = 1, }; Value () : mIsOk(false), mType(eString), mIsArray(false), mCount(0), mData(0) { } Value (const Value& aValue); ~Value () { Clear(); } bool IsOk () const { return mIsOk; } void Clear (); void SetAsArray (bool aIsArray); void Set (const char* aValue); bool Get (const char*& aString) const; void Set (float aValue); bool Get (float& aFloat) const; void SetAt (int aPosition, const char* aValue); bool GetAt (int aPosition, const char*& aValue) const; void SetAt (int aPosition, float aValue); bool GetAt (int aPosition, float& aValue) const; bool IsArray () const { return mIsArray; } unsigned GetCount () const { return mCount; } Type GetType () const { return mType; } private: void ClearAt (void** aPtr); void SetAt (void** aPtr, const char* aValue); bool GetAt (void** aPtr, const char*& aString) const; void SetAt (void** aPtr, float aValue); bool GetAt (void** aPtr, float& aFloat) const; bool mIsOk; Type mType; unsigned mCount; bool mIsArray; void* mData; }; class PropertyList { public: void Set(const string& aKey, const Value& aValue); Value Get(const string& aKey, const Value& aDefault); void SetString(const string& aKey, const string& aString); void SetFloat(const string& aKey, const float aFloat); string GetString(const string& aKey, const string& aDefault = string()); float GetFloat(const string& aKey, float aDefault = 0); void Log(); private: std::vector< std::pair<string, Value> > mList; }; }
// // MOBMail.h // MOBUtils // // Created by Alex Ruperez on 10/09/14. // Copyright (c) 2014 Mobusi. All rights reserved. // #import <Foundation/Foundation.h> #import <MessageUI/MFMailComposeViewController.h> @class MOBMail; @protocol MOBMailDelegate <NSObject> @optional - (void)mobMailDidSend:(MOBMail *)mail; - (void)mobMailDidSaveDraft:(MOBMail *)mail; - (void)mobMailDidCancel:(MOBMail *)mail; - (void)mobMail:(MOBMail *)mail didFailWithError:(NSError *)error; @end @interface MOBMail : MFMailComposeViewController @property (weak, nonatomic) id<MOBMailDelegate> delegate; @property (retain, nonatomic) NSString *body; @property (assign, nonatomic) BOOL isHTML; - (instancetype)initWithSubject:(NSString *)subject body:(NSString *)body recipient:(NSString *)recipient; - (void)addToRecipient:(NSString *)recipient; - (void)addCcRecipient:(NSString *)recipient; - (void)addBccRecipient:(NSString *)recipient; - (void)addImage:(UIImage *)image filename:(NSString *)filename; @end
/* ** $Id: ldebug.h,v 2.14 2015/05/22 17:45:56 roberto Exp $ ** Auxiliary functions from Debug Interface module ** See Copyright Notice in lua.h */ #ifndef ldebug_h #define ldebug_h #include "lstate.h" #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) #define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : -1) #define resethookcount(L) (L->hookcount = L->basehookcount) LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *opname); LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1, const TValue *p2); LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1, const TValue *p2, const char *msg); LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1, const TValue *p2); LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2); LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...); LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg, TString *src, int line); LUAI_FUNC l_noret luaG_errormsg (lua_State *L); LUAI_FUNC void luaG_traceexec (lua_State *L); #endif
// // SnapViewController.h // DynamicsSample // // Created by Shingo Sato on 2013/08/03. // Copyright (C) 2013 Yahoo Japan Corporation. All Rights Reserved. // // Copyrights licensed under the MIT License. // See the accompanying LICENSE file for terms. // #import <UIKit/UIKit.h> @interface SnapViewController : UIViewController @property (weak, nonatomic) IBOutlet UIView *square; @end
// Copyright (C) 2002-2011 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #ifndef __I_WRITE_FILE_H_INCLUDED__ #define __I_WRITE_FILE_H_INCLUDED__ #include "IReferenceCounted.h" #include "path.h" namespace irr { namespace io { //! Interface providing write access to a file. class IWriteFile : public virtual IReferenceCounted { public: //! Writes an amount of bytes to the file. /** \param buffer Pointer to buffer of bytes to write. \param sizeToWrite Amount of bytes to write to the file. \return How much bytes were written. */ virtual s32 write(const void* buffer, u32 sizeToWrite) = 0; //! Changes position in file /** \param finalPos Destination position in the file. \param relativeMovement If set to true, the position in the file is changed relative to current position. Otherwise the position is changed from begin of file. \return True if successful, otherwise false. */ virtual bool seek(long finalPos, bool relativeMovement = false) = 0; //! Get the current position in the file. /** \return Current position in the file in bytes. */ virtual long getPos() const = 0; //! Get name of file. /** \return File name as zero terminated character string. */ virtual const path& getFileName() const = 0; }; //! Internal function, please do not use. IWriteFile* createWriteFile(const io::path& fileName, bool append); } // end namespace io } // end namespace irr #endif
#include <stdio.h> #include <math.h> int find_sum(int n){ int j = 2, sum = 0; int root = sqrt(n); while(j < root){ if(n % j == 0){ sum += j; sum += n/j; printf("%d * %d\n", j, n/j); } j ++; } if(n % root == 0){ sum += root; } sum ++; return sum; } int main(){ int i, sum = 0, temp; for(i = 3; i <= 10000; i++){ temp = find_sum(i); if(temp > i && find_sum(temp) == i){ printf("%d %d\n", temp, i); sum += (temp + i); } } // sum = find_sum(28122); printf("%d\n", sum); return 0; }
\#include "${out_file}.hpp" #if $macro_judgement $macro_judgement #end if #for header in $headers #set relative = os.path.relpath(header, $search_path) #if not '..' in relative \#include "${relative.replace(os.path.sep, '/')}" #else \#include "${os.path.basename(header)}" #end if #end for \#include "scripting/lua-bindings/manual/tolua_fix.h" \#include "scripting/lua-bindings/manual/LuaBasicConversions.h" #if $cpp_headers #for header in $cpp_headers \#include "${header}" #end for #end if
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UNDO_H #define BITCOIN_UNDO_H #include <coins.h> #include <compressor.h> #include <consensus/consensus.h> #include <primitives/transaction.h> #include <serialize.h> /** Undo information for a CTxIn * * Contains the prevout's CTxOut being spent, and its metadata as well * (coinbase or not, height). The serialization contains a dummy value of * zero. This is compatible with older versions which expect to see * the transaction version there. */ class TxInUndoSerializer { const Coin* txout; public: template<typename Stream> void Serialize(Stream &s) const { ::Serialize(s, VARINT(txout->nHeight * 2 + (txout->fCoinBase ? 1u : 0u))); if (txout->nHeight > 0) { // Required to maintain compatibility with older undo format. ::Serialize(s, (unsigned char)0); } ::Serialize(s, CTxOutCompressor(REF(txout->out))); } explicit TxInUndoSerializer(const Coin* coin) : txout(coin) {} }; class TxInUndoDeserializer { Coin* txout; public: template<typename Stream> void Unserialize(Stream &s) { unsigned int nCode = 0; ::Unserialize(s, VARINT(nCode)); txout->nHeight = nCode / 2; txout->fCoinBase = nCode & 1; if (txout->nHeight > 0) { // Old versions stored the version number for the last spend of // a transaction's outputs. Non-final spends were indicated with // height = 0. unsigned int nVersionDummy; ::Unserialize(s, VARINT(nVersionDummy)); } ::Unserialize(s, CTxOutCompressor(REF(txout->out))); } explicit TxInUndoDeserializer(Coin* coin) : txout(coin) {} }; static const size_t MIN_TRANSACTION_INPUT_WEIGHT = WITNESS_SCALE_FACTOR * ::GetSerializeSize(CTxIn(), SER_NETWORK, PROTOCOL_VERSION); static const size_t MAX_INPUTS_PER_BLOCK = MAX_BLOCK_WEIGHT / MIN_TRANSACTION_INPUT_WEIGHT; /** Undo information for a CTransaction */ class CTxUndo { public: // undo information for all txins std::vector<Coin> vprevout; template <typename Stream> void Serialize(Stream& s) const { // TODO: avoid reimplementing vector serializer uint64_t count = vprevout.size(); ::Serialize(s, COMPACTSIZE(REF(count))); for (const auto& prevout : vprevout) { ::Serialize(s, TxInUndoSerializer(&prevout)); } } template <typename Stream> void Unserialize(Stream& s) { // TODO: avoid reimplementing vector deserializer uint64_t count = 0; ::Unserialize(s, COMPACTSIZE(count)); if (count > MAX_INPUTS_PER_BLOCK) { throw std::ios_base::failure("Too many input undo records"); } vprevout.resize(count); for (auto& prevout : vprevout) { ::Unserialize(s, TxInUndoDeserializer(&prevout)); } } }; /** Undo information for a CBlock */ class CBlockUndo { public: std::vector<CTxUndo> vtxundo; // for all but the coinbase ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action) { READWRITE(vtxundo); } }; #endif // BITCOIN_UNDO_H
/* * Copyright (c) 2016-2017 Bálint Kiss <balint.kiss.501@gmail.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #ifndef _BDGL_MACROS_H_ #define _BDGL_MACROS_H_ /** * Helper macro to get the number of elements in an array. * * BE CAREFUL! It doesn't work with pointers, and arrays passed as function * parameters are decayed as such. * * @param array array with a constant size * @return number of elements in array */ #define BDGL_ARRAY_LENGTH(array) (sizeof((array)) / sizeof((array)[0])) #define BDGL_MATH_SIGN(number) ((0 < number) - (number < 0)) /* TODO */ #define BDGL_EXPECTS(predicate, message) \ do \ { \ if (predicate) \ { \ fprintf(stderr, "%s\n", message); \ } \ } while(0) \ /* TODO */ #define BDGL_ENSURES(predicate, message) #endif /* _BDGL_MACROS_H_ */
#ifndef IDS_H #define IDS_H enum RESOURCE_ID { BK_INTRO = 0, BK_OPENOMF, BK_MENU, BK_END, BK_END1, BK_END2, BK_CREDITS, BK_MECHLAB, BK_VS, BK_MELEE, BK_NEWSROOM, BK_ARENA0, BK_ARENA1, BK_ARENA2, BK_ARENA3, BK_ARENA4, BK_NORTHAM, BK_KATUSHAI, BK_WAR, BK_WORLD, AF_JAGUAR, AF_SHADOW, AF_THORN, AF_PYROS, AF_ELECTRA, AF_KATANA, AF_SHREDDER, AF_FLAIL, AF_GARGOYLE, AF_CHRONOS, AF_NOVA, PSM_END, PSM_MENU, PSM_ARENA0, PSM_ARENA1, PSM_ARENA2, PSM_ARENA3, PSM_ARENA4, DAT_SOUNDS, DAT_ENGLISH, DAT_GRAPHCHR, DAT_CHARSMAL, DAT_ALTPALS, PIC_NORTHAM, PIC_KATUSHAI, PIC_WAR, PIC_WORLD, PIC_PLAYERS, NUMBER_OF_RESOURCES }; const char *get_resource_file(unsigned int id); const char *get_resource_name(unsigned int id); int is_arena(unsigned int id); int is_scene(unsigned int id); int is_har(unsigned int id); int is_music(unsigned int id); int is_pic(unsigned int id); #endif // IDS_H
namespace computress { enum e_stat { Strength=91, Dexterity, Intellect, Wisdom, Constitution, Comeliness, Charisma }; void listen(int listencode); }
#include "types.h" #include "stat.h" #include "user.h" int main(int argc, char **argv) { int k = test(); printf(1, "%d\n", k); // Should raise SIGSEGV exit(); }
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" #import "NSCopying-Protocol.h" @class AVAssetTrackGroupInternal, NSArray; @interface AVAssetTrackGroup : NSObject <NSCopying> { AVAssetTrackGroupInternal *_assetTrackGroup; } - (id)_assetComparisonToken; @property(readonly, nonatomic) NSArray *trackIDs; - (unsigned long long)hash; - (_Bool)isEqual:(id)arg1; - (id)copyWithZone:(struct _NSZone *)arg1; - (void)finalize; - (void)dealloc; - (id)init; - (id)initWithAsset:(id)arg1 trackIDs:(id)arg2; @end
/* * Copyright 2016 Google Inc. All Rights Reserved. * Author: gkalsi@google.com (Gurjant Kalsi) * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #pragma once #include <stdint.h> typedef struct __attribute__((packed)) { uint32_t magic; uint32_t type; } ndebug_ctrl_packet_t; #define NDEBUG_CTRL_PACKET_MAGIC (0x4354524C) #define NDEBUG_CTRL_CMD_RESET (0x01) #define NDEBUG_CTRL_CMD_DATA (0x02) #define NDEBUG_CTRL_CMD_ESTABLISHED (0x03) #define NDEBUG_USB_CLASS_USER_DEFINED (0xFF) #define NDEBUG_SUBCLASS (0x02) #define NDEBUG_PROTOCOL_LK_SYSTEM (0x01) #define NDEBUG_PROTOCOL_SERIAL_PIPE (0x02)
// Copyright (C) 2002-2012 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #ifndef __I_GUI_COMBO_BOX_H_INCLUDED__ #define __I_GUI_COMBO_BOX_H_INCLUDED__ #include "IGUIElement.h" namespace ue { namespace gui { //! Combobox widget /** \par This element can create the following events of type EGUI_EVENT_TYPE: \li EGET_COMBO_BOX_CHANGED */ class IGUIComboBox : public IGUIElement { public: //! constructor IGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) : IGUIElement(EGUIET_COMBO_BOX, environment, parent, id, rectangle) {} //! Returns amount of items in box virtual u32 getItemCount() const = 0; //! Returns string of an item. the idx may be a value from 0 to itemCount-1 virtual const wchar_t* getItem(u32 idx) const = 0; //! Returns item data of an item. the idx may be a value from 0 to itemCount-1 virtual u32 getItemData(u32 idx) const = 0; //! Returns index based on item data virtual s32 getIndexForItemData(u32 data ) const = 0; //! Adds an item and returns the index of it virtual u32 addItem(const wchar_t* text, u32 data = 0) = 0; //! Removes an item from the combo box. /** Warning. This will change the index of all following items */ virtual void removeItem(u32 idx) = 0; //! Deletes all items in the combo box virtual void clear() = 0; //! Returns id of selected item. returns -1 if no item is selected. virtual s32 getSelected() const = 0; //! Sets the selected item. Set this to -1 if no item should be selected virtual void setSelected(s32 idx) = 0; //! Sets text justification of the text area /** \param horizontal: EGUIA_UPPERLEFT for left justified (default), EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text. \param vertical: EGUIA_UPPERLEFT to align with top edge, EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */ virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0; //! Set the maximal number of rows for the selection listbox virtual void setMaxSelectionRows(u32 max) = 0; //! Get the maximimal number of rows for the selection listbox virtual u32 getMaxSelectionRows() const = 0; }; } // end namespace gui } // end namespace ue #endif
/* * $Id: RtpsUdpTransport.h 6605 2014-11-19 19:33:47Z mitza $ * * * Distributed under the OpenDDS License. * See: http://www.opendds.org/license.html */ #ifndef DCPS_RTPSUDPTRANSPORT_H #define DCPS_RTPSUDPTRANSPORT_H #include "Rtps_Udp_Export.h" #include "RtpsUdpDataLink.h" #include "RtpsUdpDataLink_rch.h" #include "dds/DCPS/transport/framework/TransportImpl.h" #include "dds/DCPS/RTPS/RtpsBaseMessageTypesC.h" #include <map> namespace OpenDDS { namespace DCPS { class RtpsUdpInst; class OpenDDS_Rtps_Udp_Export RtpsUdpTransport : public TransportImpl { public: explicit RtpsUdpTransport(const TransportInst_rch& inst); private: virtual AcceptConnectResult connect_datalink(const RemoteTransport& remote, const ConnectionAttribs& attribs, TransportClient* client); virtual AcceptConnectResult accept_datalink(const RemoteTransport& remote, const ConnectionAttribs& attribs, TransportClient* client); virtual void stop_accepting_or_connecting(TransportClient* client, const RepoId& remote_id); virtual bool configure_i(TransportInst* config); virtual void shutdown_i(); virtual bool connection_info_i(TransportLocator& info) const; ACE_INET_Addr get_connection_addr(const TransportBLOB& data, bool& requires_inline_qos) const; virtual void release_datalink(DataLink* link); void pre_detach(TransportClient* client); virtual std::string transport_type() const { return "rtps_udp"; } RtpsUdpDataLink* make_datalink(const GuidPrefix_t& local_prefix); void use_datalink(const RepoId& local_id, const RepoId& remote_id, const TransportBLOB& remote_data, bool local_reliable, bool remote_reliable, bool local_durable, bool remote_durable); RcHandle<RtpsUdpInst> config_i_; //protects access to link_ for duration of make_datalink typedef ACE_Thread_Mutex ThreadLockType; typedef ACE_Guard<ThreadLockType> GuardThreadType; ThreadLockType links_lock_; /// This protects the connections_ and the pending_connections_ /// data members. typedef ACE_SYNCH_MUTEX LockType; typedef ACE_Guard<LockType> GuardType; LockType connections_lock_; /// RTPS uses only one link per transport. /// This link can be safely reused by any clients that belong to the same /// domain participant (same GUID prefix). Use by a second participant /// is not possible because the network location returned by /// connection_info_i() can't be shared among participants. RtpsUdpDataLink_rch link_; ACE_SOCK_Dgram unicast_socket_; TransportClient* default_listener_; }; } // namespace DCPS } // namespace OpenDDS #endif /* DCPS_RTPSUDPTRANSPORT_H */
// // BBUFilesViewController.h // SofaReview // // Created by Boris Bügling on 11.05.13. // Copyright (c) 2013 Boris Bügling. All rights reserved. // #import <UIKit/UIKit.h> @class BBUGitHubTreeOwner; @interface BBUFilesViewController : UITableViewController -(id)initWithTreeOwner:(BBUGitHubTreeOwner*)treeOwner; @end
#pragma once //include grids #include "conformal.h" #include "orthogonal.h" #include "curvilinear.h" #include "refined_conformal.h" #include "refined_orthogonal.h" #include "refined_curvilinear.h" #ifdef MPI_VERSION #include "mpi_conformal.h" #include "mpi_orthogonal.h" #include "mpi_curvilinear.h" #endif //include grid generators #include "simple_orthogonal.h" #include "ribeiro.h" #include "flux.h" #include "hector.h" //include magnetic field geometries #include "solovev.h" #include "solovev_parameters.h" #include "init.h" #include "magnetic_field.h" #include "adaption.h" //include average #include "average.h"
/* Fontname: -UW-Ttyp0-Bold-R-Normal--15-140-75-75-C-80-ISO10646-1 Copyright: Copyright (C) 2012-2015 Uwe Waldmann Glyphs: 95/3075 BBX Build Mode: 0 */ const uint8_t u8g2_font_t0_15b_tr[1262] U8G2_FONT_SECTION("u8g2_font_t0_15b_tr") = "_\0\3\3\4\4\3\5\5\10\17\0\375\12\375\13\377\1\243\3R\4\325 \5\0\344\30!\7\242\207" "\30O\4\42\10E\275\30\22.\2#\22\227\204\70J\22\311EI\42\222H.J\22\11\0$\27\327" "tx\341`E\22\241\304$\301bD\26\241D$\305p\14\0%\24\247\204\70\261\322$\42\251E\204" "\222XE\22\31\325\42\0&\24\247\204XBIL\22\223\4\205\243\211d$\21\211&\2'\11S\266" "\70*\224\20\0(\13\304~X\22QH\337b\12)\15\304~\30\62YL\244\247\220D\4*\20w" "\214\70\261\220D\66:\315$\242X\4\0+\14\210\214xb\265\303A&V\3,\11Sv\70*\224" "\20\0-\7&\245\30\207\2.\6\62\207\30\6/\20\307|\270\212R\241T(\25J\205R)\0\60" "\15\247\204X\63\211\32\337$j#\0\61\12\244\205X\222CD\244\17\62\16\247\204\70\25\31M*\324" "\30<\34\2\63\20\247\204\70\25\31M\32\34\207i\64I\5\0\64\20\247\204\230\302\31-\42\222(I" "\216R\25\0\65\20\247\204\70\245R\230\26\22Ki$\21\11\0\66\16\247\204X$\241Te\211\306&" "\251\0\67\15\247\204\30\17\301\250P*\224j\3\70\20\247\204\70\25\31M\242\66\223\250\261I*\0\71" "\16\247\204\70\25\31\247\311D\252(\42\1:\7r\207\30&\3;\13\223v\70\32%\22J\10\0<" "\11\246\205\230\62\35\245:=\11V\225\30\207\362\241\0>\12\246\205\30R\35e:\2?\15\247\204\70" "\25\31M*\324\16U\3@\22\246\205X#\11%\42\251\204$!\211E$\12\21A\21\247\204xQ" "\351p\26\221\205D\25\221$\70\24B\16\247\204\30\26\31\333!\42\343v\210\0C\15\247\204X$\21" "U\317\42\21\5\0D\14\247\204\30%\25\31?IJ\0E\20\247\204\30\7\341R\250$\12I\205\303" "C\0F\16\247\204\30\7\341R\250$\12I\265\2G\16\247\204X$\21US\215&\21\211\12H\13" "\247\204\30\62n\7\32o\2I\11\246\205\30&\241~\62J\15\247\204xD\251^D\22\221\210\4K" "\23\247\204\30\62ZD$\21\205$\242\222\212H\42\243\11L\12\247\204\30R\375\70<\4M\20\247\204" "\30\62Z\305r\240H&\222\341\242\0N\21\247\204\30B\32M\42\222\210TD\22\31\243\0O\13\247" "\204\70\25\31\223T\0P\15\247\204\30\26\31\267CD\252\25\0Q\15\307t\70\25\31\337,,e" "q\0R\20\247\204\30\26\31\333!\242\244\42\222\310h\2S\17\247\204\70\25\31uJ\35Ki\222\12" "\0T\14\250\204\30\7\221(&\326o\0U\12\247\204\30\62\376MR\1V\23\247\204\30\302aD$" "\21\205D\61Il\70\225\306\0W\23\247\204\30\302-\222\211d\42\71D\224$\42\211\4\0X\22\247" "\204\30\62\232D\24\222\4\27#\242\220DF\23Y\17\250\204\30B\211,$\12J\202c\275\1Z\17" "\247\204\30\207\340L\70T\34\312\206\207\0[\11\305}\30\67\375[\1\134\20\307|\30R\261T,\25" "K\305R\261T\0]\11\305}\30\65\375\333\1^\12W\264x\321\231Dm\32_\7&}\30\207\2" "`\11S\266\30\22%Q\0a\15w\204\70%U\311!F\232L\4b\15\247\204\30R-K\64\266" "\22e\2c\14w\204X$\21UY$\242\0d\15\247\204\270Z&\244\32\247\311D\0e\15w\204" "X$\21\355@\26\211(\0f\15\247\204x$QH*\263Iu\3g\22\247l\70\224\221D$\21" "\211H\342\212\214&\251\0h\13\247\204\30R-K\64\336\4i\13\246\205XB\71h\250'\3j\16" "\326l\230\352\20\242\36I$\11\5\0k\17\247\204\30Rm$\211$VR\221\321\4l\11\246\205\70" "C\375\311\0m\22w\204\30\221\210\344 \211P\42\224\10%B\211\10n\12w\204\30\222%\32o\2" "o\13w\204\70\25\31o\222\12\0p\16\247l\30\222%\32[\211\62\221\252\2q\15\247l\70\23R" "\215\323d\42\325\0r\12w\204\30\223\25U\35\1s\14w\204\70\25\31\271L\223T\0t\14\227\204" "XR\231M\252\213l\2u\12w\204\30\62>M&\2v\17w\204\30\302\231D\24\22\305\206\323\30" "\0w\21w\204\30\302\211d\42\231H\42%\211H\42\1x\16w\204\30\262\222D\22\34F\224j\2" "y\22\247l\30\302\231D\24\22\305hSiL\22\33\2z\15w\204\30\207\330P\66\23\316\16\1{" "\15\306}x#\241\246\331T\250u\0|\7\302\30\37\6}\15\306}\30S\241\326\331H\250i\6" "~\12F\275\70\242\212\244$\1\0\0\0";
// Copyright (c) 2016 Antony Arciuolo. See License.txt regarding use. #pragma once #include <system_error> #include <cstdio> extern "C" { #ifdef _WIN32 #define WINERR_APICALL __stdcall #else #define WINERR_APICALL #endif void __declspec(dllimport) WINERR_APICALL OutputDebugStringA(const char*); unsigned long __declspec(dllimport) WINERR_APICALL GetLastError(); } // extern "C" namespace ouro { namespace windows { const std::error_category& category(); std::error_code make_error_code(long hresult); std::error_condition make_error_condition(long hresult); class error : public std::system_error { public: error(const error& that) : system_error(that) {} error() : system_error(make_error_code(GetLastError()), make_error_code(GetLastError()).message()) { trace(); } error(const char* msg) : system_error(make_error_code(GetLastError()), msg) { trace(); } error(long hresult) : system_error(make_error_code(hresult), make_error_code(hresult).message()) { trace(); } error(long hresult, const char* msg) : system_error(make_error_code(hresult), msg) { trace(); } error(long hresult, const std::string& msg) : system_error(make_error_code(hresult), msg) { trace(); } private: void trace() { char msg[1024]; _snprintf_s(msg, sizeof(msg), "\nouro::windows::error: 0x%08x: %s\n\n", code().value(), what()); OutputDebugStringA(msg); } }; }} // For Windows API that returns an HRESULT, this captures that value and throws on failure. #define oV(hr_fn) do { long HR__ = hr_fn; if (HR__) throw ouro::windows::error(HR__); } while(false) #define oVB(bool_fn) do { if (!(bool_fn)) throw ::ouro::windows::error(); } while(false) #define oVB_MSG(bool_fn, fmt, ...) do { if (!(bool_fn)) { char msg[1024]; _snprintf_s(msg, sizeof(msg), fmt, ## __VA_ARGS__); throw ::ouro::windows::error(msg); } } while(false) // Nothrow versions #define oV_NOTHROW(hr_fn) do { long HR__ = hr_fn; if (HR__) { ::ouro::windows::error err(HR__); __debugbreak(); } } while(false) #define oVB_NOTHROW(bool_fn) do { if (!(bool_fn)) { ::ouro::windows::error err; __debugbreak(); } } while(false) #define oVB_MSG_NOTHROW(bool_fn, fmt, ...) do { if (!(bool_fn)) { char msg[1024]; _snprintf_s(msg, sizeof(msg), fmt, ## __VA_ARGS__); ::ouro::windows::error err(msg); __debugbreak(); } } while(false)
#pragma once #include <vector> #include <algorithm> #include "EnergySim.h" using namespace std; #include "Eventtypes.h" namespace EnergySim { class ENERGYSIM_DLL_PUBLIC ITable { public: virtual string getValue(string column, int row)=0; virtual bool exist(string column)=0; virtual int rows()=0; }; class Table; class ENERGYSIM_DLL_PUBLIC FileReader { public: FileReader(string fileName, char seperator); ITable* getTable(); private: vector<string> getLine(); Table* itsTable; }; }
/* * nv_param.h * * Created on: 2017. 8. 22. * Author: hrjung */ #ifndef NV_PARAM_H #define NV_PARAM_H #include "stdint.h" #ifdef UNIT_TEST_ENABLED #define STATIC #else #define STATIC static #endif /******************************************************************************* * CONSTANTS */ #ifdef TEST_MOTOR // test Motor #define TEST_MOTOR_NUM_POLE_PAIRS 2 #define TEST_MOTOR_EFFECTIVENESS 90 #define TEST_MOTOR_VOLTAGE_IN 220 #define TEST_MOTOR_RATED_FREQ 60 #define TEST_MOTOR_CAPACITY (0.25) #define TEST_MOTOR_SLIP_RATE (5.0) #define TEST_MOTOR_NOLOAD_CURRENT (1.15) #define TEST_MOTOR_MAX_CURRENT (3.0) #define TEST_MOTOR_Rr (5.574939) #define TEST_MOTOR_Rs (10.1598806) #define TEST_MOTOR_Ls (0.00392938871) #endif // 1.5KW Samyang Motor #ifdef SAMYANG_1_5K_MOTOR #define TEST_MOTOR_NUM_POLE_PAIRS 2 #define TEST_MOTOR_EFFECTIVENESS 90 #define TEST_MOTOR_RATED_FREQ 60 #define TEST_MOTOR_CAPACITY (1.5) #define TEST_MOTOR_SLIP_RATE (5.0) #if 0 #define TEST_MOTOR_VOLTAGE_IN 220 #define TEST_MOTOR_NOLOAD_CURRENT (3.4) #define TEST_MOTOR_MAX_CURRENT (15.0) //(6.0) #else #define TEST_MOTOR_VOLTAGE_IN 380 #define TEST_MOTOR_NOLOAD_CURRENT (2.0) #define TEST_MOTOR_MAX_CURRENT (3.4) //(3.5) #endif #define TEST_MOTOR_Rr (2.14568) #define TEST_MOTOR_Rs (2.5) //#define TEST_MOTOR_Ls (0.02791) // line to line #define TEST_MOTOR_Ls (0.013955) #endif #ifdef SAMYANG_2_2K_MOTOR #define TEST_MOTOR_NUM_POLE_PAIRS 2 #define TEST_MOTOR_EFFECTIVENESS 90 #define TEST_MOTOR_RATED_FREQ 60 #define TEST_MOTOR_CAPACITY (2.2) #define TEST_MOTOR_SLIP_RATE (5.0) #if 1 #define TEST_MOTOR_VOLTAGE_IN 220 #define TEST_MOTOR_NOLOAD_CURRENT (5.588) #define TEST_MOTOR_MAX_CURRENT (9.8) #else #define TEST_MOTOR_VOLTAGE_IN 380 #define TEST_MOTOR_NOLOAD_CURRENT (3.235) #define TEST_MOTOR_MAX_CURRENT (5.3) #endif #define TEST_MOTOR_Rr (1.14793) #define TEST_MOTOR_Rs (2.86) #define TEST_MOTOR_Ls (0.02184) #endif #endif /* NV_PARAM_H */
// Copyright (C) 2002-2012 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #ifndef __C_META_TRIANGLE_SELECTOR_H_INCLUDED__ #define __C_META_TRIANGLE_SELECTOR_H_INCLUDED__ #include "IMetaTriangleSelector.h" #include "irrArray.h" namespace ue { namespace scene { //! Interface for making multiple triangle selectors work as one big selector. class CMetaTriangleSelector : public IMetaTriangleSelector { public: //! constructor CMetaTriangleSelector(); //! destructor virtual ~CMetaTriangleSelector(); //! Get amount of all available triangles in this selector virtual s32 getTriangleCount() const _IRR_OVERRIDE_; //! Gets all triangles. virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, const core::matrix4* transform=0) const _IRR_OVERRIDE_; //! Gets all triangles which lie within a specific bounding box. virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, const core::aabbox3d<f32>& box, const core::matrix4* transform=0) const _IRR_OVERRIDE_; //! Gets all triangles which have or may have contact with a 3d line. virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, const core::line3d<f32>& line, const core::matrix4* transform=0) const _IRR_OVERRIDE_; //! Adds a triangle selector to the collection of triangle selectors //! in this metaTriangleSelector. virtual void addTriangleSelector(ITriangleSelector* toAdd) _IRR_OVERRIDE_; //! Removes a specific triangle selector which was added before from the collection. virtual bool removeTriangleSelector(ITriangleSelector* toRemove) _IRR_OVERRIDE_; //! Removes all triangle selectors from the collection. virtual void removeAllTriangleSelectors() _IRR_OVERRIDE_; //! Get the scene node associated with a given triangle. virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const _IRR_OVERRIDE_; // Get the number of TriangleSelectors that are part of this one virtual u32 getSelectorCount() const _IRR_OVERRIDE_; // Get the TriangleSelector based on index based on getSelectorCount virtual ITriangleSelector* getSelector(u32 index) _IRR_OVERRIDE_; // Get the TriangleSelector based on index based on getSelectorCount virtual const ITriangleSelector* getSelector(u32 index) const _IRR_OVERRIDE_; private: core::array<ITriangleSelector*> TriangleSelectors; }; } // end namespace scene } // end namespace ue #endif
/* * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef MODULES_VIDEO_CODING_CODECS_VP9_SVC_RATE_ALLOCATOR_H_ #define MODULES_VIDEO_CODING_CODECS_VP9_SVC_RATE_ALLOCATOR_H_ #include BOSS_FAKEWIN_V_stdint_h //original-code:<stdint.h> #include <vector> #include BOSS_WEBRTC_U_api__video__video_bitrate_allocator_h //original-code:"api/video/video_bitrate_allocator.h" #include BOSS_WEBRTC_U_api__video_codecs__video_codec_h //original-code:"api/video_codecs/video_codec.h" namespace webrtc { extern const float kSpatialLayeringRateScalingFactor; extern const float kTemporalLayeringRateScalingFactor; class SvcRateAllocator : public VideoBitrateAllocator { public: explicit SvcRateAllocator(const VideoCodec& codec); VideoBitrateAllocation GetAllocation(uint32_t total_bitrate_bps, uint32_t framerate_fps) override; private: VideoBitrateAllocation GetAllocationNormalVideo( uint32_t total_bitrate_bps) const; VideoBitrateAllocation GetAllocationScreenSharing( uint32_t total_bitrate_bps) const; std::vector<size_t> SplitBitrate(size_t num_layers, size_t total_bitrate, float rate_scaling_factor) const; bool AdjustAndVerify(std::vector<size_t>* spatial_layer_bitrate_bps) const; const VideoCodec codec_; }; } // namespace webrtc #endif // MODULES_VIDEO_CODING_CODECS_VP9_SVC_RATE_ALLOCATOR_H_
/**************************************************************************** * Author: Jennifer Clark * * File: listaxioms.c * * Class: CS355 * * Date Submitted: 3/29/2014 * * Description: This file is the test harbess for the list operations. * ****************************************************************************/ #include <stdio.h> #include "list.h" int main(int argv, char* argc[]) { Node myList, *zero, listHead, listTail, testRetrieve; // Test isEmpty() printf("Test case for isEmpty()\n"); int empty = 1; empty = isEmpty(zero); printf("The list zero has %d nodes.\n\n", empty); // Test prepend() printf("Test case for prepend()\n"); myList = *prepend(&myList, "E", "T"); printf("Prepend results "); list_display(&myList); printf("\n"); // Test append() printf("Test case for append()\n"); append(&myList, "A", "T"); append(&myList, "B", "F"); append(&myList, "C", "T"); append(&myList, "D", "F"); printf("Append results "); list_display(&myList); printf("\n"); // Test prepend() printf("Test case for prepend()\n"); myList = *prepend(&myList, "F", "F"); printf("Prepend results "); list_display(&myList); printf("\n"); // Test head() printf("Test case for head()\n"); listHead = *head(&myList); printf("The head of the list is "); list_display(&listHead); printf("\n"); // Test tail() printf("Test case for tail()\n"); listTail = *tail(&myList); printf("The tail of the list is "); list_display(&listTail); printf("\n"); // Test length() printf("Test case for length()\n"); int count = length(&myList); printf("The length of "); list_display(&listTail); printf(" is %d\n\n", count); // Test insert() printf("Test case for insert()\n"); myList = *insert(&myList, "B", "G", "T"); printf("Insert results after inserting (G T) after (B F): \n"); list_display(&myList); printf("\n"); // Test remove() printf("Test case for remove()\n"); removeNode(&myList, "B"); printf("The list after removing 'B' is "); list_display(&myList); printf("\n"); // retrieve() printf("Test case for retrieve()\n"); testRetrieve = *retrieve(&myList, "F"); if (&testRetrieve != NULL) { printf("Found! "); list_display(&testRetrieve); } else printf("'F' is not in the list\n"); printf("\n"); testRetrieve = *retrieve(&myList, "J"); if (length(&testRetrieve) == 0) { printf("Found! "); list_display(&testRetrieve); } else printf("'J' is not in the list\n"); printf("\n"); }
/*++ Copyright (c) 2013 Microsoft Corporation Module Name: opt_solver.h Abstract: Wraps smt::kernel as a solver for optimization Author: Anh-Dung Phan (t-anphan) 2013-10-16 Notes: Based directly on smt_solver. --*/ #ifndef OPT_SOLVER_H_ #define OPT_SOLVER_H_ #include"inf_rational.h" #include"inf_eps_rational.h" #include"ast.h" #include"params.h" #include"solver_na2as.h" #include"smt_kernel.h" #include"smt_params.h" #include"smt_types.h" #include"theory_opt.h" #include"filter_model_converter.h" namespace opt { typedef inf_eps_rational<inf_rational> inf_eps; // Adjust bound bound |-> m_offset + (m_negate?-1:1)*bound class adjust_value { rational m_offset; bool m_negate; public: adjust_value(rational const& offset, bool neg): m_offset(offset), m_negate(neg) {} adjust_value(): m_offset(0), m_negate(false) {} void set_offset(rational const& o) { m_offset = o; } void set_negate(bool neg) { m_negate = neg; } rational const& get_offset() const { return m_offset; } bool get_negate() { return m_negate; } inf_eps operator()(inf_eps const& r) const { inf_eps result = r; if (m_negate) result.neg(); result += m_offset; return result; } rational operator()(rational const& r) const { rational result = r; if (m_negate) result.neg(); result += m_offset; return result; } }; class opt_solver : public solver_na2as { private: smt_params m_params; smt::kernel m_context; ast_manager& m; filter_model_converter& m_fm; progress_callback * m_callback; symbol m_logic; svector<smt::theory_var> m_objective_vars; vector<inf_eps> m_objective_values; sref_vector<model> m_models; expr_ref_vector m_objective_terms; svector<bool> m_valid_objectives; bool m_dump_benchmarks; static unsigned m_dump_count; statistics m_stats; bool m_first; bool m_was_unknown; public: opt_solver(ast_manager & m, params_ref const & p, filter_model_converter& fm); virtual ~opt_solver(); virtual solver* translate(ast_manager& m, params_ref const& p); virtual void updt_params(params_ref & p); virtual void collect_param_descrs(param_descrs & r); virtual void collect_statistics(statistics & st) const; virtual void assert_expr(expr * t); virtual void push_core(); virtual void pop_core(unsigned n); virtual lbool check_sat_core(unsigned num_assumptions, expr * const * assumptions); virtual void get_unsat_core(ptr_vector<expr> & r); virtual void get_model(model_ref & _m); virtual proof * get_proof(); virtual std::string reason_unknown() const; virtual void get_labels(svector<symbol> & r); virtual void set_cancel(bool f); virtual void set_progress_callback(progress_callback * callback); virtual unsigned get_num_assertions() const; virtual expr * get_assertion(unsigned idx) const; virtual void display(std::ostream & out) const; void set_logic(symbol const& logic); smt::theory_var add_objective(app* term); void reset_objectives(); void maximize_objective(unsigned i, expr_ref& blocker); void maximize_objectives(expr_ref_vector& blockers); inf_eps const & saved_objective_value(unsigned obj_index); inf_eps current_objective_value(unsigned obj_index); model* get_model(unsigned obj_index) { return m_models[obj_index]; } bool objective_is_model_valid(unsigned obj_index) const { return m_valid_objectives[obj_index]; } bool was_unknown() const { return m_was_unknown; } vector<inf_eps> const& get_objective_values(); expr_ref mk_ge(unsigned obj_index, inf_eps const& val); static opt_solver& to_opt(solver& s); bool dump_benchmarks(); smt::context& get_context() { return m_context.get_context(); } // used by weighted maxsat. void ensure_pb(); smt::theory_opt& get_optimizer(); void to_smt2_benchmark(std::ofstream & buffer, unsigned num_assumptions, expr * const * assumptions, char const * name = "benchmarks", char const * logic = "", char const * status = "unknown", char const * attributes = ""); private: lbool decrement_value(unsigned i, inf_eps& val); void set_model(unsigned i); lbool adjust_result(lbool r); }; } #endif
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif FOUNDATION_EXPORT double Pods_JOURLRouter_ExampleVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_JOURLRouter_ExampleVersionString[];
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */ #pragma once #include <vector> #include <map> #include <sstream> #include <string> #include "ifcpp/model/GlobalDefines.h" #include "ifcpp/model/BasicTypes.h" #include "ifcpp/model/BuildingObject.h" #include "IfcDerivedMeasureValue.h" // TYPE IfcMagneticFluxMeasure = REAL; class IFCQUERY_EXPORT IfcMagneticFluxMeasure : public IfcDerivedMeasureValue { public: IfcMagneticFluxMeasure() = default; IfcMagneticFluxMeasure( double value ); virtual const char* className() const { return "IfcMagneticFluxMeasure"; } virtual shared_ptr<BuildingObject> getDeepCopy( BuildingCopyOptions& options ); virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const; virtual const std::wstring toString() const; static shared_ptr<IfcMagneticFluxMeasure> createObjectFromSTEP( const std::wstring& arg, const std::map<int,shared_ptr<BuildingEntity> >& map ); double m_value; };
/* standard library headers */ #include <stdint.h> #include <stdio.h> #include <stdbool.h> /* BG stack headers */ #include "bg_types.h" #include "gatt_db.h" #include "native_gecko.h" #include "infrastructure.h" /* plugin headers */ #include "connection.h" /* Own header*/ #include "services/iaq.h" bool iaqNotification; static uint8_t iaqMeasureMode; static uint8_t iaqEnable; extern uint16_t RADIO_eco2; extern uint16_t RADIO_tvoc; void iaqInit(void) { iaqNotification = false; return; } void iaqConnectionClosed(void) { iaqNotification = false; return; } void iaqConnectionOpened(void) { return; } void iaqReadECO2(void) { uint16_t eco2; /* ppm */ eco2 = RADIO_eco2; printf("IAQ: eCO2 = %d [%Xh]\r\n", eco2, eco2); /* Send response to read request */ gecko_cmd_gatt_server_send_user_read_response( conGetConnectionId(), gattdb_iaq_eco2, 0, sizeof(eco2), (uint8_t *)&eco2 ); return; } void iaqReadTVOC(void) { uint16_t tvoc; /* ppb */ tvoc = RADIO_tvoc; printf("IAQ: TVOC = %d [%Xh]\r\n", tvoc, tvoc); /* Send response to read request */ gecko_cmd_gatt_server_send_user_read_response( conGetConnectionId(), gattdb_iaq_tvoc, 0, sizeof(tvoc), (uint8_t *)&tvoc ); return; } void iaqReadControlPoint(void) { uint16_t cp; cp = (iaqEnable << 8) | iaqMeasureMode; /* Send response to read request */ gecko_cmd_gatt_server_send_user_read_response( conGetConnectionId(), gattdb_iaq_control_point, 0, sizeof(cp), (uint8_t *)&cp ); return; } void iaqControlPointChange(uint8_t connection, uint16_t clientConfig) { uint8_t mode; uint8_t enable; printf("IAQ_Service: conn = %d data = %04x\r\n", connection, clientConfig); mode = (uint8_t) (clientConfig & 0x03); enable = (uint8_t) ((clientConfig >> 15) & 0x01); printf("IAQ: enable = %s mode = %d\r\n", (enable == 1) ? "Yes" : "No", mode); return; } /* Write response codes*/ #define IAQ_WRITE_OK 0 #define IAQ_ERR_CCCD_CONF 0x81 #define IAQ_ERR_PROC_IN_PROGRESS 0x80 #define IAQ_NO_CONNECTION 0xFF void iaqControlPointWrite(uint8array *writeValue) { printf("IAQ_CP: Write; %d : %02x:%02x:%02x:%02x\r\n", writeValue->len, writeValue->data[0], writeValue->data[1], writeValue->data[2], writeValue->data[3] ); gecko_cmd_gatt_server_send_user_write_response( conGetConnectionId(), gattdb_iaq_control_point, IAQ_WRITE_OK ); return; } void iaqControlPointStatusChange(uint8_t connection, uint16_t clientConfig) { printf("IAQ_CP_Change: %d:%04x\r\n", connection, clientConfig); return; }
/* Test "cl_pocl_content_size" PoCL extension Copyright (C) 2021 Tampere University Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "poclu.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #define SRC_CHAR 1 #define DST_CHAR 2 int main (void) { cl_int err; cl_platform_id platform; cl_device_id device; cl_context context; cl_command_queue queue; cl_mem buf_content_src, buf_content_dst, buf_size; cl_int max_pattern_size = 4; char host_buf_src[1024]; char host_buf_dst[1024]; uint64_t content_size; poclu_get_any_device2 (&context, &device, &queue, &platform); void *setContentSizeBuffer_ptr = clGetExtensionFunctionAddressForPlatform ( platform, "clSetContentSizeBufferPoCL"); TEST_ASSERT ((setContentSizeBuffer_ptr != NULL)); clSetContentSizeBufferPoCL_fn setContentSizeBuffer = (clSetContentSizeBufferPoCL_fn)setContentSizeBuffer_ptr; char devname[512]; err = clGetDeviceInfo (device, CL_DEVICE_NAME, 512, devname, NULL); CHECK_OPENCL_ERROR_IN ("clGetDeviceInfo"); if (strstr (devname, "basic") == NULL && strstr (devname, "pthread") == NULL) { printf ("Device is not basic/pthread -> skipping test\n"); printf ("OK"); return 0; } buf_content_src = clCreateBuffer (context, CL_MEM_READ_WRITE, 1024, NULL, &err); CHECK_OPENCL_ERROR_IN ("clCreateBuffer"); buf_content_dst = clCreateBuffer (context, CL_MEM_READ_WRITE, 1024, NULL, &err); CHECK_OPENCL_ERROR_IN ("clCreateBuffer"); buf_size = clCreateBuffer (context, CL_MEM_READ_WRITE, 16, NULL, &err); CHECK_OPENCL_ERROR_IN ("clCreateBuffer"); memset (host_buf_src, SRC_CHAR, 1024); memset (host_buf_dst, DST_CHAR, 1024); content_size = 128; CHECK_CL_ERROR (clEnqueueWriteBuffer (queue, buf_content_src, CL_TRUE, 0, 1024, host_buf_src, 0, NULL, NULL)); CHECK_CL_ERROR (clEnqueueWriteBuffer (queue, buf_content_dst, CL_TRUE, 0, 1024, host_buf_dst, 0, NULL, NULL)); CHECK_CL_ERROR (clEnqueueWriteBuffer (queue, buf_size, CL_TRUE, 0, 8, &content_size, 0, NULL, NULL)); CHECK_CL_ERROR (clFinish (queue)); setContentSizeBuffer (buf_content_src, buf_size); // check copying behind the "content size" doesn't copy anything CHECK_CL_ERROR (clEnqueueCopyBuffer (queue, buf_content_src, buf_content_dst, 200, 200, 100, 0, NULL, NULL)); CHECK_CL_ERROR (clEnqueueReadBuffer (queue, buf_content_dst, CL_TRUE, 0, 1024, host_buf_dst, 0, NULL, NULL)); size_t count = 0; for (size_t i = 0; i < 1024; ++i) if (host_buf_dst[i] == DST_CHAR) ++count; TEST_ASSERT ((count == 1024) && "copying outside content size boundary failed"); // check copying the "content size" partially only copies up to content size CHECK_CL_ERROR (clEnqueueCopyBuffer (queue, buf_content_src, buf_content_dst, 100, 100, 100, 0, NULL, NULL)); CHECK_CL_ERROR (clEnqueueReadBuffer (queue, buf_content_dst, CL_TRUE, 0, 1024, host_buf_dst, 0, NULL, NULL)); count = 0; for (size_t i = 0; i < 100; ++i) if (host_buf_dst[i] == DST_CHAR) ++count; for (size_t i = 100; i < 128; ++i) if (host_buf_dst[i] == SRC_CHAR) ++count; for (size_t i = 128; i < 1024; ++i) if (host_buf_dst[i] == DST_CHAR) ++count; TEST_ASSERT ((count == 1024) && "copying partially content size failed"); CHECK_CL_ERROR (clReleaseMemObject (buf_content_dst)); CHECK_CL_ERROR (clReleaseMemObject (buf_content_src)); CHECK_CL_ERROR (clReleaseMemObject (buf_size)); CHECK_CL_ERROR (clReleaseCommandQueue (queue)); CHECK_CL_ERROR (clReleaseContext (context)); CHECK_CL_ERROR (clUnloadCompiler ()); printf ("OK\n"); return EXIT_SUCCESS; }
//-------------------------------------------------------------------------------- // This file is a portion of the Hieroglyph 3 Rendering Engine. It is distributed // under the MIT License, available in the root of this distribution and // at the following URL: // // http://www.opensource.org/licenses/mit-license.php // // Copyright (c) Jason Zink //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // TGrowableVertexBufferDX11 // //-------------------------------------------------------------------------------- #ifndef TGrowableVertexBufferDX11_h #define TGrowableVertexBufferDX11_h //-------------------------------------------------------------------------------- #include "PipelineManagerDX11.h" #include "TGrowableBufferDX11.h" //-------------------------------------------------------------------------------- namespace Glyph3 { template <class T> class TGrowableVertexBufferDX11 : public TGrowableBufferDX11<T> { public: TGrowableVertexBufferDX11(); virtual ~TGrowableVertexBufferDX11(); virtual void UploadData( PipelineManagerDX11* pPipeline ); virtual ResourcePtr GetBuffer(); protected: virtual void CreateResource( unsigned int elements ); virtual void DeleteResource( ); private: ResourcePtr m_VB; }; #include "TGrowableVertexBufferDX11.inl" }; //-------------------------------------------------------------------------------- #endif // TGrowableVertexBufferDX11_h //--------------------------------------------------------------------------------
#include <stdio.h> #include <math.h> #include "iqa/iqa.h" int main(void) { double q = 0.0; for (; q <= 10; q += 0.5) { printf("q = %lf, qFT(q) = %lf\n", q, qFT(q)); } return 0; }
// This test is to see if an array of pointers can be passed to a function // as a void* // As of 3/20/2018, this reported an error #include <sysio.h> void func(void *array) { } int main() { void *stuff[20]; void more_stuff[20]; func(stuff); prints("Test passed\n"); func(more_stuff); return 0; }
// // Created by Zexiao Yu on 1/18/16. // Copyright (c) 2016 Zexiao Yu. All rights reserved. // #import <Foundation/Foundation.h> typedef NS_ENUM(NSInteger, CALCalculatorDigit) { CALCalculatorDigitUndefined, CALCalculatorDigitZero, CALCalculatorDigitOne, CALCalculatorDigitTwo, CALCalculatorDigitThree, CALCalculatorDigitFour, CALCalculatorDigitFive, CALCalculatorDigitSix, CALCalculatorDigitSeven, CALCalculatorDigitEight, CALCalculatorDigitNine, }; typedef NS_ENUM(NSInteger, CALCalculatorOperator) { CALCalculatorOperatorUndefined, CALCalculatorOperatorPlus, CALCalculatorOperatorMinus, CALCalculatorOperatorStar, CALCalculatorOperatorSlash, }; @interface CALCalculator : NSObject @property (nonatomic, readonly) NSString *currentInput; - (double)peekOperand; - (CALCalculatorOperator)peekOperator; - (void)inputDigit:(CALCalculatorDigit)digit; - (void)inputOperator:(CALCalculatorOperator)operator; - (void)inputEqualSign; @end
#ifndef RUBY_RSZR #define RUBY_RSZR #include "rszr.h" #include "image.h" #include "errors.h" VALUE mRszr = Qnil; void Init_rszr() { mRszr = rb_define_module("Rszr"); Init_rszr_errors(); Init_rszr_image(); } #endif
// // yas_ui_mesh.h // #pragma once #include <ui/yas_ui_color.h> #include <ui/yas_ui_mesh_types.h> #include <ui/yas_ui_metal_setup_types.h> #include <ui/yas_ui_renderer_dependency.h> namespace yas::ui { struct mesh final : renderable_mesh { [[nodiscard]] std::shared_ptr<mesh_vertex_data> const &vertex_data() const; [[nodiscard]] std::shared_ptr<mesh_index_data> const &index_data() const; [[nodiscard]] std::shared_ptr<texture> const &texture() const; [[nodiscard]] ui::color const &color() const; [[nodiscard]] bool is_use_mesh_color() const; [[nodiscard]] ui::primitive_type const &primitive_type() const; void set_vertex_data(std::shared_ptr<mesh_vertex_data> const &); void set_index_data(std::shared_ptr<mesh_index_data> const &); void set_texture(std::shared_ptr<ui::texture> const &); void set_color(ui::color const &); void set_use_mesh_color(bool const); void set_primitive_type(ui::primitive_type const); ui::setup_metal_result metal_setup(std::shared_ptr<ui::metal_system> const &); [[nodiscard]] static std::shared_ptr<mesh> make_shared(); [[nodiscard]] static std::shared_ptr<mesh> make_shared(mesh_args &&, std::shared_ptr<mesh_vertex_data> const &, std::shared_ptr<mesh_index_data> const &, std::shared_ptr<ui::texture> const &); private: std::shared_ptr<mesh_vertex_data> _vertex_data = nullptr; std::shared_ptr<mesh_index_data> _index_data = nullptr; std::shared_ptr<ui::texture> _texture = nullptr; ui::primitive_type _primitive_type = ui::primitive_type::triangle; ui::color _color = {.v = 1.0f}; bool _use_mesh_color = false; simd::float4x4 _matrix = matrix_identity_float4x4; mesh_updates_t _updates; mesh(mesh_args &&, std::shared_ptr<mesh_vertex_data> const &, std::shared_ptr<mesh_index_data> const &, std::shared_ptr<ui::texture> const &); mesh(mesh const &) = delete; mesh(mesh &&) = delete; mesh &operator=(mesh const &) = delete; mesh &operator=(mesh &&) = delete; simd::float4x4 const &matrix() override; void set_matrix(simd::float4x4 const &) override; std::size_t render_vertex_count() override; std::size_t render_index_count() override; mesh_updates_t const &updates() override; bool pre_render() override; void batch_render(batch_render_mesh_info &, ui::batch_building_type const) override; bool is_rendering_color_exists() override; void clear_updates() override; bool _is_mesh_data_exists(); bool _needs_write(ui::batch_building_type const &); }; } // namespace yas::ui
#include "taichi/backends/metal/shaders/prolog.h" #ifdef TI_INSIDE_METAL_CODEGEN #ifndef TI_METAL_NESTED_INCLUDE #define METAL_BEGIN_RUNTIME_STRUCTS_DEF \ constexpr auto kMetalRuntimeStructsSourceCode = #define METAL_END_RUNTIME_STRUCTS_DEF ; #else #define METAL_BEGIN_RUNTIME_STRUCTS_DEF #define METAL_END_RUNTIME_STRUCTS_DEF #endif // TI_METAL_NESTED_INCLUDE #else #include <cstdint> #include "taichi/inc/constants.h" static_assert(taichi_max_num_indices == 8, "Please update kTaichiMaxNumIndices"); static_assert(sizeof(char *) == 8, "Metal pointers are 64-bit."); #define METAL_BEGIN_RUNTIME_STRUCTS_DEF #define METAL_END_RUNTIME_STRUCTS_DEF #endif // TI_INSIDE_METAL_CODEGEN // clang-format off METAL_BEGIN_RUNTIME_STRUCTS_DEF STR( constant constexpr int kTaichiMaxNumIndices = 8; constant constexpr int kTaichiNumChunks = 1024; constant constexpr int kAlignment = 8; using PtrOffset = int32_t; struct MemoryAllocator { atomic_int next; constant constexpr static int kInitOffset = 8; static inline bool is_valid(PtrOffset v) { return v >= kInitOffset; } }; // ListManagerData manages a list of elements with adjustable size. struct ListManagerData { int32_t element_stride = 0; int32_t log2_num_elems_per_chunk = 0; // Index to the next element in this list. // |next| can never go beyond |kTaichiNumChunks| * |num_elems_per_chunk|. atomic_int next; atomic_int chunks[kTaichiNumChunks]; struct ReservedElemPtrOffset { public: ReservedElemPtrOffset() = default; explicit ReservedElemPtrOffset(PtrOffset v) : val_(v) { } inline bool is_valid() const { return is_valid(val_); } inline static bool is_valid(PtrOffset v) { return MemoryAllocator::is_valid(v); } inline PtrOffset value() const { return val_; } private: PtrOffset val_{0}; }; }; // NodeManagerData stores the actual data needed to implement NodeManager // in Metal buffers. // // The actual allocated elements are not embedded in the memory region of // NodeManagerData. Instead, all this data structure does is to maintain a // few lists (ListManagerData). In particular, |data_list| stores the actual // data, while |free_list| and |recycle_list| are only meant for GC. struct NodeManagerData { using ElemIndex = ListManagerData::ReservedElemPtrOffset; // Stores the actual data. ListManagerData data_list; // For GC ListManagerData free_list; ListManagerData recycled_list; atomic_int free_list_used; // Need this field to bookkeep some data during GC int recycled_list_size_backup; }; // This class is very similar to metal::SNodeDescriptor struct SNodeMeta { enum Type { Root = 0, Dense = 1, Bitmasked = 2, Dynamic = 3, Pointer = 4, BitStruct = 5, }; int32_t element_stride = 0; int32_t num_slots = 0; int32_t mem_offset_in_parent = 0; int32_t type = 0; }; struct SNodeExtractors { struct Extractor { int32_t start = 0; int32_t num_bits = 0; int32_t acc_offset = 0; int32_t num_elements_from_root = 0; }; Extractor extractors[kTaichiMaxNumIndices]; }; struct ElementCoords { int32_t at[kTaichiMaxNumIndices]; }; struct ListgenElement { ElementCoords coords; // Memory offset from a given address. // * If in_root_buffer() is true, this is from the root buffer address. // * O/W this is from the |id|-th NodeManager's |elem_idx|-th element. int32_t mem_offset = 0; struct BelongedNodeManager { // Index of the *NodeManager itself* in the runtime buffer. // If -1, the memory where this cell lives isn't in a particular // NodeManager's dynamically allocated memory. Instead, it is at a fixed // location in the root buffer. // // For {dense, bitmasked}, this should always be -1. int32_t id = -1; // Index of the element within the NodeManager. NodeManagerData::ElemIndex elem_idx; }; BelongedNodeManager belonged_nodemgr; inline bool in_root_buffer() const { return belonged_nodemgr.id < 0; } }; ) METAL_END_RUNTIME_STRUCTS_DEF // clang-format on #undef METAL_BEGIN_RUNTIME_STRUCTS_DEF #undef METAL_END_RUNTIME_STRUCTS_DEF #include "taichi/backends/metal/shaders/epilog.h"
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Beardcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_COMPAT_H #define BITCOIN_COMPAT_H #if defined(HAVE_CONFIG_H) #include "config/beardcoin-config.h" #endif #ifdef WIN32 #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif #define _WIN32_WINNT 0x0501 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif #ifndef NOMINMAX #define NOMINMAX #endif #ifdef FD_SETSIZE #undef FD_SETSIZE // prevent redefinition compiler warning #endif #define FD_SETSIZE 1024 // max number of fds in fd_set #include <winsock2.h> // Must be included before mswsock.h and windows.h #include <mswsock.h> #include <windows.h> #include <ws2tcpip.h> #else #include <sys/fcntl.h> #include <sys/mman.h> #include <sys/socket.h> #include <sys/types.h> #include <net/if.h> #include <netinet/in.h> #include <arpa/inet.h> #include <ifaddrs.h> #include <limits.h> #include <netdb.h> #include <unistd.h> #endif #ifdef WIN32 #define MSG_DONTWAIT 0 #else typedef u_int SOCKET; #include "errno.h" #define WSAGetLastError() errno #define WSAEINVAL EINVAL #define WSAEALREADY EALREADY #define WSAEWOULDBLOCK EWOULDBLOCK #define WSAEMSGSIZE EMSGSIZE #define WSAEINTR EINTR #define WSAEINPROGRESS EINPROGRESS #define WSAEADDRINUSE EADDRINUSE #define WSAENOTSOCK EBADF #define INVALID_SOCKET (SOCKET)(~0) #define SOCKET_ERROR -1 #endif #ifdef WIN32 #ifndef S_IRUSR #define S_IRUSR 0400 #define S_IWUSR 0200 #endif #else #define MAX_PATH 1024 #endif // As Solaris does not have the MSG_NOSIGNAL flag for send(2) syscall, it is defined as 0 #if !defined(HAVE_MSG_NOSIGNAL) && !defined(MSG_NOSIGNAL) #define MSG_NOSIGNAL 0 #endif #ifndef WIN32 // PRIO_MAX is not defined on Solaris #ifndef PRIO_MAX #define PRIO_MAX 20 #endif #define THREAD_PRIORITY_LOWEST PRIO_MAX #define THREAD_PRIORITY_BELOW_NORMAL 2 #define THREAD_PRIORITY_NORMAL 0 #define THREAD_PRIORITY_ABOVE_NORMAL (-2) #endif #if HAVE_DECL_STRNLEN == 0 size_t strnlen( const char *start, size_t max_len); #endif // HAVE_DECL_STRNLEN bool static inline IsSelectableSocket(SOCKET s) { #ifdef WIN32 return true; #else return (s < FD_SETSIZE); #endif } #endif // BITCOIN_COMPAT_H
#include <bls_vdp.h> EXTERN_CONST(TEXT_TXT) #define text EXTERN_DEF(const char *, TEXT_TXT) EXTERN_CONST(TEXT_TXT_SIZE) #define textsize EXTERN_DEF(u16, TEXT_TXT_SIZE) EXTERN_CONST(PLANE_A) #define vram_plane_a EXTERN_DEF(u16, PLANE_A) EXTERN_CONST(PLANE_A_SIZE) #define vram_plane_a_size EXTERN_DEF(u16, PLANE_A_SIZE) void DISPLAY_TEXT() { u16 lineaddr = vram_plane_a; const char *txt = text; u16 remaining = textsize; blsvdp_set_autoincrement(2); while(remaining && lineaddr < vram_plane_a + vram_plane_a_size) { *VDPCTRL_L = VDPCMD(VDPWRITE, VDPVRAM, lineaddr); u16 linelen = 0x40; while(remaining && *txt != '\n') { *VDPDATA = (u16)*txt; ++txt; --remaining; --linelen; if(linelen == 0x40 - 40) { linelen = 0x40; lineaddr += 0x80; if(lineaddr >= vram_plane_a + vram_plane_a_size) { return; // No more room on screen } } } if(remaining) { // Skip line break ++txt; --remaining; } while(linelen > 0) { // Clear after end of line *VDPDATA = (u16)' '; --linelen; } lineaddr += 0x80; } // Clear the screen after last line if needed while(lineaddr < vram_plane_a + vram_plane_a_size) { *VDPCTRL_L = VDPCMD(VDPWRITE, VDPVRAM, lineaddr); for(remaining = 0; remaining < 0x40; ++remaining) { *VDPDATA = (u16)' '; } lineaddr += 0x80; } }
// // FMDPreviewViewController.h // Framed // // Created by 杨弘宇 on 2017/2/21. // Copyright © 2017年 Cyandev. All rights reserved. // #import <Cocoa/Cocoa.h> @interface FMDPreviewViewController : NSViewController @property (weak) IBOutlet NSImageView *imageView; @end
#pragma once #include <string> #include "PlayerStrategy.h" class EquiprobableStrategy : public PlayerStrategy { public: double GetShowdownValue(State* statePtr) const override; };
#pragma once namespace KinectVision { // Constant buffer used to send MVP matrices to the vertex shader. struct ModelViewProjectionConstantBuffer { DirectX::XMFLOAT4X4 model; DirectX::XMFLOAT4X4 view; DirectX::XMFLOAT4X4 projection; DirectX::XMFLOAT4 vLightDir[2]; DirectX::XMFLOAT4 vLightColor[2]; }; // Used to send per-vertex data to the vertex shader. struct VertexPositionColor { DirectX::XMFLOAT3 pos; DirectX::XMFLOAT3 normal; }; }
#include <stdlib.h> #include "soundpipe.h" int sp_progress_create(sp_progress **p) { *p = malloc(sizeof(sp_progress)); return SP_OK; } int sp_progress_destroy(sp_progress **p) { free(*p); return SP_OK; } int sp_progress_init(sp_data *sp, sp_progress *p) { p->nbars = 40; p->skip = 1000; p->counter = 0; p->len = sp->len; return SP_OK; } int sp_progress_compute(sp_data *sp, sp_progress *p, SPFLOAT *in, SPFLOAT *out) { if(p->counter == 0 || sp->pos == p->len - 1) { int n; SPFLOAT slope = 1.0 / p->nbars; if(sp->pos == 0) fprintf(stderr, "\e[?25l"); SPFLOAT percent = ((SPFLOAT)sp->pos / p->len); fprintf(stderr, "["); for(n = 0; n < p->nbars; n++) { if(n * slope <= percent) { fprintf(stderr, "#"); }else { fprintf(stderr, " "); } } fprintf(stderr, "] %.2f%%\t\r", 100 * percent); } if(sp->pos == p->len - 1) fprintf(stderr, "\n\e[?25h"); fflush(stderr); p->counter++; p->counter %= p->skip; return SP_OK; }
// Copyright (c) 2018 Michael Heilmann #include "Nucleus/Collections/ByteArray.h" #include "Nucleus/FileSystem.h" #include "Nucleus/Memory.h" #include <string.h> Nucleus_NoError() Nucleus_NonNull(2) static Nucleus_Status callback ( Nucleus_Collections_ByteArray *byteArray, const char *bytes, size_t numberOfBytes ) { return Nucleus_Collections_ByteArray_appendMany(byteArray, bytes, numberOfBytes); } Nucleus_NonNull() static Nucleus_Status test ( const char *pathname, const char *content, size_t contentSize ) { if (!pathname || !content) return Nucleus_Status_InvalidArgument; Nucleus_Status status; Nucleus_Collections_ByteArray buffer; status = Nucleus_Collections_ByteArray_initialize(&buffer, 0); if (status) return status; status = Nucleus_getFileContentsExtended(pathname, &buffer, (Nucleus_getFileContentsExtendedCallbackFunction *)(&callback)); if (status) { Nucleus_Collections_ByteArray_uninitialize(&buffer); return status; } void *readContent = NULL; size_t readContentSize = 0; // TODO: API violates the API conventions of Nucleus. status = Nucleus_Collections_ByteArray_lock(&buffer, &readContent, &readContentSize); if (status) { Nucleus_Collections_ByteArray_uninitialize(&buffer); return status; } if (contentSize != readContentSize) { Nucleus_Collections_ByteArray_unlock(&buffer); Nucleus_Collections_ByteArray_uninitialize(&buffer); return Nucleus_Status_InternalError; // TODO: Add and use Nucleus_Status_TestFailed. } bool result; status = Nucleus_compareMemory(content, readContent, contentSize, &result); if (status) { Nucleus_Collections_ByteArray_unlock(&buffer); Nucleus_Collections_ByteArray_uninitialize(&buffer); return Nucleus_Status_InternalError; // TODO: Add and use Nucleus_Status_TestFailed. } Nucleus_Collections_ByteArray_unlock(&buffer); Nucleus_Collections_ByteArray_uninitialize(&buffer); if (!result) { return Nucleus_Status_InternalError; // TODO: Add and use Nucleus_Status_TestFailed. } return Nucleus_Status_Success; } int main(int argc, char **argv) { if (test("data/helloworld.txt", "Hello, World!\n", strlen("Hello, World!\n")) || test("data/empty.txt", "", strlen(""))) { return EXIT_FAILURE; } return EXIT_SUCCESS; }
// Copyright (c) 2013 Craig Henderson // Part of the Data Processing Library // https://github.com/cdmh/dataproc #include "mapped_csv.detail.h"
//Faça um programa que leia dois valores inteiros nas variáveis x e y e troque o //conteúdo das variáveis. #include<stdio.h> void main(){ int x, y, aux; printf("Informe o valor de X: "); scanf("%d", &x); printf("Informe o valor de Y: "); scanf("%d", &y); aux = y; y = x; x = aux; printf("Valor do X: %d\n", x); printf("Valor do Y: %d\n", y); }
// // NRKLoginViewController.h // iOSPlayground // // Created by noark on 7/29/15. // Copyright © 2015 noark. All rights reserved. // #import <UIKit/UIKit.h> @interface NRKMVCLoginViewController : UIViewController @end
/** * ___ * | | | * / \ | | * |--o|===|-| * |---| |n| * / \ |o| * | O | |d| * | N |=|e| * | S | | | * |_______| |_| * |@| |@| | | * ___________|_|_ * * AliyunONS - Node.js SDK for Aliyun ONS (based on RocketMQ) * * Copyright (c) 2017 XadillaX <i@2333.moe> * * MIT LIcense <https://github.com/XadillaX/aliyun-ons/blob/master/LICENSE> */ #ifndef __CONSUMER_STOP_WORKER_H__ #define __CONSUMER_STOP_WORKER_H__ #include "../consumer.h" class ConsumerStopWorker : public Nan::AsyncWorker { public: ConsumerStopWorker(Nan::Callback* callback, ONSConsumerV8& ons) : AsyncWorker(callback), ons(ons) { } ~ConsumerStopWorker() {} void Execute() { ons.Stop(); } void HandleOKCallback() { Nan::HandleScope scope; callback->Call(0, 0); } private: ONSConsumerV8& ons; }; #endif
#pragma once #include "BaseEngine.h" class EngineOpenGLES : public BaseEngine { public: ~EngineOpenGLES() { exit(); } // BaseEngine required void setup() override; void exit() override; bool createDeviceObjects() override; void invalidateDeviceObjects() override; void onKeyReleased(ofKeyEventArgs& event) override; // Custom static void rendererDrawLists(ImDrawData * draw_data); static ofShader g_Shader; };
/* * $Id: linkhash.c,v 1.4 2006/01/26 02:16:28 mclark Exp $ * * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. * Michael Clark <michael@metaparadigm.com> * Copyright (c) 2009 Hewlett-Packard Development Company, L.P. * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> #include <stddef.h> #include <limits.h> #include "linkhash.h" void lh_abort(const char *msg, ...) { va_list ap; va_start(ap, msg); vprintf(msg, ap); va_end(ap); exit(1); } unsigned long lh_ptr_hash(const void *k) { /* CAW: refactored to be 64bit nice */ return (unsigned long)((((ptrdiff_t)k * LH_PRIME) >> 4) & ULONG_MAX); } int lh_ptr_equal(const void *k1, const void *k2) { return (k1 == k2); } unsigned long lh_char_hash(const void *k) { unsigned int h = 0; const char* data = (const char*)k; while( *data!=0 ) h = h*129 + (unsigned int)(*data++) + LH_PRIME; return h; } int lh_char_equal(const void *k1, const void *k2) { return (strcmp((const char*)k1, (const char*)k2) == 0); } struct lh_table* lh_table_new(int size, const char *name, lh_entry_free_fn *free_fn, lh_hash_fn *hash_fn, lh_equal_fn *equal_fn) { int i; struct lh_table *t; t = (struct lh_table*)calloc(1, sizeof(struct lh_table)); if(!t) lh_abort("lh_table_new: calloc failed\n"); t->count = 0; t->size = size; t->name = name; t->table = (struct lh_entry*)calloc(size, sizeof(struct lh_entry)); if(!t->table) lh_abort("lh_table_new: calloc failed\n"); t->free_fn = free_fn; t->hash_fn = hash_fn; t->equal_fn = equal_fn; for(i = 0; i < size; i++) t->table[i].k = LH_EMPTY; return t; } struct lh_table* lh_kchar_table_new(int size, const char *name, lh_entry_free_fn *free_fn) { return lh_table_new(size, name, free_fn, lh_char_hash, lh_char_equal); } struct lh_table* lh_kptr_table_new(int size, const char *name, lh_entry_free_fn *free_fn) { return lh_table_new(size, name, free_fn, lh_ptr_hash, lh_ptr_equal); } void lh_table_resize(struct lh_table *t, int new_size) { struct lh_table *new_t; struct lh_entry *ent; new_t = lh_table_new(new_size, t->name, NULL, t->hash_fn, t->equal_fn); ent = t->head; while(ent) { lh_table_insert(new_t, ent->k, ent->v); ent = ent->next; } free(t->table); t->table = new_t->table; t->size = new_size; t->head = new_t->head; t->tail = new_t->tail; t->resizes++; free(new_t); } void lh_table_free(struct lh_table *t) { struct lh_entry *c; for(c = t->head; c != NULL; c = c->next) { if(t->free_fn) { t->free_fn(c); } } free(t->table); free(t); } int lh_table_insert(struct lh_table *t, void *k, const void *v) { unsigned long h, n; t->inserts++; if(t->count >= t->size * LH_LOAD_FACTOR) lh_table_resize(t, t->size * 2); h = t->hash_fn(k); n = h % t->size; while( 1 ) { if(t->table[n].k == LH_EMPTY || t->table[n].k == LH_FREED) break; t->collisions++; if(++n == t->size) n = 0; } t->table[n].k = k; t->table[n].v = v; t->count++; if(t->head == NULL) { t->head = t->tail = &t->table[n]; t->table[n].next = t->table[n].prev = NULL; } else { t->tail->next = &t->table[n]; t->table[n].prev = t->tail; t->table[n].next = NULL; t->tail = &t->table[n]; } return 0; } struct lh_entry* lh_table_lookup_entry(struct lh_table *t, const void *k) { unsigned long h = t->hash_fn(k); unsigned long n = h % t->size; int count = 0; t->lookups++; while( count < t->size ) { if(t->table[n].k == LH_EMPTY) return NULL; if(t->table[n].k != LH_FREED && t->equal_fn(t->table[n].k, k)) return &t->table[n]; if(++n == t->size) n = 0; count++; } return NULL; } const void* lh_table_lookup(struct lh_table *t, const void *k) { void *result; lh_table_lookup_ex(t, k, &result); return result; } json_bool lh_table_lookup_ex(struct lh_table* t, const void* k, void **v) { struct lh_entry *e = lh_table_lookup_entry(t, k); if (e != NULL) { if (v != NULL) *v = (void *)e->v; return TRUE; /* key found */ } if (v != NULL) *v = NULL; return FALSE; /* key not found */ } int lh_table_delete_entry(struct lh_table *t, struct lh_entry *e) { ptrdiff_t n = (ptrdiff_t)(e - t->table); /* CAW: fixed to be 64bit nice, still need the crazy negative case... */ /* CAW: this is bad, really bad, maybe stack goes other direction on this machine... */ if(n < 0) { return -2; } if(t->table[n].k == LH_EMPTY || t->table[n].k == LH_FREED) return -1; t->count--; if(t->free_fn) t->free_fn(e); t->table[n].v = NULL; t->table[n].k = LH_FREED; if(t->tail == &t->table[n] && t->head == &t->table[n]) { t->head = t->tail = NULL; } else if (t->head == &t->table[n]) { t->head->next->prev = NULL; t->head = t->head->next; } else if (t->tail == &t->table[n]) { t->tail->prev->next = NULL; t->tail = t->tail->prev; } else { t->table[n].prev->next = t->table[n].next; t->table[n].next->prev = t->table[n].prev; } t->table[n].next = t->table[n].prev = NULL; return 0; } int lh_table_delete(struct lh_table *t, const void *k) { struct lh_entry *e = lh_table_lookup_entry(t, k); if(!e) return -1; return lh_table_delete_entry(t, e); }
#pragma once #include "GameObject.h" namespace lib { class Camera; class CameraController { public: CameraController(); ~CameraController(); void PushCamera(Camera* pCamera); void PopCamera(); Camera* GetCurrentCamera() { return m_cameraList.back(); } private: std::vector<Camera*> m_cameraList; }; }
// // LTLheadView.h // 音乐播放器 // // Created by LiTaiLiang on 16/8/1. // Copyright © 2016年 LiTaiLiang. All rights reserved. // #import <UIKit/UIKit.h> @class LTLCarouselView; @protocol LTLCarouselViewDelegate <NSObject> -(void)didLTLCarouselView:(LTLCarouselView *)CarouselView tag :(NSUInteger)tag; @end @interface LTLCarouselView : UIView //代理 @property (nonatomic,weak) id<LTLCarouselViewDelegate>LTLDelegate; ///滑动 -(void)huangDong:(CGFloat)X; ///获取数据 -(void)DataAcquisition; @end
#ifndef RPCCONSOLE_H #define RPCCONSOLE_H #include <QDialog> #include <QCompleter> namespace Ui { class RPCConsole; } class ClientModel; /** Local Bitcoin RPC console. */ class RPCConsole: public QDialog { Q_OBJECT public: explicit RPCConsole(QWidget *parent = 0); ~RPCConsole(); void setClientModel(ClientModel *model); enum MessageClass { MC_ERROR, MC_DEBUG, CMD_REQUEST, CMD_REPLY, CMD_ERROR }; protected: virtual bool eventFilter(QObject* obj, QEvent *event); private slots: void on_lineEdit_returnPressed(); void on_tabWidget_currentChanged(int index); /** open the debug.log from the current datadir */ void on_openDebugLogfileButton_clicked(); /** open neblio datadir */ void on_openDataDirButton_clicked(); /** display messagebox with program parameters (same as bitcoin-qt --help) */ void on_showCLOptionsButton_clicked(); public slots: void clear(); void message(int category, const QString &message, bool html = false); /** Set number of connections shown in the UI */ void setNumConnections(int count); /** Set number of blocks shown in the UI */ void setNumBlocks(int count, int countOfPeers); /** Go forward or back in history */ void browseHistory(int offset); /** Scroll console view to end */ void scrollToEnd(); signals: // For RPC command executor void stopExecutor(); void cmdRequest(const QString &command); private: Ui::RPCConsole *ui; ClientModel *clientModel; QStringList history; int historyPtr; QCompleter *autocompleter; void startExecutor(); }; #endif // RPCCONSOLE_H
#pragma once #include "Vector.h" #include <vector> namespace Namse { class Vector; class Node { public: Node(){} virtual void MoveBy(Vector& vector); virtual void MoveTo(Vector& vector); //virtual void RotateBy(GLdouble _angleX, GLdouble _angleY, GLdouble _angleZ) {} virtual void OnDraw(Vector& BasePosition); void AddChild( Node* node ); void RemoveChild( Node* node ); Vector m_Position; private: std::vector<Node*> m_Childs; }; }
#pragma once #include <string> #include <iozeug/iozeug_api.h> namespace iozeug { // copied from glow::internal::FileReader IOZEUG_API bool readFile(const std::string & filePath, std::string & content); IOZEUG_API std::string readFile(const std::string & filePath); } // namespace iozeug
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "WCVideoRender.h" #import "WCVideoPreviewRenderExt.h" @class AVCaptureVideoPreviewLayer, NSString, UIImageView, UIView; @interface WCVideoPreviewRender : WCVideoRender <WCVideoPreviewRenderExt> { _Bool _m_usingSecondView; UIImageView *_m_firstRenderView; UIImageView *_m_secondRenderView; UIView *_m_containerView; AVCaptureVideoPreviewLayer *_m_previewLayer; } @property(nonatomic) _Bool m_usingSecondView; // @synthesize m_usingSecondView=_m_usingSecondView; @property(retain, nonatomic) AVCaptureVideoPreviewLayer *m_previewLayer; // @synthesize m_previewLayer=_m_previewLayer; @property(retain, nonatomic) UIView *m_containerView; // @synthesize m_containerView=_m_containerView; @property(retain, nonatomic) UIImageView *m_secondRenderView; // @synthesize m_secondRenderView=_m_secondRenderView; @property(retain, nonatomic) UIImageView *m_firstRenderView; // @synthesize m_firstRenderView=_m_firstRenderView; - (void).cxx_destruct; - (void)onGetLastFrameImage:(id)arg1; - (void)onFlipCameraComplete; - (void)flipView; - (id)getRenderView; - (void)changeFrame:(struct CGRect)arg1; - (void)updateOrientation; - (id)initWithFrame:(struct CGRect)arg1 AVCaptureVideoPreviewLayer:(id)arg2; - (void)dealloc; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
#ifndef igs_image_writers_h #define igs_image_writers_h #include <string> #include "igs_image_irw.h" #if defined USE_IRW_PLUGIN //--------- #include "igs_path_irw.h" #endif //------------------------------------------ #ifndef IGS_IMAGE_WRITERS_EXPORT # define IGS_IMAGE_WRITERS_EXPORT #endif /* 2010-2-6 class¤Î¥á¥ó¥Ð¡¼¤Ëstd::vector¤ò»È¤¦¤È¡¢ MS-C(vc2005md)¤ÎDLL¤Ë¤Ç¤­¤Ê¤¤(¸¶°øÉÔÌÀ)¡£ */ namespace igs { namespace image { class IGS_IMAGE_WRITERS_EXPORT writers { public: writers( #if defined USE_IRW_PLUGIN //--------- const std::string& dir_path = igs::path::plugin_dir("","","","","save") #endif //----------------------------- ); const unsigned int size(void); /* ½ñ¼°¿ô */ const unsigned int size( const int fmt_number); /* ³ÈÄ¥»Ò¿ô */ const char *name(const int fmt_number); /* ½ñ¼°Ì¾ */ const char *name(const int fmt_number,const int ext_number); /* ³ÈÄ¥»Ò̾ */ const unsigned int compression_size( const int fmt_number); const char *compression_name( const int fmt_number , const int comp_number); /* ¥Ñ¥¹¤Î³ÈÄ¥»Ò¤¬Í­¸ú¤«Ä´¤Ù¤ë */ const int fmt_number_from_extension( const std::string& file_path ); /* ½ñ¼°¤ÎÀßÄê */ void check(const std::string& file_path); /* properties¤¬Í­¸ú¤«Ä´¤Ù¤ë */ const bool bad_properties( std::ostringstream& error_or_warning_msg , const igs::image::properties& props ); void bad_properties( const igs::image::properties& props ); void put_data( const igs::image::properties& prop , const unsigned int image_size , const unsigned char *image_array , const int compression_number /* 0 -> Not Compress 1 -> Default Compress Type 2... -> Other Compress Type(If Exist) */ , const std::string& history_str , const std::string& file_path ); void clear(void); ~writers(); private: int current_num_; int current_ext_num_; int module_count_; }; } } #endif /* !igs_image_writers_h */
/** * \file * * Copyright (c) 2013 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * 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 Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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. * * \asf_license_stop * */ #ifndef _SAM4N_DACC_INSTANCE_ #define _SAM4N_DACC_INSTANCE_ /* ========== Register definition for DACC peripheral ========== */ #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) #define REG_DACC_CR (0x4003C000U) /**< \brief (DACC) Control Register */ #define REG_DACC_MR (0x4003C004U) /**< \brief (DACC) Mode Register */ #define REG_DACC_CDR (0x4003C008U) /**< \brief (DACC) Conversion Data Register */ #define REG_DACC_IER (0x4003C00CU) /**< \brief (DACC) Interrupt Enable Register */ #define REG_DACC_IDR (0x4003C010U) /**< \brief (DACC) Interrupt Disable Register */ #define REG_DACC_IMR (0x4003C014U) /**< \brief (DACC) Interrupt Mask Register */ #define REG_DACC_ISR (0x4003C018U) /**< \brief (DACC) Interrupt Status Register */ #define REG_DACC_WPMR (0x4003C0E4U) /**< \brief (DACC) Write Protect Mode Register */ #define REG_DACC_WPSR (0x4003C0E8U) /**< \brief (DACC) Write Protect Status Register */ #define REG_DACC_TPR (0x4003C108U) /**< \brief (DACC) Transmit Pointer Register */ #define REG_DACC_TCR (0x4003C10CU) /**< \brief (DACC) Transmit Counter Register */ #define REG_DACC_TNPR (0x4003C118U) /**< \brief (DACC) Transmit Next Pointer Register */ #define REG_DACC_TNCR (0x4003C11CU) /**< \brief (DACC) Transmit Next Counter Register */ #define REG_DACC_PTCR (0x4003C120U) /**< \brief (DACC) Transfer Control Register */ #define REG_DACC_PTSR (0x4003C124U) /**< \brief (DACC) Transfer Status Register */ #else #define REG_DACC_CR (*(WoReg*)0x4003C000U) /**< \brief (DACC) Control Register */ #define REG_DACC_MR (*(RwReg*)0x4003C004U) /**< \brief (DACC) Mode Register */ #define REG_DACC_CDR (*(WoReg*)0x4003C008U) /**< \brief (DACC) Conversion Data Register */ #define REG_DACC_IER (*(WoReg*)0x4003C00CU) /**< \brief (DACC) Interrupt Enable Register */ #define REG_DACC_IDR (*(WoReg*)0x4003C010U) /**< \brief (DACC) Interrupt Disable Register */ #define REG_DACC_IMR (*(RoReg*)0x4003C014U) /**< \brief (DACC) Interrupt Mask Register */ #define REG_DACC_ISR (*(RoReg*)0x4003C018U) /**< \brief (DACC) Interrupt Status Register */ #define REG_DACC_WPMR (*(RwReg*)0x4003C0E4U) /**< \brief (DACC) Write Protect Mode Register */ #define REG_DACC_WPSR (*(RoReg*)0x4003C0E8U) /**< \brief (DACC) Write Protect Status Register */ #define REG_DACC_TPR (*(RwReg*)0x4003C108U) /**< \brief (DACC) Transmit Pointer Register */ #define REG_DACC_TCR (*(RwReg*)0x4003C10CU) /**< \brief (DACC) Transmit Counter Register */ #define REG_DACC_TNPR (*(RwReg*)0x4003C118U) /**< \brief (DACC) Transmit Next Pointer Register */ #define REG_DACC_TNCR (*(RwReg*)0x4003C11CU) /**< \brief (DACC) Transmit Next Counter Register */ #define REG_DACC_PTCR (*(WoReg*)0x4003C120U) /**< \brief (DACC) Transfer Control Register */ #define REG_DACC_PTSR (*(RoReg*)0x4003C124U) /**< \brief (DACC) Transfer Status Register */ #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #endif /* _SAM4N_DACC_INSTANCE_ */
/** * @file lv_img_cache.h * */ #ifndef LV_IMG_CACHE_H #define LV_IMG_CACHE_H #ifdef __cplusplus extern "C" { #endif /********************* * INCLUDES *********************/ #include "lv_img_decoder.h" /********************* * DEFINES *********************/ /********************** * TYPEDEFS **********************/ /** * When loading images from the network it can take a long time to download and decode the image. * * To avoid repeating this heavy load images can be cached. */ typedef struct { lv_img_decoder_dsc_t dec_dsc; /**< Image information */ /** Count the cache entries's life. Add `time_tio_open` to `life` when the entry is used. * Decrement all lifes by one every in every ::lv_img_cache_open. * If life == 0 the entry can be reused */ int32_t life; } lv_img_cache_entry_t; /********************** * GLOBAL PROTOTYPES **********************/ /** * Open an image using the image decoder interface and cache it. * The image will be left open meaning if the image decoder open callback allocated memory then it will remain. * The image is closed if a new image is opened and the new image takes its place in the cache. * @param src source of the image. Path to file or pointer to an `lv_img_dsc_t` variable * @param color The color of the image with `LV_IMG_CF_ALPHA_...` * @return pointer to the cache entry or NULL if can open the image */ lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color); /** * Set the number of images to be cached. * More cached images mean more opened image at same time which might mean more memory usage. * E.g. if 20 PNG or JPG images are open in the RAM they consume memory while opened in the cache. * @param new_entry_cnt number of image to cache */ void lv_img_cache_set_size(uint16_t new_slot_num); /** * Invalidate an image source in the cache. * Useful if the image source is updated therefore it needs to be cached again. * @param src an image source path to a file or pointer to an `lv_img_dsc_t` variable. */ void lv_img_cache_invalidate_src(const void * src); /********************** * MACROS **********************/ #ifdef __cplusplus } /* extern "C" */ #endif #endif /*LV_IMG_CACHE_H*/
#pragma once #include "ShaderManager.h" #include "Utility.h" #include "GXBase\include\GXBase.h" #include <vector> #include <map> #include <string> using namespace gxbase; class ParticleEmitter : public glex { private: struct Particle { Vector4f _postion, _orgPosition; Vector4f _velocity, _orgVelocity; // Done as 4d vector so easier to add to position Vector2f _ttl; // Done as 2d vector to pass into shader as tex coords (not using them after all) }; vector<Particle> _particles; GLuint _textureID; int _maxParticles; int _curParticles; float _release; float _curTime; char* _shaderName; Vector3f _emitterPos; Vector3f _forceFeedback; float _scale; Vector4f RandomVector(const Vector3f& min, const Vector3f& max) const; public: explicit ParticleEmitter(void); ~ParticleEmitter(void); const void Initialize(char* shader, map<string,string>& configLines); const void Render(const Vector3f& camPos); const void Update(const Vector3f& force, const float dt); const void Reset(); const void GetSnowDrifts(vector<Utility::Vertex>& faces, Vector3f& accel); };
// // GameCardViewCell.h // VivaRealChallenge // // Created by Roger Luan on 11/5/15. // Copyright © 2015 Roger Oba. All rights reserved. // #import <UIKit/UIKit.h> @interface GameCardViewCell : UICollectionViewCell @property (strong, nonatomic) IBOutlet UIImageView *gamePosterImageView; @property (strong, nonatomic) IBOutlet UILabel *gameTitleLabel; @end
// // GLStoreProductCommentCell.h // Universialshare // // Created by 龚磊 on 2017/5/21. // Copyright © 2017年 四川三君科技有限公司. All rights reserved. // #import <UIKit/UIKit.h> #import "GLMerchat_CommentModel.h" @protocol GLMerchat_CommentCellDelegate <NSObject> - (void)comment:(NSInteger)index; @end @interface GLMerchat_CommentCell : UITableViewCell @property (nonatomic, strong)GLMerchat_CommentModel *model; @property (nonatomic, assign)id<GLMerchat_CommentCellDelegate> delegate; @property (weak, nonatomic) IBOutlet UIButton *commentBtn; @property (weak, nonatomic) IBOutlet UIView *bgView; @property (weak, nonatomic) IBOutlet UILabel *replyLabel; @property (nonatomic, assign)NSInteger index; @end
#import <Foundation/Foundation.h> typedef enum { GEventType_CHECKPOINT, GEventType_PAUSE, GEventType_UNPAUSE, GEventType_QUIT, GEventType_LEVELEND, GEventType_UIANIM_TICK, GEventType_GAME_TICK, GEventType_LOAD_LEVELEND_MENU, GEventType_COLLECT_BONE, GEventType_PLAYER_DIE, GEventType_GAMEOVER, GEventType_PLAYAGAIN_AUTOLEVEL, GEventType_GAME_RESET, GEventType_SHOW_ENEMYAPPROACH_WARNING, GEventType_ENTER_LABAREA, GEventType_EXIT_TO_DEFAULTAREA, GEventType_BOSS1_ACTIVATE, GEventType_BOSS1_TICK, GEventType_BOSS1_DEFEATED, GEventType_MENU_TICK, GEventType_MENU_TOUCHDOWN, GEventType_MENU_TOUCHMOVE, GEventType_MENU_TOUCHUP, GEventType_MENU_CANCELDRAG, GEventType_MENU_PLAY_AUTOLEVEL_MODE, GEventType_MENU_PLAY_TESTLEVEL_MODE, GEventType_MENU_GOTO_PAGE, GEventType_CHANGE_CURRENT_DOG } GEventType; @interface GEvent : NSObject @property(readwrite,assign) GEventType type; @property(readwrite,assign) NSMutableDictionary* data; @property(readwrite,assign) CGPoint pt; @property(readwrite,assign) int i1,i2; @property(readwrite,assign) float f1,f2; +(GEvent*)cons_type:(GEventType)t; -(GEvent*)add_key:(NSString*)k value:(id)v; -(GEvent*)add_pt:(CGPoint)tpt; -(GEvent*)add_i1:(int)ti1 i2:(int)ti2; -(GEvent*)add_f1:(float)tf1 f2:(float)tf2; @end @protocol GEventListener <NSObject> @required -(void)dispatch_event:(GEvent*)e; @end @interface GEventDispatcher : NSObject +(void)lazy_alloc; +(void)add_listener:(id<GEventListener>)tar; +(void)remove_all_listeners; +(void)remove_listener:(id<GEventListener>)tar; +(void)push_event:(GEvent*)e; +(void)push_unique_event:(GEvent*)e; +(void)dispatch_events; @end
/* * The MIT License * * Copyright 2020 The OpenNARS authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef Term_H #define Term_H /////////////////// // Term // /////////////////// //Description// //-----------// //An Term is an blocksay of a specific number of 128 bit blocks //(that way no Hash ops are necessary, it's faster for this Term size) //References// //-----------// #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <stdint.h> #include "Truth.h" #include "Config.h" #include <string.h> //Data structure// //--------------// #define HASH_TYPE_SIZE sizeof(HASH_TYPE) #define TERM_ATOMS_SIZE (sizeof(Atom)*COMPOUND_TERM_SIZE_MAX) typedef struct { bool hashed; HASH_TYPE hash; Atom atoms[COMPOUND_TERM_SIZE_MAX]; }Term; //Methods// //-------// // print indices of true bits void Term_Print(Term *term); //Whether two Term's are equal completely bool Term_Equal(Term *a, Term *b); //Overwrites a subterm bool Term_OverrideSubterm(Term *term, int i, Term *subterm); //Extract a subterm as a term Term Term_ExtractSubterm(Term *term, int j); //The complexity of a term int Term_Complexity(Term *term); //Hash of a term (needed by the term->concept HashTable) HASH_TYPE Term_Hash(Term *term); #endif
// // Cell.h // RSSParser // // Created by Jakey on 14-7-22. // Copyright (c) 2014年 Jakey. All rights reserved. // #import <UIKit/UIKit.h> @interface Cell : UITableViewCell @property (weak, nonatomic) IBOutlet UILabel *newsDetail; @property (weak, nonatomic) IBOutlet UILabel *newsTitle; @property (weak, nonatomic) IBOutlet UIImageView *newsImage; @end
#ifndef _EASYEDITOR_SPR_PROP_COL_MONITOR_H_ #define _EASYEDITOR_SPR_PROP_COL_MONITOR_H_ #include "ColorMonitor.h" #include "Sprite.h" namespace ee { class SprPropColMonitor : public ColorMonitor { public: enum ColType { CT_MUL = 0, CT_ADD, CT_RMAP, CT_GMAP, CT_BMAP, }; public: SprPropColMonitor(const SprPtr& spr, ColType type); // // interface ColorMonitor // virtual pt2::Color GetColor() const override; virtual void OnColorChanged() override; virtual void OnColorChanged(const pt2::Color& col) override; private: SprPtr m_spr; ColType m_type; }; // SprPropColMonitor } #endif // _EASYEDITOR_SPR_PROP_COL_MONITOR_H_
// // baseTableRequestModel+Cache.h // Pods // // Created by yang on 16/6/3. // // #import "baseTableRequestModel.h" @interface baseTableRequestModel (Cache) @end
/* SDL - Simple DirectMedia Layer Copyright (C) 1997-2009 Sam Lantinga 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 Sam Lantinga slouken@libsdl.org */ #include "SDL_config.h" #include "SDL_aavideo.h" /* Variables and functions exported by SDL_sysevents.c to other parts of the native video subsystem (SDL_sysvideo.c) */ extern void AA_initkeymaps(int fd); extern void AA_mousecallback(int button, int dx, int dy, int u1,int u2,int u3, int u4); extern void AA_keyboardcallback(int scancode, int pressed); extern void AA_InitOSKeymap(_THIS); extern void AA_PumpEvents(_THIS);
// // Created by madrus on 26.06.16. // #ifndef PSERVER_TASKFACTORY_H #define PSERVER_TASKFACTORY_H #include "AbstractTask.h" #include <Poco/JSON/Object.h> namespace TaskFactory { AbstractTask::Ptr create(const Poco::JSON::Object::Ptr& config); }; #endif //PSERVER_TASKFACTORY_H
// // FuWen.h // lol盒子 // // Created by lanou3g on 15/11/17. // Copyright © 2015年 lanou3g. All rights reserved. // #import <Foundation/Foundation.h> @interface FuWen : NSObject @property(nonatomic,retain)NSString * Name; @property(nonatomic,retain)NSString * Alias; @property(nonatomic,retain)NSString * lev1; @property(nonatomic,retain)NSString * lev2; @property(nonatomic,retain)NSString * lev3; @property(nonatomic,retain)NSString * iplev1; @property(nonatomic,retain)NSString * iplev2; @property(nonatomic,retain)NSString * iplev3; @property(nonatomic,retain)NSString * Prop; @property(nonatomic,assign)int Type; @property(nonatomic,retain)NSString * Img; @property(nonatomic,retain)NSString * Units; @end
/*! @file Render/Texture.h */ #ifndef RENDER_TEXTURE_H #define RENDER_TEXTURE_H #pragma once #include <cstdint> #include <string> #include <vector> #include <glm/glm.hpp> #include "Util.h" namespace Orbit { /*! @brief Class abstracting texture loading and storing operations. */ class Texture final { public: /*! @brief Constructor for the class. Builds an empty texture. */ ORBIT_CORE_API Texture(std::nullptr_t); /*! @brief Constructor for the class. Builds a texture from the file pointed to by name. @param name The name of the texture to load. */ ORBIT_CORE_API explicit Texture(const std::string& name); Texture(const Texture&) = delete; Texture& operator=(const Texture&) = delete; /*! @brief Move constructor for the class. Moves the texture's assets from the right hand side. @param rhs The right hand side of the operation. */ ORBIT_CORE_API Texture(Texture&& rhs); /*! @brief Move assignment operator for the class. Moves the texture's assets from the right hand side. @param rhs The right hand side of the operation. @return A reference to this. */ ORBIT_CORE_API Texture& operator=(Texture&& rhs); /*! @brief Getter for the size of the texture. @return The size of the texture. */ ORBIT_CORE_API glm::ivec2 size() const; /*! @brief Getter for the byte data of the texture, contained in a vector for simplicity. @return The byte data of the texture. */ ORBIT_CORE_API const std::vector<uint8_t>& data() const; private: /*! The size of the texture. */ glm::ivec2 _texSize; /*! The actual data. */ std::vector<uint8_t> _bytes; }; } #endif //RENDER_TEXTURE_H
int main(){ return 7 + 5; }