text
stringlengths
4
6.14k
/** * @file buffer.h * * @date 22.03.2014 * @author Christian Menard */ #ifndef _AVRPP_UTIL_BUFFER_H_ #define _AVRPP_UTIL_BUFFER_H_ #include <inttypes.h> #include <util/atomic.h> namespace avrpp { /* * TODO: Think about an implementation based on start and end pointer. * This will reduce address calculating in push function. */ template<typename T, uint8_t size> class Buffer { private: volatile uint8_t start; volatile uint8_t n; volatile T buffer[size]; public: Buffer() : start(0), n(0) {} void push(T c); T pop(); T peek() { while(isEmpty()); return buffer[start]; } uint8_t count() { return n; } bool isEmpty() { return n == 0; } bool full() { return n == size; } void flush() { n = 0; } }; template<typename T, uint8_t size> void Buffer<T, size>::push(T c) { while( full()) // Wait until there is free space in buffer ; // TODO check if full needs to be done inside the atomic block; // Operation is not atomic (producer-consumer problem) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { // Store the item and calculate its place. buffer[ (start + n) > (size - 1) ? (n - (size - start)) : (start + n)] = c; n++; } } template<typename T, uint8_t size> T Buffer<T, size>::pop() { while( isEmpty()) // Wait until there is data in buffer ; T c; // Operation is not atomic (producer-consumer problem) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { c = buffer[start]; // increment start pointer, set it to 0 if the end of buffer is reached start = (start >= size - 1) ? 0 : start + 1; n--; } return c; } } #endif /* _AVRPP_UTIL_BUFFER_H_ */
#include <zlib.h> #include <stdio.h> #include <string.h> #include "paf.h" #include "kseq.h" KSTREAM_INIT(gzFile, gzread, 0x10000) paf_file_t *paf_open(const char *fn) { kstream_t *ks; gzFile fp; paf_file_t *pf; fp = fn && strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(fileno(stdin), "r"); if (fp == 0) return 0; ks = ks_init(fp); pf = (paf_file_t*)calloc(1, sizeof(paf_file_t)); pf->fp = ks; return pf; } int paf_close(paf_file_t *pf) { kstream_t *ks; if (pf == 0) return 0; free(pf->buf.s); ks = (kstream_t*)pf->fp; gzclose(ks->f); ks_destroy(ks); free(pf); return 0; } int paf_parse(int l, char *s, paf_rec_t *pr) // s must be NULL terminated { // on return: <0 for failure; 0 for success; >0 for filtered char *q, *r; int i, t; for (i = t = 0, q = s; i <= l; ++i) { if (i < l && s[i] != '\t') continue; s[i] = 0; if (t == 0) pr->qn = q; else if (t == 1) pr->ql = strtol(q, &r, 10); else if (t == 2) pr->qs = strtol(q, &r, 10); else if (t == 3) pr->qe = strtol(q, &r, 10); else if (t == 4) pr->rev = (*q == '-'); else if (t == 5) pr->tn = q; else if (t == 6) pr->tl = strtol(q, &r, 10); else if (t == 7) pr->ts = strtol(q, &r, 10); else if (t == 8) pr->te = strtol(q, &r, 10); else if (t == 9) pr->ml = strtol(q, &r, 10); else if (t == 10) pr->bl = strtol(q, &r, 10); ++t, q = i < l? &s[i+1] : 0; } if (t < 10) return -1; return 0; } int paf_read(paf_file_t *pf, paf_rec_t *r) { int ret, dret; file_read_more: ret = ks_getuntil((kstream_t*)pf->fp, KS_SEP_LINE, &pf->buf, &dret); if (ret < 0) return ret; ret = paf_parse(pf->buf.l, pf->buf.s, r); if (ret < 0) goto file_read_more; return ret; }
#ifndef GUIUTIL_H #define GUIUTIL_H #include <QString> #include <QObject> #include <QMessageBox> QT_BEGIN_NAMESPACE class QFont; class QLineEdit; class QWidget; class QDateTime; class QUrl; class QAbstractItemView; QT_END_NAMESPACE class SendCoinsRecipient; /** Utility functions used by the Bitcoin Qt UI. */ namespace GUIUtil { // Create human-readable string from date QString dateTimeStr(const QDateTime &datetime); QString dateTimeStr(qint64 nTime); // Render Bitcoin addresses in monospace font QFont bitcoinAddressFont(); // Set up widgets for address and amounts void setupAddressWidget(QLineEdit *widget, QWidget *parent); void setupAmountWidget(QLineEdit *widget, QWidget *parent); // Parse "mazecoin:" URI into recipient object, return true on successful parsing // See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0 bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out); bool parseBitcoinURI(QString uri, SendCoinsRecipient *out); // HTML escaping for rich text controls QString HtmlEscape(const QString& str, bool fMultiLine=false); QString HtmlEscape(const std::string& str, bool fMultiLine=false); /** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing is selected. @param[in] column Data column to extract from the model @param[in] role Data role to extract from the model @see TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress */ void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole); /** Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when no suffix is provided by the user. @param[in] parent Parent window (or 0) @param[in] caption Window caption (or empty, for default) @param[in] dir Starting directory (or empty, to default to documents directory) @param[in] filter Filter specification such as "Comma Separated Files (*.csv)" @param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0). Can be useful when choosing the save file format based on suffix. */ QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedSuffixOut=0); /** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking. @returns If called from the GUI thread, return a Qt::DirectConnection. If called from another thread, return a Qt::BlockingQueuedConnection. */ Qt::ConnectionType blockingGUIThreadConnection(); // Determine whether a widget is hidden behind other windows bool isObscured(QWidget *w); // Open debug.log void openDebugLogfile(); /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. This assures that Qt can word-wrap long tooltip messages. Tooltips longer than the provided size threshold (in characters) are wrapped. */ class ToolTipToRichTextFilter : public QObject { Q_OBJECT public: explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0); protected: bool eventFilter(QObject *obj, QEvent *evt); private: int size_threshold; }; bool GetStartOnSystemStartup(); bool SetStartOnSystemStartup(bool fAutoStart); /** Help message for Bitcoin-Qt, shown with --help. */ class HelpMessageBox : public QMessageBox { Q_OBJECT public: HelpMessageBox(QWidget *parent = 0); /** Show message box or print help message to standard output, based on operating system. */ void showOrPrint(); /** Print help message to console */ void printToConsole(); private: QString header; QString coreOptions; QString uiOptions; }; } // namespace GUIUtil #endif // GUIUTIL_H
//////////////////////////////////////////////////////////////////////////// // // The MIT License (MIT) // Copyright (c) 2016 Albert D Yang // ------------------------------------------------------------------------- // Module: ASync // File name: VeThread.h // Created: 2016/07/11 by Albert // Description: // ------------------------------------------------------------------------- // 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 class VENUS_API VeThread : public VeRefObject { VeNoCopy(VeThread); VeNoMove(VeThread); public: class Event { VeNoCopy(Event); VeNoMove(Event); public: Event() noexcept { } ~Event() noexcept { } void Wait() noexcept { std::unique_lock<std::mutex> kLock(m_kMutex); while (m_i32Count <= 0) { m_kCondition.wait(kLock); } } void Set(int32_t i32Step = 1) noexcept { std::lock_guard<std::mutex> kLock(m_kMutex); m_i32Count += i32Step; m_kCondition.notify_all(); } void Reset(int32_t i32Count = 1) noexcept { assert(i32Count > 0); std::lock_guard<std::mutex> kLock(m_kMutex); m_i32Count = 1 - i32Count; } private: std::mutex m_kMutex; std::condition_variable m_kCondition; int32_t m_i32Count = 0; }; typedef std::function<void()> Entry; VeThread() noexcept; VeThread(const std::function<void()>& kEntry) noexcept; virtual ~VeThread() noexcept; inline bool IsRunning() noexcept; void Start() noexcept; void StartEntry(const std::function<void()>& kEntry) noexcept; void SetEntry(const std::function<void()>& kEntry) noexcept; void Join() noexcept; void Suspend() noexcept; void Resume() noexcept; static void Init(); static void Term(); private: void Callback() noexcept; Entry m_kEntry; std::thread m_kCore; Event m_kLoop; Event m_kJoin; std::atomic_uint m_u32State; }; #include "VeThread.inl"
typedef bool (*CameraCallback)(void* buffer, size_t bufferSize, void* userData); typedef void* (*InitCameraConnectC)(void* cameraCallback, int cameraId, void* userData); typedef void (*CloseCameraConnectC)(void**); typedef double (*GetCameraPropertyC)(void* camera, int propIdx); typedef void (*SetCameraPropertyC)(void* camera, int propIdx, double value); typedef void (*ApplyCameraPropertiesC)(void** camera); extern "C" { void* initCameraConnectC(void* cameraCallback, int cameraId, void* userData); void closeCameraConnectC(void**); double getCameraPropertyC(void* camera, int propIdx); void setCameraPropertyC(void* camera, int propIdx, double value); void applyCameraPropertiesC(void** camera); }
/** * Copyright (c) 2021 Darius Rückert * Licensed under the MIT License. * See LICENSE file for more information. */ #pragma once #include "saiga/config.h" #include "saiga/core/util/assert.h" #include "vulkan/vulkan.hpp" #ifdef SAIGA_ASSERTS # define CHECK_VK(_f) SAIGA_ASSERT((_f) == vk::Result::eSuccess) #else # define CHECK_VK(_f) (_f) #endif #ifndef SAIGA_USE_VULKAN # error Saiga was build without Vulkan. #endif #define SAIGA_VULKAN_INCLUDED
// init: The initial user-level program #include "types.h" #include "stat.h" #include "user.h" #include "fcontrol.h" char *sh_args[] = { "sh", 0 }; int main(void) { int pid, wpid; if(open("console", O_RDWR) < 0){ mknod("console", 1, 1); open("console", O_RDWR); } dup(0); // stdout dup(0); // stderr for(;;){ printf(1, "init: starting sh\n"); pid = fork(); if(pid < 0){ printf(1, "init: fork failed\n"); exit(); } if(pid == 0){ exec("sh", sh_args); printf(1, "init: exec sh failed\n"); exit(); } while((wpid=wait()) >= 0 && wpid != pid) printf(1, "zombie!\n"); } }
#define ASCIIOFFSET 0x20 //6 bytes wide //Each byte is 8 pixels tall #define fontSIZE 768 void putch(char ch);
// Copyright (c) 2014-2015 The Flowercoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef SRC_MASTERNODECONFIG_H_ #define SRC_MASTERNODECONFIG_H_ #include <string> #include <vector> #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> class CMasternodeConfig; extern CMasternodeConfig masternodeConfig; class CMasternodeConfig { public: class CMasternodeEntry { private: std::string alias; std::string ip; std::string privKey; std::string txHash; std::string outputIndex; public: CMasternodeEntry(std::string alias, std::string ip, std::string privKey, std::string txHash, std::string outputIndex) { this->alias = alias; this->ip = ip; this->privKey = privKey; this->txHash = txHash; this->outputIndex = outputIndex; } const std::string& getAlias() const { return alias; } void setAlias(const std::string& alias) { this->alias = alias; } const std::string& getOutputIndex() const { return outputIndex; } void setOutputIndex(const std::string& outputIndex) { this->outputIndex = outputIndex; } const std::string& getPrivKey() const { return privKey; } void setPrivKey(const std::string& privKey) { this->privKey = privKey; } const std::string& getTxHash() const { return txHash; } void setTxHash(const std::string& txHash) { this->txHash = txHash; } const std::string& getIp() const { return ip; } void setIp(const std::string& ip) { this->ip = ip; } }; CMasternodeConfig() { entries = std::vector<CMasternodeEntry>(); } void clear(); bool read(std::string& strErr); void add(std::string alias, std::string ip, std::string privKey, std::string txHash, std::string outputIndex); std::vector<CMasternodeEntry>& getEntries() { return entries; } int getCount() { int c = -1; BOOST_FOREACH(CMasternodeEntry e, entries) { if(e.getAlias() != "") c++; } return c; } private: std::vector<CMasternodeEntry> entries; }; #endif /* SRC_MASTERNODECONFIG_H_ */
/* * types.h typedefs * * Copyright © 1995, 1996 Jarno Seppänen; see 3MU.c for licensing info. */ #ifndef TYPES_H #define TYPES_H 1 typedef unsigned char * STRPTR; typedef short BOOL; #endif /* TYPES_H */
// // HomeContainerModule.h // MGModuleExample // // Created by waiwai he on 2016/12/15. // Copyright © 2016年 MaigcGird. All rights reserved. // #import <Foundation/Foundation.h> @interface HomeContainerModule : MGBaseModule @end
// // SectionPage.xaml.h // Déclaration de la classe SectionPage // #pragma once #include "SectionPage.g.h" namespace Reymenta_OSC_Controller { /// <summary> /// Page affichant une vue d'ensemble d'un groupe, ainsi qu'un aperçu des éléments /// qu'il contient. /// </summary> [Windows::UI::Xaml::Data::Bindable] public ref class SectionPage sealed { public: SectionPage(); /// <summary> /// Cela peut être remplacé par un modèle d'affichage fortement typé. /// </summary> property Windows::Foundation::Collections::IObservableMap<Platform::String^, Platform::Object^>^ DefaultViewModel { Windows::Foundation::Collections::IObservableMap<Platform::String^, Platform::Object^>^ get(); } /// <summary> /// NavigationHelper est utilisé sur chaque page pour faciliter la navigation et /// la gestion de la durée de vie des processus /// </summary> property Reymenta_OSC_Controller::Common::NavigationHelper^ NavigationHelper { Reymenta_OSC_Controller::Common::NavigationHelper^ get(); } protected: virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override; virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override; private: void LoadState(Platform::Object^ sender, Reymenta_OSC_Controller::Common::LoadStateEventArgs^ e); void ItemView_ItemClick(Platform::Object^ sender, Windows::UI::Xaml::Controls::ItemClickEventArgs^ e); static Windows::UI::Xaml::DependencyProperty^ _defaultViewModelProperty; static Windows::UI::Xaml::DependencyProperty^ _navigationHelperProperty; }; }
#define NPROC 64 // maximum number of processes #define KSTACKSIZE 4096 // size of per-process kernel stack #define NCPU 8 // maximum number of CPUs #define NOFILE 16 // open files per process #define NFILE 100 // open files per system #define NINODE 50 // maximum number of active i-nodes #define NDEV 10 // maximum major device number #define ROOTDEV 1 // device number of file system root disk #define MAXARG 32 // max exec arguments #define MAXOPBLOCKS 10 // max # of blocks any FS op writes #define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log #define NBUF (MAXOPBLOCKS*3) // size of disk block cache
/* Author: James Connor (jymbo@cromulence.co) Copyright (c) 2014 Cromulence LLC 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 <libcgc.h> #include <stdarg.h> #include <stdlib.h> #include <stdint.h> #include <mymath.h> #include "service.h" #include "llist.h" psListNode get_last_element_s(psList thisList){ psListNode thisNode = NULL; psListNode tempNode = NULL; thisNode = thisList->listRoot; while (thisNode != NULL){ tempNode = thisNode; thisNode = thisNode->next; } return tempNode; } //returns NULL if no elements pdListNode get_last_element_d(pdList thisList){ pdListNode thisNode = NULL; pdListNode tempNode = NULL; thisNode = thisList->listRoot; while (thisNode != NULL){ tempNode = thisNode; thisNode = thisNode->next; } return tempNode; } psList create_single_list(){ psList thisList = NULL; if ( allocate( sizeof(sList), 0, (void**)&thisList ) !=0 ){ puts("\n**Allocate returned an error.\n"); _terminate(1); } bzero(thisList, sizeof(sList)); thisList->listRoot = NULL; thisList->count = 0; return thisList; } //create double linked list pdList create_double_list(){ pdList thisList = NULL; if ( allocate( sizeof(dList), 0, (void**)&thisList ) !=0 ){ puts("\n**Allocate returned an error.\n"); _terminate(1); } bzero(thisList, sizeof(dList)); thisList->listRoot = NULL; thisList->count = 0; return thisList; } //if prev is null, insert as first node. if prev is last append pdListNode insert_double_list_node(pdList thisList, pdListNode prevNode){ pdListNode newNode = NULL; //allocate a node if ( allocate( sizeof(dListNode), 0, (void**)&newNode ) != 0 ){ puts("\n**Allocate returned an error.\n"); _terminate(1); } bzero(newNode, sizeof(dListNode)); //cases are //1) newlist insert at listroot, new->next is null, new->prev is null, listroot is new //2) existing insert at listroot, new->next is listroot, new->prev is null, listroot is new, new->next->prev is new //3) existing insert after prevNode where prevNode is not last node, new->next is prevNode->next, new-prev is prevNode, new->prev->next is new, new->next->prev is new //4) existing insert after prevNode where prevNode is last node, new->prev is prevNode, new->next is NULL, new->prev->next is new //case 1 & 2 if (prevNode == NULL){ newNode->next = thisList->listRoot; thisList->listRoot = newNode; //case 3 & 4 } else { newNode->next = prevNode->next; } //prevNode is either NULL or prevNode newNode->prev = prevNode; //if there is a next node, set next->prev to new if (newNode->next != NULL){ newNode->next->prev = newNode; } //if there is a prev node, set prev->next to new if (newNode->prev != NULL){ newNode->prev->next = newNode; } thisList->count++; return newNode; } //returns pointer to prevNode, or null if first node is deleted pdListNode delete_double_list_node(pdList thisList, pdListNode deletedNode){ //empty list pdListNode retNode = NULL; if ( (deletedNode == NULL) || (thisList->count == 0) ){ puts("**Cannot delete and empty list."); return NULL; } //cases are: //1) delete first element in 1 element list, resulting in empty list // listRoot = NULL, deallocate node //2) delete first element in >1 element list. // listRoot = deletedNode->next, deletedNode->next->prev = NULL, deallocate node //3) delete nth element in list where n+1 exists // deletedNode->prev->next = deletedNode->next, deletedNode->next->prev = deletedNode->prev, deallocate node //4) delete nth element in list where n is last element // deletedNode->prev->next = NULL, deallocate node //case 1 & 2 //deletedNode->prev == NULL if (deletedNode == thisList->listRoot){ thisList->listRoot = deletedNode->next; //case 3 & 4 }else { //not first, there must be a prev, so point it to next, which may be NULL deletedNode->prev->next = deletedNode->next; } // if there is a next, point it to prev, which may be NULL if (deletedNode->next != NULL){ deletedNode->next->prev = deletedNode->prev; } retNode = deletedNode->prev; deallocate(deletedNode, sizeof(dListNode)); thisList->count--; return retNode; } // if prevNode is NULL insert at begining, else insert after prevNode // returns pointer to inserted node psListNode insert_single_list_node(psList thisList, psListNode prevNode){ psListNode newNode = NULL; psListNode tempNode = NULL; if ( allocate( sizeof(sListNode), 0, (void**)&newNode ) != 0 ){ puts("\n**Allocate returned an error.\n"); _terminate(1); } bzero(newNode, sizeof(sListNode)); //cases are //1) newlist insert at listroot, new->next is null, listroot is new //2) existing insert at listroot, new->next is listroot, listroot is new //3) existing insert after prevNode where prevNode is not last node, new->next is prevNode->next, prevNode->next is new //4) existing insert after prevNode where prevNode is last node, new->next is NULL, prev->next is new //case 1 & 2 if (prevNode == NULL){ newNode->next = thisList->listRoot; thisList->listRoot = newNode; //case 3 & 4 }else{ newNode->next = prevNode->next; prevNode->next = newNode; } thisList->count++; return newNode; }
#pragma once #include <memory> #include "Describer.h" class DescriberFactory { public: DescriberFactory(Describer* describer = nullptr); DescriberFactory(std::shared_ptr<Describer> describer); virtual ~DescriberFactory(void); virtual Describer* getDescriber(); private: std::shared_ptr<Describer> describerPrototype; };
#pragma once #include "shim.h" class Ws281xEffectColorFade : public Ws281xEffect { public: Ws281xEffectColorFade(Ws281xString&, u8 fadeSpeed, u8 fadeStep); void refresh(); private: u8 fadeChannel(u8 curChannel, u8 targetChannel); Ws281xString& pixels_; u8 fadeSpeed_; u8 fadeStep_; u8 fadeCur_; Color curColor_; Color targetColor_; };
/* $Id$ */ #include "apr.h" #include "apr_lib.h" #if APR_HAVE_STDIO_H #include <stdio.h> #endif #if APR_HAVE_STRING_H #include <string.h> #endif /* A bunch of functions in util.c scan strings looking for certain characters. * To make that more efficient we encode a lookup table. */ #define T_ESCAPE_SHELL_CMD (0x01) #define T_ESCAPE_PATH_SEGMENT (0x02) #define T_OS_ESCAPE_PATH (0x04) #define T_HTTP_TOKEN_STOP (0x08) int main(int argc, char *argv[]) { unsigned c; unsigned char flags; printf("/* this file is automatically generated by gen_test_char, " "do not edit */\n" "#define T_ESCAPE_SHELL_CMD (%u)\n" "#define T_ESCAPE_PATH_SEGMENT (%u)\n" "#define T_OS_ESCAPE_PATH (%u)\n" "#define T_HTTP_TOKEN_STOP (%u)\n" "\n" "static const unsigned char test_char_table[256] = {\n" " 0,", T_ESCAPE_SHELL_CMD, T_ESCAPE_PATH_SEGMENT, T_OS_ESCAPE_PATH, T_HTTP_TOKEN_STOP); /* we explicitly dealt with NUL above * in case some strchr() do bogosity with it */ for (c = 1; c < 256; ++c) { flags = 0; if (c % 20 == 0) printf("\n "); /* escape_shell_cmd */ #if defined(WIN32) || defined(OS2) /* Win32/OS2 have many of the same vulnerable characters * as Unix sh, plus the carriage return and percent char. * The proper escaping of these characters varies from unix * since Win32/OS2 use carets or doubled-double quotes, * and neither lf nor cr can be escaped. We escape unix * specific as well, to assure that cross-compiled unix * applications behave similiarly when invoked on win32/os2. * * Rem please keep in-sync with apr's list in win32/filesys.c */ if (strchr("&;`'\"|*?~<>^()[]{}$\\\n\r%", c)) { flags |= T_ESCAPE_SHELL_CMD; } #else if (strchr("&;`'\"|*?~<>^()[]{}$\\\n", c)) { flags |= T_ESCAPE_SHELL_CMD; } #endif if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=~", c)) { flags |= T_ESCAPE_PATH_SEGMENT; } if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=/~", c)) { flags |= T_OS_ESCAPE_PATH; } /* these are the "tspecials" from RFC2068 */ if (apr_iscntrl(c) || strchr(" \t()<>@,;:\\/[]?={}", c)) { flags |= T_HTTP_TOKEN_STOP; } printf("%u%c", flags, (c < 255) ? ',' : ' '); } printf("\n};\n"); return 0; }
// // Copyright (c) 2008-2014 the Urho3D project. // // 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 "Hash.h" namespace Urho3D { /// %Pair template class. template <class T, class U> class Pair { public: /// Construct undefined. Pair() { } /// Construct with values. Pair(const T& first, const U& second) : first_(first), second_(second) { } /// Test for equality with another pair. bool operator == (const Pair<T, U>& rhs) const { return first_ == rhs.first_ && second_ == rhs.second_; } /// Test for inequality with another pair. bool operator != (const Pair<T, U>& rhs) const { return first_ != rhs.first_ || second_ != rhs.second_; } /// Test for less than with another pair. bool operator < (const Pair<T, U>& rhs) const { if (first_ < rhs.first_) return true; if (first_ != rhs.first_) return false; return second_ < rhs.second_; } /// Test for greater than with another pair. bool operator > (const Pair<T, U>& rhs) const { if (first_ > rhs.first_) return true; if (first_ != rhs.first_) return false; return second_ > rhs.second_; } /// Return hash value for HashSet & HashMap. unsigned ToHash() const { return (MakeHash(first_) & 0xffff) | (MakeHash(second_) << 16); } /// First value. T first_; /// Second value. U second_; }; /// Construct a pair. template <class T, class U> Pair<T, U> MakePair(const T& first, const U& second) { return Pair<T, U>(first, second); } }
#ifndef QUARTET_H #define QUARTET_H #include <stdint.h> #include "platform.h" #include "processing_element.h" // The quartet access data structure just wraps the constituent processing elements. typedef struct quartet { // Substructures. processing_element_t processing_elements[4]; // Address space. size_t num_address_space_words; } quartet_t; // Initialization. int initialize_quartet(quartet_t *quartet, volatile uint32_t *quartet_base_address, platform_t *platform); #endif
// // MainMenuViewController.h // Supinfo-B2-Dev // // Created by Adrien Brault on 11/06/11. // Copyright 2011 Adrien Brault. All rights reserved. // #import <Cocoa/Cocoa.h> @class GridViewController; @interface MainMenuViewController : NSViewController { GridViewController *_gridVC; NSTextField *_resultLabel; NSView *_menuView; } @property (assign) IBOutlet NSTextField *resultLabel; @property (assign) IBOutlet NSView *menuView; - (IBAction)startNewGame:(id)sender; - (void)gameEndedWinning:(BOOL)flag score:(NSInteger)score; @end
#ifndef ENCODE_H #define ENCODE_H #include <string.h> #include <math.h> #include "heap.h" #include "bitmask.h" /* Cria o tipo abstrato 'encode' onde a struct contém um buffer com os bytes do arquivo que será comprimido, o tamanho do arquivo (em bytes) e a contagem da frequência dos bytes. */ typedef struct encode { unsigned char* buffer; int size; int frequency[256]; } encode; /* Cria um novo 'encode', criando um buffer nulo, zerando a frequência dos bytes e o tamanho do arquivo. Retorna um ponteiro para o novo encode. */ encode* new_encode(); /* Lê um arquivo e armazena todos os seus bytes em um buffer na struct 'encode'. */ void picking_bytes(encode* archive, FILE* file); /* Conta a frequência dos bytes no buffer. */ void count_frequency(encode* archive); /* Recebe um array de inteiros com a frequência de todos os caracteres da entrada, e retorna a árvore de huffman montada. Utiliza uma min_heap para a montagem. */ huffman_tree* build_huffman_tree(int* freq); /* Mapeia a nova representação de um byte do arquivo, usando a árvore de huffman. */ void trace_path(huffman_tree* root, huffman_tree* first,int item, int position, int* bpb, unsigned char* buffer); /* Usando trace_path, mapeia a nova representação de todos os bytes do arquivo. */ void byte_maping(int* freq, huffman_tree* root, int* bpb, unsigned char** buffer); /* Retorna a quantidade final de bits que o arquivo-saída deve possuir. */ int sum(int* bpb, int* freq); /* Gera o cabeçalho do arquivo-final comprimido. */ unsigned char* make_header(int trash, int size_nodes, unsigned char* nodes); /* Gera o arquivo-final comprimido. */ void create_final_file(int ffs,encode* archive,unsigned char* header,int sn,unsigned char** map,int* bpb); #endif
/** * Swaggy Jenkins * Jenkins API clients generated from Swagger / Open API specification * * The version of the OpenAPI document: 1.1.2-pre.0 * Contact: blah@cliffano.com * * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0. * https://openapi-generator.tech * Do not edit the class manually. */ /* * InputStepImpl.h * * */ #ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_InputStepImpl_H_ #define ORG_OPENAPITOOLS_CLIENT_MODEL_InputStepImpl_H_ #include "ModelBase.h" #include <cpprest/details/basic_types.h> #include "model/InputStepImpllinks.h" #include <vector> #include "model/StringParameterDefinition.h" namespace org { namespace openapitools { namespace client { namespace model { /// <summary> /// /// </summary> class InputStepImpl : public ModelBase { public: InputStepImpl(); virtual ~InputStepImpl(); ///////////////////////////////////////////// /// ModelBase overrides void validate() override; web::json::value toJson() const override; bool fromJson(const web::json::value& json) override; void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override; bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override; ///////////////////////////////////////////// /// InputStepImpl members /// <summary> /// /// </summary> utility::string_t getClass() const; bool r_classIsSet() const; void unset_class(); void setClass(const utility::string_t& value); /// <summary> /// /// </summary> std::shared_ptr<InputStepImpllinks> getLinks() const; bool linksIsSet() const; void unset_links(); void setLinks(const std::shared_ptr<InputStepImpllinks>& value); /// <summary> /// /// </summary> utility::string_t getId() const; bool idIsSet() const; void unsetId(); void setId(const utility::string_t& value); /// <summary> /// /// </summary> utility::string_t getMessage() const; bool messageIsSet() const; void unsetMessage(); void setMessage(const utility::string_t& value); /// <summary> /// /// </summary> utility::string_t getOk() const; bool okIsSet() const; void unsetOk(); void setOk(const utility::string_t& value); /// <summary> /// /// </summary> std::vector<std::shared_ptr<StringParameterDefinition>>& getParameters(); bool parametersIsSet() const; void unsetParameters(); void setParameters(const std::vector<std::shared_ptr<StringParameterDefinition>>& value); /// <summary> /// /// </summary> utility::string_t getSubmitter() const; bool submitterIsSet() const; void unsetSubmitter(); void setSubmitter(const utility::string_t& value); protected: utility::string_t m__class; bool m__classIsSet; std::shared_ptr<InputStepImpllinks> m__links; bool m__linksIsSet; utility::string_t m_Id; bool m_IdIsSet; utility::string_t m_Message; bool m_MessageIsSet; utility::string_t m_Ok; bool m_OkIsSet; std::vector<std::shared_ptr<StringParameterDefinition>> m_Parameters; bool m_ParametersIsSet; utility::string_t m_Submitter; bool m_SubmitterIsSet; }; } } } } #endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_InputStepImpl_H_ */
#include <simple2d.h> void render() { S2D_DrawTriangle( 320, 50, 1, 0, 0, 1, 540, 430, 0, 1, 0, 1, 100, 430, 0, 0, 1, 1 ); } int main() { S2D_Window *window = S2D_CreateWindow( "Hello Triangle", 640, 480, NULL, render, 0 ); S2D_Show(window); return 0; }
// GENERATED FILE: Do not edit directly #define OT_TRACER_VERSION @"0.5.0"
/* * Copyright (C) 2017 - 2020 Christoph Muellner * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <sys/ioctl.h> #include <debuglog.h> #include <linux/i2c-dev.h> #include "helpers.h" #include "hali2c.h" struct hali2c_kernel_dev { /* Embed halgpio device */ struct hali2c_dev device; /* I2C related state. */ char *i2c_device; /* I2C device (e.g. "/dev/i2c-0") */ int i2c_addr; /* I2C slave addr (e.g. 0x20) */ int i2c_fd; /* File descriptor to I2C device */ }; /* * Parse the information encoded in a string with * the following pattern: "<i2c_device>:<i2c_addr>" */ static int hali2c_kernel_parse(struct hali2c_kernel_dev *dev, char* config) { char *p = config; char *endptr; /* Advance p after the first ':' in * the pattern "<i2c_device>:<i2c_addr>" */ p = strchr(p, ':'); if (!p) { Log2(PCSC_LOG_ERROR, "No I2C slave address defined in '%s'", config); return -EINVAL; } dev->i2c_device = strndup(config, p - config); Log2(PCSC_LOG_DEBUG, "i2c_device: %s", dev->i2c_device); p++; /* Parse i2c_addr from the pattern "<i2c_addr>" */ errno = 0; dev->i2c_addr = (int)strtol(p, &endptr, 0); if (errno != 0 || p == endptr) { Log2(PCSC_LOG_ERROR, "Parser error: invalid I2C address in '%s'", p); return -EINVAL; } Log2(PCSC_LOG_DEBUG, "i2c_addr: %d", dev->i2c_addr); return 0; } static int hali2c_kernel_open(struct hali2c_kernel_dev *dev) { int ret; /* Open I2C device */ dev->i2c_fd = open(dev->i2c_device, O_RDWR); if (dev->i2c_fd < 0) { Log3(PCSC_LOG_ERROR, "Could not open I2C device %s (%d)", dev->i2c_device, dev->i2c_fd); return dev->i2c_fd; } Log3(PCSC_LOG_DEBUG, "I2C fd (%s): %d", dev->i2c_device, dev->i2c_fd); /* Set the slave address */ ret = ioctl(dev->i2c_fd, I2C_SLAVE, dev->i2c_addr); if (ret < 0) { Log2(PCSC_LOG_ERROR, "Could not set I2C address: %d", dev->i2c_addr); close(dev->i2c_fd); dev->i2c_fd = -1; return -errno; } return 0; } static int hali2c_kernel_read(struct hali2c_dev* device, unsigned char* buf, size_t len) { struct hali2c_kernel_dev *dev = container_of(device, struct hali2c_kernel_dev, device); ssize_t sret = read(dev->i2c_fd, buf, len); if (sret < 0) return -errno; return (int)sret; } static int hali2c_kernel_write(struct hali2c_dev* device, const unsigned char* buf, size_t len) { struct hali2c_kernel_dev *dev = container_of(device, struct hali2c_kernel_dev, device); ssize_t sret = write(dev->i2c_fd, buf, len); if (sret < 0) return -errno; return (int)sret; } void hali2c_kernel_close(struct hali2c_dev* device) { struct hali2c_kernel_dev *dev = container_of(device, struct hali2c_kernel_dev, device); if (dev->i2c_fd >= 0) { close(dev->i2c_fd); dev->i2c_fd = -1; } } struct hali2c_dev* hali2c_open_kernel(char* config) { int ret; struct hali2c_kernel_dev *dev; if (!config) return NULL; Log2(PCSC_LOG_DEBUG, "Trying to create device with config: '%s'", config); dev = calloc(1, sizeof(*dev)); if (!dev) { Log1(PCSC_LOG_ERROR, "Not enough memory!"); return NULL; } /* Parse device string from reader.conf */ ret = hali2c_kernel_parse(dev, config); if (ret) { Log1(PCSC_LOG_ERROR, "device string can't be parsed!"); free(dev); return NULL; } ret = hali2c_kernel_open(dev); if (ret) { Log1(PCSC_LOG_ERROR, "device can't be opened!"); free(dev); return NULL; } dev->device.read = hali2c_kernel_read; dev->device.write = hali2c_kernel_write; dev->device.close = hali2c_kernel_close; return &dev->device; }
// // DijkstraAlgorithm.h // DataStructuresAndAlgorithms // // Created by Alexey Patosin on 03/03/15. // Copyright (c) 2015 TestOrg. All rights reserved. // #import <Foundation/Foundation.h> @interface WeightedNode : NSObject @property (nonatomic) NSUInteger distance; @property (nonatomic, strong) NSString *name; @property (nonatomic, strong) NSMutableSet *connections; - (instancetype)initWithName:(NSString *)name; - (void)addConnectionToNode:(WeightedNode *)node value:(NSUInteger)value; @end @interface WeightedConnection : NSObject @property (nonatomic, strong) NSMutableSet *nodes; @property (nonatomic) NSUInteger value; // cannot be less than zero for Dijkstra's Algorithm - (instancetype)initWithValue:(NSUInteger)value node1:(WeightedNode *)node1 node2:(WeightedNode *)node2; @end @interface DijkstraAlgorithm : NSObject + (NSUInteger)shortestDistanceBetweenNodes:(WeightedNode *)node1 node2:(WeightedNode *)node2; @end
// // UILabel+ScottExtension.h // QQLive // // Created by Scott_Mr on 2016/11/22. // Copyright © 2016年 Scott. All rights reserved. // #import <UIKit/UIKit.h> @interface UILabel (ScottExtension) /// 创建文本标签 /// /// @param text 文本 /// @param fontSize 字体大小 /// @param color 颜色 /// /// @return UILabel + (instancetype)scott_labelWithText:(NSString *)text fontSize:(CGFloat)fontSize color:(UIColor *)color; @end
// // BMTestController.h // Scorched // // Created by Mark Kim on 4/3/13. // Copyright (c) 2013 Mark Kim. All rights reserved. // #import "BMController.h" @class BMTestView; @class BMTestTouchView; @interface BMTestController : BMController <BMTestTouchViewDelegate> @property (nonatomic, retain) CCMenuItemFont *backMenuButton; @property (nonatomic, retain) BMTestView *testView; @property (nonatomic, retain) BMTestTouchView *testTouchView; @end
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <UIKit/UITextView.h> @interface UITextView (UITextViewPrintFormatter) - (void)drawRect:(struct CGRect)arg1 forViewPrintFormatter:(id)arg2; - (Class)_printFormatterClass; @end
/* * 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-Protocol.h" @protocol OADClient <NSObject> - (struct CGRect)bounds; - (_Bool)hasBounds; @end
/***************************************************** Termio.c for 9S12C32/128 family *****************************************************/ #include <termio.h> #include "derivative.h" /* derivative-specific definitions */ char TERMIO_GetChar(void) { /* receives character from the terminal channel */ while (!SCISR1_RDRF){ /* wait for input char */ }; return SCIDRL; } void TERMIO_PutChar(char ch) { /* sends a character to the terminal channel */ while (!SCISR1_TDRE) { /* wait for output buffer empty */ }; SCIDRL = ch; } #define CRYSTAL_FREQ (8000000UL) // External Crystal used #define BUS_FREQ (CRYSTAL_FREQ/2) // Bus freq. derived from external Crystal #define BAUD_RATE (19200UL) // Desired serial baud rate #define BAUDDIVIDER (BUS_FREQ/(16*BAUD_RATE)) void TERMIO_Init(void) { /* initializes the communication channel */ SCIBD = BAUDDIVIDER; /* set baud rate */ SCICR2_TE = 1; /* Enable Tx */ SCICR2_RE = 1; /* Enable Rx */ }
/** @file phrasepostlist.h * @brief Return docs containing terms forming a particular phrase. * * Copyright (C) 2006,2015,2017 Olly Betts * Copyright (C) 2009 Lemur Consulting Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef XAPIAN_INCLUDED_PHRASEPOSTLIST_H #define XAPIAN_INCLUDED_PHRASEPOSTLIST_H #include "xapian/matcher/selectpostlist.h" #include <vector> class PostListTree; /** Postlist which matches a phrase using positional information. * * PhrasePostList only returns a posting for documents contains * all the terms (this part is implemented using an AndPostList) and * additionally the terms occur somewhere in the document in the order given * and within a specified number of term positions. * * The weight of a posting is the sum of the weights of the * sub-postings (just like an AndPostList). */ class PhrasePostList : public SelectPostList { Xapian::termpos window; std::vector<PostList*> terms; PositionList ** poslists; /// Start reading from the i-th position list. void start_position_list(unsigned i); /// Test if the current document contains the terms as a phrase. bool test_doc(); public: PhrasePostList(PostList *source_, Xapian::termpos window_, const std::vector<PostList*>::const_iterator &terms_begin, const std::vector<PostList*>::const_iterator &terms_end, PostListTree* pltree_); ~PhrasePostList(); Xapian::termcount get_wdf() const; Xapian::doccount get_termfreq_est() const; TermFreqs get_termfreq_est_using_stats( const Xapian::Weight::Internal & stats) const; std::string get_description() const; }; #endif
// // DJFFooListViewController.h // LoveWalking // // Created by 佃杰峰 on 2017/5/5. // Copyright © 2017年 佃杰峰. All rights reserved. // #import "DJFBaseTableViewController.h" #import "DJFFoodInfoModel.h" @interface DJFFooListViewController : DJFBaseTableViewController /** * <#名称#> */ @property(nonatomic,strong)NSString *typeId; @end
// // Worker.h // UEDemo // // Created by nsc on 14-5-18. // Copyright (c) 2014年 reactiveCocoa. All rights reserved. // #import <Foundation/Foundation.h> @interface Worker : NSObject @property (nonatomic) NSString *name; @property (nonatomic) NSString *workID; @property (nonatomic) NSArray *skills; @property (nonatomic) NSString *prices; @property (nonatomic) NSString *headerImageUrl; @property (nonatomic) NSNumber *selected; //bool 是否选中 -(NSString*)skillsString; @end
/****************************************************************************** * @file atomic.c * @author Muggle Wei * @email mugglewei@gmail.com * @date 2021-06-15 * @copyright Copyright 2021 Muggle Wei * @license MIT License * @brief mugglec atomic *****************************************************************************/ #include "atomic.h" #if MUGGLE_PLATFORM_WINDOWS int muggle_win_atomic_cmp_exch32(muggle_atomic_int32 *dst, muggle_atomic_int32 *expected, muggle_atomic_int32 desired) { muggle_atomic_int32 ret = InterlockedCompareExchange(dst, desired, *expected); if (ret == *expected) { return 1; } *expected = ret; return 0; } int muggle_win_atomic_cmp_exch64(muggle_atomic_int64 *dst, muggle_atomic_int64 *expected, muggle_atomic_int64 desired) { muggle_atomic_int64 ret = InterlockedCompareExchange64(dst, desired, *expected); if (ret == *expected) { return 1; } *expected = ret; return 0; } #endif
#ifndef _ESTRUTURA #define _ESTRUTURA #include <stdio.h> #include <string.h> #include <stdlib.h> struct variavel { char *nome; char *tipo; int endereco; struct variavel *next; }; struct instrucao { int endereco; char *instrucao; struct instrucao *next; }; struct ifAddr { int jz; struct ifAddr *next; }; struct whileAddr { int jump; int jz; struct whileAddr *next; }; struct variavel* insertVariavel(struct variavel *variavel, struct variavel *listaVariaveis); int existeVariavel(char *variavel, struct variavel *listaVariaveis); int enderecoVariavel(char *variavel, struct variavel *listaVariaveis); char* tipoVariavel(char *variavel, struct variavel *listaVariaveis); struct instrucao* insertInstrucao(int endereco, char *instrucao, struct instrucao *listaInstrucoes); struct ifAddr* pushIfAddr(int endereco, struct ifAddr *pilhaIfAddr); struct ifAddr* popIfAddr(struct ifAddr *pilhaIfAddr); struct whileAddr* pushWhileAddr(int endereco, int whileAddr, struct whileAddr *pilhaWhileAddr); struct whileAddr* popWhileAddr(struct whileAddr *pilhaWhileAddr); void ifJump(int endereco, struct ifAddr *pilhaIfAddr, struct instrucao *pilhaInstrucoes); void elseJump(int endereco, struct ifAddr *pilhaIfAddr, struct instrucao *pilhaInstrucoes); int whileJump(int endereco, struct whileAddr *pilhaWhileAddr, struct instrucao *pilhaInstrucoes); #endif
// // LWAppDelegate.h // SideMenu // // Created by Lukas Welte on 26.05.14. // Copyright (c) 2014 Lukas Welte. All rights reserved. // #import <UIKit/UIKit.h> @interface LWAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: android/libcore/luni/src/main/java/java/net/SocketTimeoutException.java // #include "../../J2ObjC_header.h" #pragma push_macro("INCLUDE_ALL_JavaNetSocketTimeoutException") #ifdef RESTRICT_JavaNetSocketTimeoutException #define INCLUDE_ALL_JavaNetSocketTimeoutException 0 #else #define INCLUDE_ALL_JavaNetSocketTimeoutException 1 #endif #undef RESTRICT_JavaNetSocketTimeoutException #pragma clang diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #if !defined (JavaNetSocketTimeoutException_) && (INCLUDE_ALL_JavaNetSocketTimeoutException || defined(INCLUDE_JavaNetSocketTimeoutException)) #define JavaNetSocketTimeoutException_ #define RESTRICT_JavaIoInterruptedIOException 1 #define INCLUDE_JavaIoInterruptedIOException 1 #include "../../java/io/InterruptedIOException.h" /*! @brief This exception is thrown when a timeout expired on a socket <code>read</code> or <code>accept</code> operation. */ @interface JavaNetSocketTimeoutException : JavaIoInterruptedIOException #pragma mark Public /*! @brief Constructs a new instance. */ - (instancetype)init; /*! @brief Constructs a new instance with the given detail message. */ - (instancetype)initWithNSString:(NSString *)detailMessage; /*! @brief Constructs a new instance with given detail message and cause. internal use only */ - (instancetype)initWithNSString:(NSString *)detailMessage withNSException:(NSException *)cause; /*! @brief Constructs a new instance with given cause. internal use only */ - (instancetype)initWithNSException:(NSException *)cause; @end J2OBJC_EMPTY_STATIC_INIT(JavaNetSocketTimeoutException) FOUNDATION_EXPORT void JavaNetSocketTimeoutException_init(JavaNetSocketTimeoutException *self); FOUNDATION_EXPORT JavaNetSocketTimeoutException *new_JavaNetSocketTimeoutException_init() NS_RETURNS_RETAINED; FOUNDATION_EXPORT JavaNetSocketTimeoutException *create_JavaNetSocketTimeoutException_init(); FOUNDATION_EXPORT void JavaNetSocketTimeoutException_initWithNSString_(JavaNetSocketTimeoutException *self, NSString *detailMessage); FOUNDATION_EXPORT JavaNetSocketTimeoutException *new_JavaNetSocketTimeoutException_initWithNSString_(NSString *detailMessage) NS_RETURNS_RETAINED; FOUNDATION_EXPORT JavaNetSocketTimeoutException *create_JavaNetSocketTimeoutException_initWithNSString_(NSString *detailMessage); FOUNDATION_EXPORT void JavaNetSocketTimeoutException_initWithNSException_(JavaNetSocketTimeoutException *self, NSException *cause); FOUNDATION_EXPORT JavaNetSocketTimeoutException *new_JavaNetSocketTimeoutException_initWithNSException_(NSException *cause) NS_RETURNS_RETAINED; FOUNDATION_EXPORT JavaNetSocketTimeoutException *create_JavaNetSocketTimeoutException_initWithNSException_(NSException *cause); FOUNDATION_EXPORT void JavaNetSocketTimeoutException_initWithNSString_withNSException_(JavaNetSocketTimeoutException *self, NSString *detailMessage, NSException *cause); FOUNDATION_EXPORT JavaNetSocketTimeoutException *new_JavaNetSocketTimeoutException_initWithNSString_withNSException_(NSString *detailMessage, NSException *cause) NS_RETURNS_RETAINED; FOUNDATION_EXPORT JavaNetSocketTimeoutException *create_JavaNetSocketTimeoutException_initWithNSString_withNSException_(NSString *detailMessage, NSException *cause); J2OBJC_TYPE_LITERAL_HEADER(JavaNetSocketTimeoutException) #endif #pragma clang diagnostic pop #pragma pop_macro("INCLUDE_ALL_JavaNetSocketTimeoutException")
// // NoneTranslucentNextViewController.h // RRNavigationBar // // Created by Shaw on 9/22/17. // Copyright © 2017 Shaw. All rights reserved. // #import <UIKit/UIKit.h> @interface NoneTranslucentNextViewController : UIViewController @end
#include <axl_sys/axl_sys_psx_Cond.h>
// // GJGCContactsCell.h // ZYChat // // Created by ZYVincent on 16/8/8. // Copyright © 2016年 ZYProSoft. All rights reserved. // #import <UIKit/UIKit.h> #import "GJGCContactsContentModel.h" @interface GJGCContactsBaseCell : UITableViewCell @property (nonatomic,strong)UIImageView *bottomLine; - (void)setContentModel:(GJGCContactsContentModel *)contentModel; - (CGFloat)cellHeight; - (void)downloadImageWithConententModel:(GJGCContactsContentModel *)contentModel; @end
/* (c) Atinea Sp z o. o. * Stamp: nianio lang */ #include "c_rt_lib.h" #include "c_global_const.h" #include "singleton.h" #line 1 "singleton.nl" static ImmT *__const__f = NULL; ImmT singleton_priv0__const__sim(int __nr); ImmT singleton_priv0__const__sing(int __nr); ImmT singleton0sigleton_do_not_use_without_approval0ptr(int _num, ImmT *_tab){ c_rt_lib0func_num_args(_num, 1, "singleton0sigleton_do_not_use_without_approval"); return singleton0sigleton_do_not_use_without_approval(_tab[0]);} ImmT singleton0sigleton_do_not_use_without_approval(ImmT ___nl__0) { c_rt_lib0arg_val(___nl__0); #line 9 return ___nl__0; #line 9 c_rt_lib0clear(&___nl__0); #line 9 return NULL; } static ImmT ___const__[1]; static int ___const_init__ = 1; void singleton0__const__init(){ if(!___const_init__) nl_die(); ___const_init__ = 0; __const__f = &___const__[0]; for(int i=0;i<0;++i) ___const__[i] = NULL; c_rt_lib0register_const(___const__, 0); } ImmT singleton_priv0__const__sim(int __nr) { ImmT ret = NULL; c_rt_lib0copy(&ret, ___const__[__nr]); return ret; } ImmT singleton_priv0__const__sing(int __nr) { if(___const__[__nr+0]==NULL) { switch(__nr){ default: nl_die(); }} ImmT ret = NULL; c_rt_lib0copy(&ret, ___const__[__nr+0]); return ret; }
/* Copyright (c) 2005-2018 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* The original source for this example is Copyright (c) 1994-2008 John E. Stone All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * shade.h - This file contains declarations and definitions for the shader. * * $Id: shade.h,v 1.2 2007-02-22 17:54:16 Exp $ */ void reset_lights(void); void add_light(point_light *); color shader(ray *); color shade_reflection(ray *, vector *, vector *, flt); color shade_transmission(ray *, vector *, flt); flt shade_phong(ray * incident, vector * hit, vector * N, vector * L, flt specpower);
/* Created by "go tool cgo" - DO NOT EDIT. */ /* package _/home/abhinav/dev/pymosaic */ /* Start of preamble from import "C" comments. */ #line 3 "/home/abhinav/dev/pymosaic/pymosaic.go" #define Py_LIMITED_API #include <Python.h> int PyArg_ParseTuple_SISS(PyObject *, char **, int *, char **, char **); int PyArg_ParseTuple_S(PyObject *, char **); int PyArg_ParseTuple_SSS(PyObject *, char **, char **, char **); /* End of preamble from import "C" comments. */ /* Start of boilerplate cgo prologue. */ #ifndef GO_CGO_PROLOGUE_H #define GO_CGO_PROLOGUE_H typedef signed char GoInt8; typedef unsigned char GoUint8; typedef short GoInt16; typedef unsigned short GoUint16; typedef int GoInt32; typedef unsigned int GoUint32; typedef long long GoInt64; typedef unsigned long long GoUint64; typedef GoInt64 GoInt; typedef GoUint64 GoUint; typedef __SIZE_TYPE__ GoUintptr; typedef float GoFloat32; typedef double GoFloat64; typedef __complex float GoComplex64; typedef __complex double GoComplex128; // static assertion to make sure the file is being used on architecture // at least with matching size of GoInt. typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1]; typedef struct { char *p; GoInt n; } GoString; typedef void *GoMap; typedef void *GoChan; typedef struct { void *t; void *v; } GoInterface; typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; #endif /* End of boilerplate cgo prologue. */ #ifdef __cplusplus extern "C" { #endif extern PyObject* download(PyObject* p0, PyObject* p1); extern PyObject* analyze_images(PyObject* p0, PyObject* p1); extern PyObject* generate_mosaic(PyObject* p0, PyObject* p1); #ifdef __cplusplus } #endif
// // GroupSortData.h // GroupSortData // // Created by Jin Sasaki on 2017/01/29. // Copyright © 2017年 sasakky. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for GroupSortData. FOUNDATION_EXPORT double GroupSortDataVersionNumber; //! Project version string for GroupSortData. FOUNDATION_EXPORT const unsigned char GroupSortDataVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <GroupSortData/PublicHeader.h>
// // ATest.h // testPodsDemo // // Created by apple on 15/9/9. // Copyright (c) 2015年 app. All rights reserved. // #import <Foundation/Foundation.h> @interface ATest : NSObject + (void)testPrint; @end
// // ADFNativeAdViewsBinder.h // AdFalconSDK // // Created by Emad Jabareen on 12/29/14. // Copyright (c) 2014 Noqoush Mobile Media Group. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #define ADF_DATA_ID_SPONSORED 1 #define ADF_DATA_ID_DESC 2 #define ADF_DATA_ID_RATING 3 #define ADF_DATA_ID_LIKES 4 #define ADF_DATA_ID_DOWNLOADS 5 #define ADF_DATA_ID_PRICE 6 #define ADF_DATA_ID_SALEPRICE 7 #define ADF_DATA_ID_PHONE 8 #define ADF_DATA_ID_ADDRESS 9 #define ADF_DATA_ID_DESC2 10 #define ADF_DATA_ID_DISPLAYURL 11 #define ADF_DATA_ID_CTA 12 #define ADF_DATA_ID_VIEWS 13 @class ADFResponse; @class ADFNativeAssetBase; @interface ADFNativeAdBinder : NSObject @property (nonatomic) NSMutableDictionary *assetsDictionary; //@property(nonatomic, assign) CGSize sizeOfTemplate; //@property (nonatomic, assign) CGSize sizeOfMainAsset; //@property(nonatomic) UIButton * actionButton; //@property(nonatomic, assign) CGFloat maxLengthOfTitle; //@property(nonatomic, assign) CGFloat maxLengthOfDescription; //@property(nonatomic, assign) CGSize sizeOfIcon; //@property(nonatomic, assign) CGSize sizeOfStarRating; //@property(nonatomic, assign) CGSize sizeOfAction; @property (nonatomic) UIColor *starRatingEmptyColor; @property (nonatomic) UIColor *starRatingFillingColor; -(void) setAdChoicesView:(UIView*) imageView; -(void) setIconImageView:(UIImageView*) imageView; -(void) setIconImageView:(UIImageView*) imageView minSize:(CGSize) minSize; -(void) setTitleLabel:(UILabel*) label; -(void) setTitleLabel:(UILabel *)label maxLength:(CGFloat) maxLength; -(void) setMainAssetView:(UIView *) view; -(void) setMainAssetView:(UIView *) view minSize:(CGSize) minSize; -(void) setExtraDataView:(UIView *) view dataID:(NSInteger) dataID; -(void) setExtraDataView:(UIView *) view dataID:(NSInteger) dataID maxLength:(CGFloat) maxLength; -(void) setExtraDataLabel:(UILabel *) label dataID:(NSInteger) dataID maxLength:(CGFloat) maxLength; -(void) setExtraDataImageView:(UIImageView *) imageView dataID:(NSInteger) dataID minSize:(CGSize) minSize; -(void) isValidTemplate; -(ADFNativeAssetBase *) getViewWithKey:(NSString *) key; @end
/*============================================================================*/ /*! * @file TestDpSampleDiagnostic.h * * @brief Test cases for sample_diagnostic function * * Tests business as usual (BAU) operation of this function. * * Note that any further tests of this function would require integration testing * since it is dependent on other functions. * * @date 2017/10/16 * @author Aaron Hurst * */ /*============================================================================*/ #ifndef TESTDPSAMPLEDIAGNOSTIC_H_ #define TESTDPSAMPLEDIAGNOSTIC_H_ #include "TestCase.h" class TestDpSampleDiagnostic: public TestCase { private: protected: public: TestDpSampleDiagnostic(void); void run(void); void TU_SH_DpSampleDiagnostic_op(void); }; #endif /* TESTDPSAMPLEDIAGNOSTIC_H_ */
// 20 may 2015 #include "uipriv_windows.h" struct uiSlider { uiWindowsControl c; HWND hwnd; void (*onChanged)(uiSlider *, void *); void *onChangedData; }; uiWindowsDefineControlWithOnDestroy( uiSlider, // type name uiSliderType, // type function uiWindowsUnregisterWM_HSCROLLHandler(this->hwnd); // on destroy ) static BOOL onWM_HSCROLL(uiControl *c, HWND hwnd, WORD code, LRESULT *lResult) { uiSlider *s = uiSlider(c); (*(s->onChanged))(s, s->onChangedData); *lResult = 0; return TRUE; } // from http://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing #define sliderWidth 107 /* this is actually the shorter progress bar width, but Microsoft doesn't indicate a width */ #define sliderHeight 15 static void minimumSize(uiWindowsControl *c, uiWindowsSizing *d, intmax_t *width, intmax_t *height) { *width = uiWindowsDlgUnitsToX(sliderWidth, d->BaseX); *height = uiWindowsDlgUnitsToY(sliderHeight, d->BaseY); } static void defaultOnChanged(uiSlider *s, void *data) { // do nothing } intmax_t uiSliderValue(uiSlider *s) { return (intmax_t) SendMessageW(s->hwnd, TBM_GETPOS, 0, 0); } void uiSliderSetValue(uiSlider *s, intmax_t value) { // don't use TBM_SETPOSNOTIFY; that triggers an event SendMessageW(s->hwnd, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) value); } void uiSliderOnChanged(uiSlider *s, void (*f)(uiSlider *, void *), void *data) { s->onChanged = f; s->onChangedData = data; } uiSlider *uiNewSlider(intmax_t min, intmax_t max) { uiSlider *s; s = (uiSlider *) uiNewControl(uiSliderType()); s->hwnd = uiWindowsEnsureCreateControlHWND(0, TRACKBAR_CLASSW, L"", TBS_HORZ | TBS_TOOLTIPS | TBS_TRANSPARENTBKGND | WS_TABSTOP, hInstance, NULL, TRUE); uiWindowsRegisterWM_HSCROLLHandler(s->hwnd, onWM_HSCROLL, uiControl(s)); uiSliderOnChanged(s, defaultOnChanged, NULL); SendMessageW(s->hwnd, TBM_SETRANGEMIN, (WPARAM) TRUE, (LPARAM) min); SendMessageW(s->hwnd, TBM_SETRANGEMAX, (WPARAM) TRUE, (LPARAM) max); SendMessageW(s->hwnd, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) min); uiWindowsFinishNewControl(s, uiSlider); return s; }
/** @file rdrand.c This file is part of libsqrl. It is released under the MIT license. For more details, see the LICENSE file included with this package. **/ #include <stdint.h> /* From http://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide/ */ #include "rdrand.h" #include <string.h> #ifdef _WIN32 #define cpuid(in, out) __cpuid( out, in ) #else #define cpuid(in, out) \ asm("cpuid": "=a" (out[0]), \ "=b" (out[1]), \ "=c" (out[2]), \ "=d" (out[3]) : "a" (in)) #endif static bool rdrand_avail = false; static bool rdrand_tested = false; static /*inline*/ int __rdrand64(uint64_t *val) { uint64_t tmp; int ret; #ifdef _WIN32 tmp = 0; ret = 1; #else asm("rdrand %%rax;\n\ mov $1,%%edx;\n\ cmovae %%rax,%%rdx;\n\ mov %%edx,%1;\n\ mov %%rax, %0;":"=r"(tmp),"=r"(ret)::"%rax","%rdx"); #endif *val = tmp; return ret; } void rdrand64(uint64_t *val) { while (__rdrand64(val) == 0) ; } bool rdrand_available() { #ifdef _WIN32 // Not implemented for Windows yet... return false; #else if( !rdrand_tested ) { rdrand_avail = false; uint32_t tmp[4] = { -1 }; cpuid( 0, tmp ); if( !((memcmp( &tmp[1], "Genu", 4 ) == 0 ) && (memcmp( &tmp[3], "ineI", 4 ) == 0 ) && (memcmp( &tmp[2], "ntel", 4 ) == 0 ))) { //fprintf( stderr, "Not a recognized Intel CPU.\n" ); } else { cpuid( 1, tmp ); if( !( tmp[2] & 0x40000000 )) { //fprintf( stderr, "CPU does not support rdrand.\n" ); } else { //fprintf( stderr, "CPU supports rdrand.\n" ); rdrand_avail = true; } } rdrand_tested = true; } return rdrand_avail; #endif }
/* * pipe.c - Named Pipe support. */ #include <assert.h> #include <string.h> #include <stdlib.h> #include <siri/net/pipe.h> #include <siri/siri.h> #include <xpath/xpath.h> #include <logger/logger.h> #define PIPE_NAME_BUF_SZ XPATH_MAX /* * Return a name for the connection if successful or NULL in case of a failure. * * The returned value is malloced and should be freed. */ char * sirinet_pipe_name(uv_pipe_t * client) { size_t len = PIPE_NAME_BUF_SZ - 1; char * buffer = malloc(PIPE_NAME_BUF_SZ); if (buffer == NULL || uv_pipe_getsockname(client, buffer, &len)) { free(buffer); return NULL; } buffer[len] = '\0'; return buffer; } /* * Cleanup socket (pipe) file. (UNUSED) */ void sirinet_pipe_unlink(uv_pipe_t * client) { char * pipe_name = sirinet_pipe_name(client); if (pipe_name != NULL) { log_debug("Unlink named pipe: '%s'", pipe_name); uv_fs_t * req = malloc(sizeof(uv_fs_t)); if (req != NULL) { uv_fs_unlink(siri.loop, req, pipe_name, (uv_fs_cb) free); } free(pipe_name); } }
/* * Copyright (c) 2016-2017 Jonathan Glines * Jonathan Glines <jonathan@glines.net> * * 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 TTOY_TEST_TTOY_BOUNDING_BOX_H_ #define TTOY_TEST_TTOY_BOUNDING_BOX_H_ #include <check.h> Suite *ttoy_BoundingBox_test_suite(); #endif
/** * This header is generated by class-dump-z 0.2a. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. * * Source: (null) */ #import <XXUnknownSuperclass.h> // Unknown library @class AWSCognitoRecord; @interface AWSCognitoRecordTuple : XXUnknownSuperclass { AWSCognitoRecord* _localRecord; AWSCognitoRecord* _remoteRecord; } @property(readonly, assign, nonatomic) AWSCognitoRecord* localRecord; @property(readonly, assign, nonatomic) AWSCognitoRecord* remoteRecord; - (id)initWithLocalRecord:(id)localRecord remoteRecord:(id)record; - (void).cxx_destruct; @end
/* * 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 "NSPortDelegate-Protocol.h" @class NSThread; @interface AOSContext : NSObject <NSPortDelegate> { struct AOSAccount *_account; struct AOSTransactionC *_transaction; void *_callback; NSThread *_callbackThread; id _info; } + (id)contextWithAccount:(struct AOSAccount *)arg1 andTransaction:(struct AOSTransactionC *)arg2; - (void)_performCallback; - (id)_callbackThread; - (_Bool)scheduleCallback; - (id)info; - (void)setInfo:(id)arg1; - (struct AOSTransactionC *)transaction; - (void)setTransaction:(struct AOSTransactionC *)arg1; - (struct AOSAccount *)account; - (void)setAccount:(struct AOSAccount *)arg1; - (void)finalize; - (void)dealloc; - (id)init; @end
#ifndef TZW_VOLUMEMESH_H #define TZW_VOLUMEMESH_H #include "../../Interface/Drawable3D.h" #include "../../Mesh/Mesh.h" #include <stdint.h> namespace tzw { class SimpleMesh : public Drawable3D { public: SimpleMesh(VertexData * vertices, uint32_t verticesSize, const uint32_t * indices, uint32_t indicesSize); void submitDrawCmd(RenderFlag::RenderStage stageType, RenderQueue * queues, int requirementArg) override; void initBuffer(); virtual bool getIsAccpectOcTtree() const; private: Mesh * m_mesh; }; } // namespace tzw #endif // TZW_VOLUMEMESH_H
#pragma once /** * Copyright (c) blueback * Released under the MIT License * https://github.com/bluebackblue/brownie/blob/master/LICENSE.txt * http://bbbproject.sakura.ne.jp/wordpress/mitlicense * @brief DirectSound */ /** include */ #pragma warning(push) #pragma warning(disable:4464) #include "../types/types.h" #pragma warning(pop) /** include */ #pragma warning(push) #pragma warning(disable:4464) #include "../wave/wave.h" #include "../window/window.h" #pragma warning(pop) /** include */ #include "./dsound_streamcallback_base.h" /** NBsys::NDsound */ #if(BSYS_DSOUND_ENABLE) #pragma warning(push) #pragma warning(disable:4710 4820) namespace NBsys{namespace NDsound { /** システムの開始。 */ void StartSystem(const sharedptr<NBsys::NWindow::Window>& a_window); /** システムの終了リクエスト。 */ void EndSystemRequest(); /** システムの終了。 */ void EndSystem(); /** サウンドバッファ作成。 */ s32 CreateSoundBuffer(const sharedptr<NBsys::NWave::Wave>& a_wave,bool a_is_3d); /** サウンドバッファ削除。 */ void DeleteSoundBuffer(s32 a_id); /** ストリーミングサウンドバッファ作成。 */ s32 CreateStreamSoundBuffer(const sharedptr<NBsys::NDsound::Dsound_StreamCallback_Base>& a_stream_callback,bool a_is_3d); /** ストリーミングサウンドバッファ作成。 */ void DeleteStreamSoundBuffer(s32 a_id); /** 再生。 */ s32 Play(s32 a_id,bool a_duplicate,bool a_is_loop); /** 単発再生。 */ void OnceShotPlay(s32 a_id); /** 再生中チェック。 */ bool IsPlay(s32 a_id); /** 有効チェック。 */ bool IsExist(s32 a_id); }} #pragma warning(pop) #endif
#ifndef _LIB_UTILS_H_ #define _LIB_UTILS_H_ #include <mysql.h> #include <stdio.h> void exit_with_error(MYSQL *mysql); #endif /* _LIB_UTILS_H_ */
#ifndef CPP_INSTAGRAM_IMPL_API_URLS_H #define CPP_INSTAGRAM_IMPL_API_URLS_H #include "NonCopyable.h" #include <memory> #include <string> namespace Instagram { class UrlBuilder; class ApiUrls : NonCopyable { public: // initialized with either client_id param or access_token param ApiUrls(const std::string& accessParamKey, const std::string& accessParamValue); std::string getUserById(const std::string& id) const; // 0 passed to count makes it ignored // empty string passed to minId/maxId makes them ignored std::string getFeed(int count, const std::string& minId, const std::string& maxId) const; std::string getPopularMedias() const; private: UrlBuilder getPathWithAccessParam(const std::string& path) const; private: const std::string mAccessParamKey; const std::string mAccessParamValue; }; typedef std::shared_ptr<ApiUrls> ApiUrlsPtr; ApiUrlsPtr CreateNonauthenticatedApiUrls(const std::string& clientId); ApiUrlsPtr CreateAuthenticatedApiUrls(const std::string& accessToken); } #endif
/* * SocketException.h * * Created on: 06/11/2016 * Author: Lucas Teske */ #ifndef INCLUDES_EXCEPTIONS_SOCKETEXCEPTION_H_ #define INCLUDES_EXCEPTIONS_SOCKETEXCEPTION_H_ #include <SatHelper/exceptions/SatHelperException.h> namespace SatHelper { class SocketException: public SatHelperException { public: const int errorCode; SocketException(int errorCode) : errorCode(errorCode) { } virtual const char* what() const throw() { return "There was an Socket Error"; } virtual std::string reason() const { std::stringstream ss; ss << "There was an Socket Error with ErrorCode " << errorCode; return ss.str(); } }; } #endif /* INCLUDES_EXCEPTIONS_SOCKETEXCEPTION_H_ */
// // GridIndex.h // Grid Pager // // Created by Brandon Tate on 5/27/14. // Copyright (c) 2014 Brandon Tate. All rights reserved. // #import <Foundation/Foundation.h> @interface BTGridIndex : NSObject<NSCopying> /** The index row. */ @property (nonatomic) NSInteger row; /** The index column. */ @property (nonatomic) NSInteger column; /** * Initializer with row column properties. * * @param row The index row * @param column The index column * * @return The grid index */ - (id) initWithRow: (NSInteger) row column: (NSInteger) column; /** * Class method for creating a grid index. * * @param row The index row * @param column The index column * * @return The grid index */ + (BTGridIndex *) gridIndexWithRow: (NSInteger) row column: (NSInteger) column; @end
/******************************************************************************* The MIT License (MIT) Copyright (c) 2014 Nandor Licker 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 __PIG_TYPES_H__ #define __PIG_TYPES_H__ typedef unsigned char puint8_t; typedef unsigned short puint16_t; typedef unsigned int puint32_t; typedef signed char pint8_t; typedef signed short pint16_t; typedef signed int pint32_t; #endif
// // PPImage.h // BlinkIdFramework // // Created by Dino on 25/02/16. // Copyright © 2016 MicroBlink Ltd. All rights reserved. // #import "Foundation/Foundation.h" #import "CoreMedia/CoreMedia.h" #import "PPMicroBlinkDefines.h" NS_ASSUME_NONNULL_BEGIN /** * Enum which describes text orientation on an image. */ typedef NS_ENUM(NSUInteger, PPProcessingOrientation){ /** Text oriented same as picture */ PPProcessingOrientationUp, /** Text is rotated 90 degrees clockwise */ PPProcessingOrientationRight, /** Text is upside down */ PPProcessingOrientationDown, /** Text is rotated 90 degrees counterclockwise */ PPProcessingOrientationLeft, }; /** * Object which represents an image. */ PP_CLASS_AVAILABLE_IOS(6.0) @interface PPImage : NSObject /** * UIImage of wrapped image. * If this PPImage wasn't created with UIImage, UIImage will be created with first access of this property. */ @property (nonatomic, readonly) UIImage *image; /** * Region of the image used for scanning, where the whole image is specified with CGRectMake(0.0, 0.0, 1.0, 1.0). */ @property (nonatomic) CGRect roi; /** * Processing orientation of image. This is used in OCR where you can specify character orientation. * * Default: PPProcessingOrientationUp */ @property (nonatomic) PPProcessingOrientation orientation; /** * Tells whether camera input images should be mirrored horizontally before processing * * Default: NO */ @property (nonatomic) BOOL mirroredHorizontally; /** * Tells whether camera input images should be mirrored vertically before processing * * Default: NO */ @property (nonatomic) BOOL mirroredVertically; /** * Property which tells if this frame is a camera or a single photo frame. * This is important for image processing. * * Default: YES if created with CMSampleBuffer, NO if created with UIImage */ @property (nonatomic) BOOL cameraFrame; /** * Creates PPImage around UIImage. */ + (instancetype)imageWithUIImage:(UIImage *)image; /** * Creates PPImage around CVImageBufferRef. */ + (instancetype)imageWithCmSampleBuffer:(CMSampleBufferRef)buffer; @end NS_ASSUME_NONNULL_END
# /* ******************************************************************** # * * # * (C) Copyright Paul Mensonides 2003-2005. * # * * # * Distributed under the Boost Software License, Version 1.0. * # * (See accompanying file LICENSE). * # * * # * See http://chaos-pp.sourceforge.net for most recent version. * # * * # ******************************************************************** */ # # ifndef CHAOS_PREPROCESSOR_ALGORITHM_PREPEND_H # define CHAOS_PREPROCESSOR_ALGORITHM_PREPEND_H # # include <chaos/preprocessor/config.h> # include <chaos/preprocessor/control/iif.h> # include <chaos/preprocessor/generics/core.h> # include <chaos/preprocessor/lambda/ops.h> # include <chaos/preprocessor/limits.h> # include <chaos/preprocessor/recursion/basic.h> # include <chaos/preprocessor/recursion/expr.h> # # /* CHAOS_PP_PREPEND */ # # define CHAOS_PP_PREPEND(g1, g2) CHAOS_PP_PREPEND_BYPASS(CHAOS_PP_LIMIT_EXPR, g1, g2) # define CHAOS_PP_PREPEND_ID() CHAOS_PP_PREPEND # # if CHAOS_PP_VARIADICS # define CHAOS_PP_PREPEND_ CHAOS_PP_LAMBDA(CHAOS_PP_PREPEND_ID)() # endif # # /* CHAOS_PP_PREPEND_BYPASS */ # # define CHAOS_PP_PREPEND_BYPASS(s, g1, g2) \ CHAOS_PP_EXPR_S(s)(CHAOS_IP_PREPEND_I(CHAOS_PP_OBSTRUCT(), CHAOS_PP_PREV(s), g1, g2)) \ /**/ # define CHAOS_PP_PREPEND_BYPASS_ID() CHAOS_PP_PREPEND_BYPASS # # if CHAOS_PP_VARIADICS # define CHAOS_PP_PREPEND_BYPASS_ CHAOS_PP_LAMBDA(CHAOS_PP_PREPEND_BYPASS_ID)() # endif # # define CHAOS_IP_PREPEND_INDIRECT() CHAOS_IP_PREPEND_I # define CHAOS_IP_PREPEND_I(_, s, g1, g2) \ CHAOS_PP_IIF _(CHAOS_PP_IS_CONS(g1))( \ CHAOS_PP_CONS _( \ CHAOS_PP_EXPR_S(s) _(CHAOS_IP_PREPEND_INDIRECT _()( \ CHAOS_PP_OBSTRUCT _(), CHAOS_PP_PREV(s), CHAOS_PP_TAIL _(g1), g2 \ )), \ CHAOS_PP_HEAD _(g1) \ ), \ g2 \ ) \ /**/ # # endif
/***************************************************************************************** * * * OpenSpace * * * * Copyright (c) 2014-2022 * * * * 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 __OPENSPACE_MODULE_SPOUT___RENDERABLESPHERESPOUT___H__ #define __OPENSPACE_MODULE_SPOUT___RENDERABLESPHERESPOUT___H__ #ifdef WIN32 #include <modules/base/rendering/renderablesphere.h> #include <modules/spout/spoutwrapper.h> namespace openspace { namespace documentation { struct Documentation; } class RenderableSphereSpout : public RenderableSphere { public: RenderableSphereSpout(const ghoul::Dictionary& dictionary); void deinitializeGL() override; void update(const UpdateData& data) override; static documentation::Documentation Documentation(); private: void bindTexture() override; void unbindTexture() override; spout::SpoutReceiverPropertyProxy _spoutReceiver; }; } // namespace openspace #endif // WIN32 #endif // __OPENSPACE_MODULE_SPOUT___RENDERABLESPHERESPOUT___H__
// // Created by root on 16-6-15. // #ifndef SPIN_GONIO_H #define SPIN_GONIO_H #include <string> #include <vector> #include <math.h> #include <iostream> class Gonio { private: public: std::vector<float> results; Gonio(std::string file) { std::string test = "/home/csv/" + file; // read CSV file to float vector results = readCSV(test); // read float vector covert to double int vector std::vector<std::vector<int>> validVars = calcVars(); // RESULTS PRINTED HUR //printResults(validVars); } virtual ~Gonio() { } std::vector<float> readCSV(std::string fileName); std::vector<std::vector<int>> calcVars(); float toDegree(float rad); int mapToServo(float input); // for testing purposes void printResults(std::vector<std::vector<int>> validVars); }; #endif //SPIN_GONIO_H
#ifndef MATERIAL_H #define MATERIAL_H #include "Color.h" struct Material { Color ka, kd, ks; double sp; Color kr; }; #endif
// Copyright © 2017, Freiburg. // Author: Markus Frey. All Rights Reserved. #ifndef LASTFRAME_H_ #define LASTFRAME_H_ extern "C" { #include <libavcodec/avcodec.h> #include <libavutil/imgutils.h> #include <libavutil/opt.h> #include <libswscale/swscale.h> } #include <cxcore.hpp> #include <mutex> class LastFrame { public: LastFrame() {} void update(VmbUchar_t* img, int width, int height, AVPixelFormat inputPixFmt) { if (inputPixFmt == AV_PIX_FMT_GRAY8) { std::lock_guard<std::mutex> guard(accessLock); cv::Mat vimbaCVFrame(height, width, CV_8UC1, img); vimbaCVFrame.copyTo(frame); } else { // TODO: More input pixel formats. throw std::runtime_error("Don't know how to read the camera's pixel format in OpenCV!"); } } void get(cv::Mat& frameCpy) { std::lock_guard<std::mutex> guard(accessLock); frame.copyTo(frameCpy); } private: std::mutex accessLock; cv::Mat frame; }; #endif // LASTFRAME_H_
// // AWebImage.h // AWebImage // // Created by 秦 道平 on 16/6/12. // Copyright © 2016年 秦 道平. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for AWebImage. FOUNDATION_EXPORT double AWebImageVersionNumber; //! Project version string for AWebImage. FOUNDATION_EXPORT const unsigned char AWebImageVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <AWebImage/PublicHeader.h>
/**************************************************************************** * * * * * Copyright (C) 2000,2002 by Holger Flemming * * * * Thist Program is free software; yopu can redistribute ist and/or modify * * it under the terms of the GNU General Public License as published by the * * Free Software Foundation; either version 2 of the License, or * * (at your option) any later versions. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRENTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * * * * You should have receved a copy of the GNU General Public License along * * with this program; if not, write to the Free Software Foundation, Inc., * * 675 Mass Ave, Cambridge, MA 02139, USA. * * * **************************************************************************** * * * Author: * * Holger Flemming, DH4DAI email : dh4dai@amsat.org * * PR : dh4dai@db0wts.#nrw.deu.eu * * * * List of other authors: * * * ****************************************************************************/ #ifndef __USER_H__ #define __USER_H__ #include <stdlib.h> #include <iostream> #include <string.h> #include "globdef.h" #include "callsign.h" #include "config.h" #include "String.h" #include "logfile.h" using namespace std; // Die Klasse User verwaltet alle Daten, die ueber den momentanen // Benutzer des Programmes notwendig sind class user { private: callsign call; bool http_flag; bool pw_gesetzt; uint32_t sockadr; char correct[6]; static zeit http_pw_time; static uint32_t http_pw_sock_adr; static callsign http_pw_call; static String http_pw_correct; static bool http_pw_auth1_flag; static bool http_pw_sysop_flag; public: bool sysop; String name; locator loc; String language; zeit last_login; public: user( void ); user(const callsign& , bool = false ); user( const callsign&, uint32_t ); bool auth1( config_file & , String& ); bool auth2( config_file & , const String& ); void logoff( void ); inline bool is_sysop( void ) const { return sysop; } inline callsign user_call ( void ) { return call; } inline bool is_pw_set( void ) { return pw_gesetzt; } }; #endif
#pragma once template<class T> struct scope_guard { scope_guard(T &&f) noexcept : t((T &&) f) {} ~scope_guard() noexcept { t(); } scope_guard(const scope_guard &) = delete; auto operator=(const scope_guard &) -> scope_guard & = delete; scope_guard(scope_guard &&) = default; auto operator=(scope_guard &&) -> scope_guard & = default; private: T t; }; template<class T> auto make_scope_guard(T &&f) noexcept { return scope_guard<T>((T &&) f); } #define SCOPE_GUARD_CAT(x, y) x##y #define SCOPE_GUARD_ID(index) SCOPE_GUARD_CAT(__scope_guard, index) #define LATER(expr) auto SCOPE_GUARD_ID(__LINE__){make_scope_guard([&]() noexcept { expr; })};
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "UIViewController.h" @interface SBSoftwareUpdateVerifyingUpdateAlertViewController : UIViewController { } - (void)loadView; @end
#ifdef __OBJC__ #import <UIKit/UIKit.h> #endif FOUNDATION_EXPORT double Pods_TestAppStoreVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_TestAppStoreVersionString[];
// // Created by byter on 29.07.17. // #ifndef THREEPP_SCENE #define THREEPP_SCENE #include <threepp/core/Object3D.h> #include <threepp/core/Color.h> #include <threepp/util/Resolver.h> #include "Fog.h" namespace three { /** * a scene holds a graph of 3D objects which are rendered together */ class DLX Scene : public Object3D { Fog::Ptr _fog; bool _autoUpdate; protected: Scene(const Fog::Ptr fog) : Object3D(), _fog(fog), _autoUpdate(true) {} Scene() : Object3D(), _fog(nullptr), _autoUpdate(true) {} Scene(const Scene &scene) : Object3D(scene), _fog(Fog::Ptr(scene._fog->cloned())), _autoUpdate(scene._autoUpdate) {} public: using Ptr = std::shared_ptr<Scene>; virtual const background::Typer &background() const { static const background::Typer bg {(void *)0}; return bg; } static Ptr make(std::string name="") { Ptr p(new Scene()); p->_name = name; return p; } Scene *cloned() const override { return new Scene(*this); } virtual bool hasBackground() const {return false;} Material::Ptr overrideMaterial; const Fog::Ptr fog() const {return _fog;} Fog::Ptr &fog() {return _fog;} bool autoUpdate() const {return _autoUpdate;} }; /** * background wrapper * * @tparam _BgData */ template <typename _BgData> struct Background { const _BgData data; background::Typer typer; Background(const _BgData &data) : data(data), typer(background::Typer(this)) {} Background(const Background &background) : data(background.data), typer(background::Typer(this)) {} ~Background() = default; }; /** * scene with background. Currently supported background types are * <ul> * <li>Color</li> * <li>Texture::Ptr</li> * </ul> * supported Textures are ImageCubetexture and ImageTexture * * @tparam _Background the background type */ template <typename _Background> class SceneT : public Scene { Background<_Background> _background; protected: SceneT(const _Background &background, const Fog::Ptr &fog) : Scene(fog), _background(background) {} SceneT(const SceneT &scene) : Scene(scene), _background(scene._background) {} public: using Ptr = std::shared_ptr<SceneT<_Background>>; static Ptr make(std::string name, const _Background &background, const Fog::Ptr &fog=nullptr) { Ptr p(new SceneT(background, fog)); p->_name = name; return p; } SceneT *cloned() const override { return new SceneT(*this); } bool hasBackground() const override {return true;} const background::Typer &background() const override { return _background.typer; } }; } #endif //THREEPP_SCENE
#ifndef VLDDEXPORTER_STDAFX #define VLDDEXPORTER_STDAFX #include <SDKDDKVer.h> // C RunTime Header Files #include <stdlib.h> #include <malloc.h> #include <memory.h> #include <wchar.h> #include <math.h> #include <assert.h> #include <Windows.h> #include <Windowsx.h> #include <wincodec.h> #include <iostream> #include <fstream> #include <sstream> #include <map> #include <list> #include <algorithm> #include <string> #include <time.h> #include <ctime> #include <vector> #include <regex> #include <tchar.h> using namespace std; #endif
#pragma once #include "Interface/DepthBuffer.h" #include "OpenGLObjectID.h" #include "OpenGLTexture2D.h" #include "OpenGLRenderTarget.h" namespace krono { class OpenGLDepthBuffer : public DepthBuffer, public OpenGLRenderTarget { public: OpenGLDepthBuffer(Vector2i size, DataFormat::Type format); ~OpenGLDepthBuffer(void); virtual Auto<Texture2D> GetTexture() const; virtual void Clear(float depth); virtual OpenGLRenderTarget::Type GetType() const; virtual GLuint GetGLObject() const; private: GLuint mClearFBO; GLuint mGLTexture; Auto<OpenGLTexture2D> mTextureTarget; static GLenum gTextureFormatMapping[]; }; }
// // DDSortCell.h // DDNews // // Created by Dvel on 16/4/15. // Copyright © 2016年 Dvel. All rights reserved. // #import <UIKit/UIKit.h> @interface DDSortCell : UICollectionViewCell @property (nonatomic, strong) UIButton *button; @end
//=========================================================================== // // File : F5XFFHttpModuleFactory.h // Description : Factory class used for creating F5XFFHttpModule classes. // //--------------------------------------------------------------------------- // // The contents of this file are subject to the "END USER LICENSE AGREEMENT FOR F5 // Software Development Kit for iControl"; you may not use this file except in // compliance with the License. The License is included in the iControl // Software Development Kit. // // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See // the License for the specific language governing rights and limitations // under the License. // // The Original Code is iControl Code and related documentation // distributed by F5. // // The Initial Developer of the Original Code is F5 Networks, Inc. // Seattle, WA, USA. // Portions created by F5 are Copyright (C) 2009 F5 Networks, Inc. // All Rights Reserved. // iControl (TM) is a registered trademark of F5 Networks, Inc. // // Alternatively, the contents of this file may be used under the terms // of the GNU General Public License (the "GPL"), in which case the // provisions of GPL are applicable instead of those above. If you wish // to allow use of your version of this file only under the terms of the // GPL and not to allow others to use your version of this file under the // License, indicate your decision by deleting the provisions above and // replace them with the notice and other provisions required by the GPL. // If you do not delete the provisions above, a recipient may use your // version of this file under either the License or the GPL. // //=========================================================================== #ifndef __MODULE_FACTORY_H__ #define __MODULE_FACTORY_H__ #include <stdio.h> //--------------------------------------------------------------------------- // class CF5XFFHttpModuleFactory // // Factory class for CF5XFFHttpModule. // This class is responsible for creating instances // of CF5XFFHttpModule for each request. //--------------------------------------------------------------------------- class CF5XFFHttpModuleFactory : public IHttpModuleFactory { public: TCHAR m_HeaderName[1024]; public: CF5XFFHttpModuleFactory() { SetHeaderName(_T("X-Forwarded-For")); } CF5XFFHttpModuleFactory(TCHAR *szHeaderName) { SetHeaderName(szHeaderName); } public: void SetHeaderName(TCHAR *szHeaderName) { if ( NULL != szHeaderName ) { _tcsncpy(m_HeaderName, szHeaderName, 1023); } } public: virtual HRESULT GetHttpModule( OUT CHttpModule **ppModule, IN IModuleAllocator *) { HRESULT hr = S_OK; CF5XFFHttpModule *pModule = NULL; if ( ppModule == NULL ) { hr = HRESULT_FROM_WIN32( ERROR_INVALID_PARAMETER ); goto Finished; } pModule = new CF5XFFHttpModule(m_HeaderName); if ( pModule == NULL ) { hr = HRESULT_FROM_WIN32( ERROR_NOT_ENOUGH_MEMORY ); goto Finished; } *ppModule = pModule; pModule = NULL; Finished: if ( pModule != NULL ) { delete pModule; pModule = NULL; } return hr; } virtual void Terminate() { delete this; } }; #endif
// // CASStyler.h // Classy // // Created by Jonas Budelmann on 16/09/13. // Copyright (c) 2013 cloudling. All rights reserved. // #import <UIKit/UIKit.h> #import "CASObjectClassDescriptor.h" #import "CASStyleableItem.h" @interface CASStyler : NSObject /** * Singleton instance */ + (instancetype)defaultStyler; /** * File path which contains style data */ @property (nonatomic, copy) NSString *filePath; /** * File path to watch for changes. * Only use for debugging on simulator */ @property (nonatomic, copy) NSString *watchFilePath; /** * Set file path location of styling data and report any errors * * @param filePath The location of the style data * @param error The error that occurred while parsing the filePath */ - (void)setFilePath:(NSString *)filePath error:(NSError **)error; /** * Apply any applicable styles to a CASStyleableItem instance, from low to high precendence * * @param item `CASStyleableItem` to apply styles to */ - (void)styleItem:(id<CASStyleableItem>)item; /** * Returns a cached CASObjectClassDescriptor if it exists or creates one */ - (CASObjectClassDescriptor *)objectClassDescriptorForClass:(Class)class; /** * Schedule update for styleable item. * This ensures we only update an item once per run loop * * @param item CASStyleableItem to coalesce update calls */ - (void)scheduleUpdateForItem:(id<CASStyleableItem>)item; /** * Unschedule update for styleable item * * @param item CASStyleableItem that no longer needs updating */ - (void)unscheduleUpdateForItem:(id<CASStyleableItem>)item; @end
//================================================================================== // Copyright (c) 2016 , Advanced Micro Devices, Inc. All rights reserved. // /// \author AMD Developer Tools Team /// \file apFrameTerminators.h /// //================================================================================== //------------------------------ apFrameTerminators.h ------------------------------ #ifndef __APFRAMETERMINATORS #define __APFRAMETERMINATORS // Enumeration containing functions that may be OpenGL render frame terminators. // (Commands that end a rendered frame). enum apFrameTerminators { AP_SWAP_BUFFERS_TERMINATOR = 0x00000001, // Win32 / egl /Linux SwapBuffers functions. AP_GL_FLUSH_TERMINATOR = 0x00000002, // OpenGL glFlush function. AP_GL_FINISH_TERMINATOR = 0x00000004, // OpenGL glFinish function. AP_SWAP_LAYER_BUFFERS_TERMINATOR = 0x00000008, // win32 wglSwapLayerBuffers function. AP_MAKE_CURRENT_TERMINATOR = 0x00000010, // Win32 / egl / Linux MakeCurrent (wglMakeCurrent / glXMakeCurrent & glXMakeContextCurrent / eglMakeCurrent) function. AP_GL_CLEAR_TERMINATOR = 0x00000020, // OpenGL glClear function. AP_GL_FRAME_TERMINATOR_GREMEDY = 0x00000040, // OpenGL GREMEDY Extension glFrameTerminatorGREMEDY function. AP_ALL_GL_FRAME_TERMINATORS = 0x0000FFFF, // All OpenGL frame terminators are selected. AP_CL_GREMEDY_COMPUTATION_FRAME_TERMINATORS = 0x00010000, // Pairs of clBeginComputationFrameGREMEDY and clEndComputationFrameGREMEDY functions. AP_CL_FLUSH_TERMINATOR = 0x00020000, // OpenCL clFlush function. AP_CL_FINISH_TERMINATOR = 0x00040000, // OpenCL clFinish function. AP_CL_WAIT_FOR_EVENTS_TERMINATOR = 0x00080000, // OpenCL clWaitForEvents function. AP_ALL_CL_FRAME_TERMINATORS = 0xFFFF0000, // All OpenCL frame terminators are selected. }; #define AP_DEFAULT_GL_FRAME_TERMINATOR AP_SWAP_BUFFERS_TERMINATOR #define AP_DEFAULT_CL_FRAME_TERMINATOR AP_CL_FLUSH_TERMINATOR #define AP_DEFAULT_FRAME_TERMINATORS (AP_DEFAULT_GL_FRAME_TERMINATOR | AP_DEFAULT_CL_FRAME_TERMINATOR) #endif // __APFRAMETERMINATORS
// Copyright 2021 Phyronnaz #pragma once #include "CoreMinimal.h" #include "VoxelNodeHelper.h" #include "VoxelExposedNodes.h" #include "VoxelNodeHelperMacros.h" #include "VoxelSeedNodes.generated.h" UCLASS(Abstract) class VOXELGRAPH_API UVoxelSeedNode : public UVoxelNodeHelper { GENERATED_BODY() public: UVoxelSeedNode(); }; // Seed parameter UCLASS(DisplayName = "Seed", Category = "Seed") class VOXELGRAPH_API UVoxelNode_Seed : public UVoxelExposedNode { GENERATED_BODY() GENERATED_VOXELNODE_BODY() GENERATED_EXPOSED_VOXELNODE_BODY(DefaultValue) public: UPROPERTY(EditAnywhere, Category = "Voxel") int32 DefaultValue = 1443; UPROPERTY() FName Name_DEPRECATED; UVoxelNode_Seed(); //~ Begin UObject Interface virtual void PostLoad() override; //~ End UObject Interface }; // Combine seeds by hashing them UCLASS(DisplayName = "Hash Seeds", Category = "Seed", meta = (Keywords = "combine add seed")) class VOXELGRAPH_API UVoxelNode_AddSeeds : public UVoxelSeedNode { GENERATED_BODY() GENERATED_VOXELNODE_BODY() COMPACT_VOXELNODE("HASH") UVoxelNode_AddSeeds(); }; // Make several new seeds from a single one UCLASS(DisplayName = "Make Seeds", Category = "Seed", meta = (Keywords = "make combine add seed")) class VOXELGRAPH_API UVoxelNode_MakeSeeds : public UVoxelSeedNode { GENERATED_BODY() GENERATED_VOXELNODE_BODY() public: UPROPERTY(EditAnywhere, Category = "Voxel", meta = (ClampMin = 2, ClampMax = 32, ReconstructNode)) int32 NumOutputs = 5; UVoxelNode_MakeSeeds(); //~ Begin UVoxelNode Interface virtual int32 GetOutputPinsCount() const override { return NumOutputs; } //~ End UVoxelNode Interface };
// // blankLib.h // blankLib // // Created by hsujahhu on 2015/8/20. // Copyright (c) 2015年 Herxun. All rights reserved. // #import <Foundation/Foundation.h> @interface blankLib : NSObject @end
#ifndef GUIUTIL_H #define GUIUTIL_H #include <QString> #include <QObject> #include <QMessageBox> QT_BEGIN_NAMESPACE class QFont; class QLineEdit; class QWidget; class QDateTime; class QUrl; class QAbstractItemView; QT_END_NAMESPACE class SendCoinsRecipient; /** Utility functions used by the Bitcoin Qt UI. */ namespace GUIUtil { // Create human-readable string from date QString dateTimeStr(const QDateTime &datetime); QString dateTimeStr(qint64 nTime); // Render Bitcoin addresses in monospace font QFont bitcoinAddressFont(); // Set up widgets for address and amounts void setupAddressWidget(QLineEdit *widget, QWidget *parent); void setupAmountWidget(QLineEdit *widget, QWidget *parent); // Parse "CurrentCoin:" URI into recipient object, return true on successful parsing // See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0 bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out); bool parseBitcoinURI(QString uri, SendCoinsRecipient *out); // HTML escaping for rich text controls QString HtmlEscape(const QString& str, bool fMultiLine=false); QString HtmlEscape(const std::string& str, bool fMultiLine=false); /** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing is selected. @param[in] column Data column to extract from the model @param[in] role Data role to extract from the model @see TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress */ void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole); /** Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when no suffix is provided by the user. @param[in] parent Parent window (or 0) @param[in] caption Window caption (or empty, for default) @param[in] dir Starting directory (or empty, to default to documents directory) @param[in] filter Filter specification such as "Comma Separated Files (*.csv)" @param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0). Can be useful when choosing the save file format based on suffix. */ QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedSuffixOut=0); /** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking. @returns If called from the GUI thread, return a Qt::DirectConnection. If called from another thread, return a Qt::BlockingQueuedConnection. */ Qt::ConnectionType blockingGUIThreadConnection(); // Determine whether a widget is hidden behind other windows bool isObscured(QWidget *w); // Open debug.log void openDebugLogfile(); /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. This assures that Qt can word-wrap long tooltip messages. Tooltips longer than the provided size threshold (in characters) are wrapped. */ class ToolTipToRichTextFilter : public QObject { Q_OBJECT public: explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0); protected: bool eventFilter(QObject *obj, QEvent *evt); private: int size_threshold; }; bool GetStartOnSystemStartup(); bool SetStartOnSystemStartup(bool fAutoStart); /** Help message for Bitcoin-Qt, shown with --help. */ class HelpMessageBox : public QMessageBox { Q_OBJECT public: HelpMessageBox(QWidget *parent = 0); /** Show message box or print help message to standard output, based on operating system. */ void showOrPrint(); /** Print help message to console */ void printToConsole(); private: QString header; QString coreOptions; QString uiOptions; }; } // namespace GUIUtil #endif // GUIUTIL_H
#include <string.h> #include <stdlib.h> #include <stdio.h> #include "list.h" int main() { List(int*) l = NULL; int a=1, b=2; list_append(l, &a); printf("%zu %d\n", list_len(l), *l[0]); list_append(l, &b); printf("%zu %d %d\n", list_len(l), *l[0], *l[1]); list_free(l); return 0; }
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <mpi.h> static inline bool string_match(char * string, char * substring) { // this should never happen... if (0 == strlen(substring)) return false; char * pos = strstr(string, substring); return (pos != NULL); } int main(void) { MPI_Init(NULL,NULL); int rank, size; MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); int incompatible = 0; // MPI standard consistency { int version = 0; int subversion = 0; MPI_Get_version(&version, &subversion); if ((version != MPI_VERSION) || (subversion != MPI_SUBVERSION)) { incompatible++; printf("The MPI (version,subversion) is not consistent:\n compiled: (%d,%d)\n runtime: (%d,%d)\n", MPI_VERSION, MPI_SUBVERSION, version, subversion); } } // MPI implementation consistency // We only attempt to detect Open-MPI, MPICH and Intel MPI. // Cray MPI and MVAPICH2 may detect as MPICH here. { bool ompi_compiled = false; #if defined(OPEN_MPI) ompi_compiled = true; #endif bool mpich_compiled = false; #if defined(MPICH) || defined(MPICH_VERSION) mpich_compiled = true; #endif bool intel_compiled = false; #if defined(I_MPI_VERSION) intel_compiled = true; #endif int resultlen = 0; char version[MPI_MAX_LIBRARY_VERSION_STRING+1] = {0}; MPI_Get_library_version(version, &resultlen); if (rank == 0) { printf("MPI_Get_library_version = %s\n", version); } bool mpich_linked = string_match(version, "MPICH"); bool intel_linked = string_match(version, "Intel"); bool ompi_linked = string_match(version, "Open"); if (ompi_compiled && intel_linked) { incompatible++; printf("Program was compiled with Open-MPI, but runtime library is Intel MPI - this will not work!\n"); } if (ompi_compiled && mpich_linked) { incompatible++; printf("Program was compiled with Open-MPI, but runtime library is MPICH - this will not work!\n"); } if (mpich_compiled && ompi_linked) { incompatible++; printf("Program was compiled with Intel MPI, but runtime library is Open-MPI - this will not work!\n"); } // MPICH and Intel MPI are ABI-compatible... // per https://www.open-mpi.org/faq/?category=running#mpi-environmental-variables, this works since v1.3 char * ocws = getenv("OMPI_COMM_WORLD_SIZE"); bool ompi_launched = (ocws != NULL); // MPICH and friends define these char * pmsz = getenv("PMI_SIZE"); char * mlnr = getenv("MPI_LOCALNRANKS"); bool mpich_launched = ((pmsz != NULL) || (mlnr != NULL)); // Intel MPI defines this char * imin = getenv("I_MPI_INFO_NP"); bool intel_launched = (imin != NULL); // check for compiled-launched compatibility if (ompi_compiled && intel_launched) { incompatible++; printf("Program was compiled with Open-MPI, but launched with Intel MPI mpirun - this will not work!\n"); } if (ompi_compiled && mpich_launched) { incompatible++; printf("Program was compiled with Open-MPI, but launched with MPICH mpirun - this will not work!\n"); } if (intel_compiled && ompi_launched) { incompatible++; printf("Program was compiled with Intel MPI, but launched with Open-MPI mpirun - this will not work!\n"); } if (mpich_compiled && ompi_launched) { incompatible++; printf("Program was compiled with MPICH, but launched with Open-MPI mpirun - this will not work!\n"); } // check for linked-launched compatibility if (ompi_linked && intel_launched) { incompatible++; printf("Program was linked with Open-MPI, but launched with Intel MPI mpirun - this will not work!\n"); } if (ompi_linked && mpich_launched) { incompatible++; printf("Program was linked with Open-MPI, but launched with MPICH mpirun - this will not work!\n"); } if (intel_linked && ompi_launched) { incompatible++; printf("Program was linked with Intel MPI, but launched with Open-MPI mpirun - this will not work!\n"); } if (mpich_linked && ompi_launched) { incompatible++; printf("Program was linked with MPICH, but launched with Open-MPI mpirun - this will not work!\n"); } } if (rank == 0) { if (incompatible) { printf("%d MPI-related incompatibilities were detected!\n", incompatible); } } MPI_Finalize(); return 0; }
// // Verse+CoreDataProperties.h // // // Created by Jon Chui on 11/15/15. // // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. // #import "Verse.h" NS_ASSUME_NONNULL_BEGIN @interface Verse (CoreDataProperties) @property (nullable, nonatomic, retain) NSString *chapter; @property (nullable, nonatomic, retain) NSString *book; @property (nullable, nonatomic, retain) NSNumber *verseNumber; @property (nullable, nonatomic, retain) NSString *text; @end NS_ASSUME_NONNULL_END
// // ASICloudFilesContainerXMLParserDelegate.h // // Created by Michael Mayo on 1/10/10. // #import "ASICloudFilesRequest.h" #if !TARGET_OS_IPHONE || (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_4_0) #import "ASINSXMLParserCompat.h" #endif @class ASICloudFilesContainer; @interface ASICloudFilesContainerXMLParserDelegate : NSObject <NSXMLParserDelegate> { NSMutableArray *containerObjects; // Internally used while parsing the response NSString *currentContent; NSString *currentElement; ASICloudFilesContainer *currentObject; } @property (retain) NSMutableArray *containerObjects; @property (retain) NSString *currentElement; @property (retain) NSString *currentContent; @property (retain) ASICloudFilesContainer *currentObject; @end
// // RDMTeacherLinkLibraryURLOnlyCell.h // URLPusher-Teacher // // Created by Reese McLean on 8/4/13. // Copyright (c) 2013 Reese McLean. All rights reserved. // #import <UIKit/UIKit.h> @class SSLabel; @interface RDMTeacherLinkLibraryURLOnlyCell : UICollectionViewCell @property (weak, nonatomic) IBOutlet SSLabel *urlLabel; @end
#ifndef CONVERTER_H #define CONVERTER_H #include "acrbslam/common_include.h" namespace acrbslam { class Converter { public: //Converter(); //~Converter(); void rgbmat2rgbchar(Converter converter, Mat rgbmat, char **red,char **green,char **blue); //将RGB图像转化为便于WiFi传输的char* void rgbchar2rgbmat(Converter converter, Mat rgbmat, char red[],char green[],char blue[]); void mat2char(Converter converter, Mat mat_, char** char_); void char2mat(Converter converter, Mat mat_, char** char_); static Mat toCvMat(const SE3 &SE3); static Mat toCvMat(const Eigen::Matrix4d &m); Eigen::Matrix4d toMatrix4d(const cv::Mat &cvMat4); SE3 toSE3(const cv::Mat &cvT); Affine3d toAffine3d(SE3 &Twc); void SplitRGBMat(Mat RGBMat, Mat *ImageBlueChannel, Mat *ImageGreenChannel, Mat *ImageRedChannel); //将MAT融合成一个通道 Mat MergeRGBMat( Mat ImageBlueChannel, Mat ImageGreenChannel, Mat ImageRedChannel); //将三个通道融合 //void se32char(Sophus::SE3 pose, char rotation_char[3][3], char translation_char[3]); void se32char(Sophus::SE3 pose, char **rotation_char, char **translation_char); char red_mat[307200]; //640*480 char green_mat[307200]; char blue_mat[307200]; //unsigned short int depth_mat[307200]; char depth_mat[76800]; //320*240 }; }//namespace arbslam #endif //CONVERTER_H
#include "plumber.h" int sporth_jcrev(sporth_stack *stack, void *ud) { plumber_data *pd = ud; SPFLOAT input; SPFLOAT out; sp_jcrev *jcrev; switch(pd->mode) { case PLUMBER_CREATE: #ifdef DEBUG_MODE fprintf(stderr, "jcrev: Creating\n"); #endif sp_jcrev_create(&jcrev); plumber_add_module(pd, SPORTH_JCREV, sizeof(sp_jcrev), jcrev); break; case PLUMBER_INIT: #ifdef DEBUG_MODE fprintf(stderr, "jcrev: Initialising\n"); #endif if(sporth_check_args(stack, "f") != SPORTH_OK) { fprintf(stderr,"Not enough arguments for jcrev\n"); stack->error++; return PLUMBER_NOTOK; } input = sporth_stack_pop_float(stack); jcrev = pd->last->ud; sp_jcrev_init(pd->sp, jcrev); sporth_stack_push_float(stack, 0); break; case PLUMBER_COMPUTE: if(sporth_check_args(stack, "f") != SPORTH_OK) { fprintf(stderr,"Not enough arguments for jcrev\n"); stack->error++; return PLUMBER_NOTOK; } input = sporth_stack_pop_float(stack); jcrev = pd->last->ud; sp_jcrev_compute(pd->sp, jcrev, &input, &out); sporth_stack_push_float(stack, out); break; case PLUMBER_DESTROY: jcrev = pd->last->ud; sp_jcrev_destroy(&jcrev); break; default: fprintf(stderr, "jcrev: Uknown mode!\n"); break; } return PLUMBER_OK; }
// PIC18F2550 Configuration Bit Settings #include <xc.h> // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. // CONFIG1L #pragma config PLLDIV = 1 // PLL Prescaler Selection bits (No prescale (4 MHz oscillator input drives PLL directly)) #pragma config CPUDIV = OSC1_PLL2// System Clock Postscaler Selection bits ([Primary Oscillator Src: /1][96 MHz PLL Src: /2]) #pragma config USBDIV = 1 // USB Clock Selection bit (used in Full-Speed USB mode only; UCFG:FSEN = 1) (USB clock source comes directly from the primary oscillator block with no postscale) // CONFIG1H #pragma config FOSC = HS // Oscillator Selection bits (HS oscillator (HS)) #pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled) #pragma config IESO = OFF // Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled) // CONFIG2L #pragma config PWRT = ON // Power-up Timer Enable bit (PWRT enabled) #pragma config BOR = ON // Brown-out Reset Enable bits (Brown-out Reset enabled in hardware only (SBOREN is disabled)) #pragma config BORV = 3 // Brown-out Reset Voltage bits (Minimum setting) #pragma config VREGEN = OFF // USB Voltage Regulator Enable bit (USB voltage regulator disabled) // CONFIG2H #pragma config WDT = OFF // Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit)) #pragma config WDTPS = 32768 // Watchdog Timer Postscale Select bits (1:32768) // CONFIG3H #pragma config CCP2MX = OFF // CCP2 MUX bit (CCP2 input/output is multiplexed with RB3) #pragma config PBADEN = OFF // PORTB A/D Enable bit (PORTB<4:0> pins are configured as digital I/O on Reset) #pragma config LPT1OSC = OFF // Low-Power Timer 1 Oscillator Enable bit (Timer1 configured for higher power operation) #pragma config MCLRE = ON // MCLR Pin Enable bit (MCLR pin enabled; RE3 input pin disabled) // CONFIG4L #pragma config STVREN = ON // Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset) #pragma config LVP = OFF // Single-Supply ICSP Enable bit (Single-Supply ICSP disabled) #pragma config XINST = OFF // Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode)) // CONFIG5L #pragma config CP0 = OFF // Code Protection bit (Block 0 (000800-001FFFh) is not code-protected) #pragma config CP1 = OFF // Code Protection bit (Block 1 (002000-003FFFh) is not code-protected) #pragma config CP2 = OFF // Code Protection bit (Block 2 (004000-005FFFh) is not code-protected) #pragma config CP3 = OFF // Code Protection bit (Block 3 (006000-007FFFh) is not code-protected) // CONFIG5H #pragma config CPB = OFF // Boot Block Code Protection bit (Boot block (000000-0007FFh) is not code-protected) #pragma config CPD = OFF // Data EEPROM Code Protection bit (Data EEPROM is not code-protected) // CONFIG6L #pragma config WRT0 = OFF // Write Protection bit (Block 0 (000800-001FFFh) is not write-protected) #pragma config WRT1 = OFF // Write Protection bit (Block 1 (002000-003FFFh) is not write-protected) #pragma config WRT2 = OFF // Write Protection bit (Block 2 (004000-005FFFh) is not write-protected) #pragma config WRT3 = OFF // Write Protection bit (Block 3 (006000-007FFFh) is not write-protected) // CONFIG6H #pragma config WRTC = OFF // Configuration Register Write Protection bit (Configuration registers (300000-3000FFh) are not write-protected) #pragma config WRTB = OFF // Boot Block Write Protection bit (Boot block (000000-0007FFh) is not write-protected) #pragma config WRTD = OFF // Data EEPROM Write Protection bit (Data EEPROM is not write-protected) // CONFIG7L #pragma config EBTR0 = OFF // Table Read Protection bit (Block 0 (000800-001FFFh) is not protected from table reads executed in other blocks) #pragma config EBTR1 = OFF // Table Read Protection bit (Block 1 (002000-003FFFh) is not protected from table reads executed in other blocks) #pragma config EBTR2 = OFF // Table Read Protection bit (Block 2 (004000-005FFFh) is not protected from table reads executed in other blocks) #pragma config EBTR3 = OFF // Table Read Protection bit (Block 3 (006000-007FFFh) is not protected from table reads executed in other blocks) // CONFIG7H #pragma config EBTRB = OFF // Boot Block Table Read Protection bit (Boot block (000000-0007FFh) is not protected from table reads executed in other blocks) #define ir_led RB0 void timer0_init(void); void interrupt isr(void); void timer0_isr(void); void delay(unsigned int n); unsigned char count=0x00; void main() { ADCON1=0x0F; TRISB=0xFE; TRISC=0x00; ir_led=0; timer0_init(); RC0=0; while(1) { if(count>=20) { ir_led=0; count=0x00; TMR0ON=0; delay(500); TMR0ON=1; } } } //ISR vector void interrupt isr(void) { asm("CALL _timer0_isr"); } //timer 0 isr void timer0_isr(void) { TMR0ON=0; TMR0IF=0; TMR0L=0xDB; ir_led=~ir_led; count++; TMR0ON=1; } void timer0_init(void) { //initialize timer interrupt IPEN=1; GIEH=1; TMR0IE=1; TMR0IP=1; TMR0IF=0; //initialize timer 0 TMR0ON=0; //turn off timer/counter T08BIT=1; //8-bit mode T0CS=0; //timer mode PSA=1; //no prescaler TMR0L=0xDB; //timer initial value TMR0ON=1; } //delay function void delay(unsigned int n) { unsigned int i; unsigned char j; for(i=0; i<n; i++) { for(j=0; j<255; j++); } }
// // ZVScrollSider.h // scrllSlider // // Created by 子为 on 15/12/25. // Copyright © 2015年 wealthBank. All rights reserved. // #import <UIKit/UIKit.h> @class ZVScrollSlider; @protocol ZVScrollSliderDelegate <NSObject> -(void)ZVScrollSlider:(ZVScrollSlider *)slider ValueChange:(int )value; @optional -(void)ZVScrollSliderDidDelete:(ZVScrollSlider *)slider; -(void)ZVScrollSliderDidTouch:(ZVScrollSlider *)slider; @end @interface ZVScrollSlider : UIView @property (nonatomic, copy ) NSString *title; @property (nonatomic) BOOL isAllowInput; ///<是否允许键盘输入 @property (nonatomic, copy , readonly) NSString *unit; @property (nonatomic, assign ,readonly) int minValue; ///<设置这个时max-min必须可以整除10 @property (nonatomic, assign ,readonly) int maxValue; @property (nonatomic, assign ,readonly) int step; @property (nonatomic, weak) id<ZVScrollSliderDelegate> delegate; @property (nonatomic, assign) float realValue; -(void)setRealValue:(float)realValue Animated:(BOOL)animated; -(instancetype)initWithFrame:(CGRect)frame Title:(NSString *)title MinValue:(int)minValue MaxValue:(int)maxValue Step:(int)step Unit:(NSString *)unit HasDeleteBtn:(BOOL)hasDeleteBtn; +(CGFloat)heightWithBoundingWidth:(CGFloat )width Title:(NSString *)title; @end
// // WMChord+RomanNumerals.h // WesternMusicElements // // Created by Ramon Poca on 08/08/14. // Copyright (c) 2014 International MicrOondes. All rights reserved. // #import "WMChord.h" @interface WMChord (RomanNumerals) + (WMChord *) chordWithRoot:(WMNote *) root commonPracticeDegree:(NSString *) degree; @end
#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_Popular_MoviesVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_Popular_MoviesVersionString[];
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "UIScrollViewDelegate-Protocol.h" @protocol TSKScrollViewDelegate <UIScrollViewDelegate> @optional - (void)scrollView:(id)arg1 willAnimateToContentOffset:(struct CGPoint)arg2; - (void)scrollViewDidEndDecelerating:(id)arg1; - (void)scrollViewDidEndDragging:(id)arg1 willDecelerate:(_Bool)arg2; - (void)scrollViewWillBeginDragging:(id)arg1; - (void)scrollViewDidScroll:(id)arg1; - (void)scrollViewWillScroll:(id)arg1; @end
// // ShowView.h // xiaoA // // Created by qianshi on 16/5/27. // Copyright © 2016年 chenlingang. All rights reserved. // #import <UIKit/UIKit.h> @interface ShowView : UIView @property (nonatomic, strong) UITextView *textViewP; @property (nonatomic, strong) UITextView *textView; @end
// // CAThread.h // CrossApp // // Created by Zhujian on 14-9-1. // Copyright (c) 2014 http://www.9miao.com All rights reserved. #ifndef __CrossApp_CAThread__ #define __CrossApp_CAThread__ #include "platform/CCPlatformMacros.h" #include "ccMacros.h" #include "CASyncQueue.h" #include <pthread.h> NS_CC_BEGIN enum ThreadRunType { ThreadRunDirectly, ThreadRunNotify }; typedef bool (*ThreadProcFunc)(void* lpParameter); class CC_DLL CAThread { public: CAThread(); virtual ~CAThread(); void start(); void startAndWait(ThreadProcFunc func); void notifyRun(void* param); void clear(bool bFree=false); void close(); void closeAtOnce(); void setMaxMsgCount(int v); bool isRunning(); //-- put the initialization code here. virtual void OnInitInstance() {} //-- put the main code of the thread here. virtual void OnRunning() {} //-- put the cleanup code here. virtual void OnExitInstance() {} private: static void* _ThreadProc(void* lpParameter); pthread_t m_hThread; pthread_mutex_t m_SleepMutex; pthread_cond_t m_SleepCondition; int m_iMaxMsgCount; CASyncQueue<void*> m_ThreadDataQueue; ThreadProcFunc m_pThreadFunc; bool m_bIsRunning; ThreadRunType m_ThreadRunType; }; NS_CC_END #endif // __CrossApp_CAThread__
// Sums a series of numbers #include <stdio.h> int main(void) { int n, sum = 0; printf("This program sums a series of integers.\n"); printf("Enter integers (0 to terminate): "); scanf("%d", &n); while (n != 0) { sum += n; scanf("%d", &n); } printf("The sum is: %d\n", sum); return 0; }
#ifndef MATHLIB_PLANE_H_INCLUDED #define MATHLIB_PLANE_H_INCLUDED #include "MathLib_Vector4.h" namespace MathLib { class plane { public: vector4 pointOnPlane; vector4 normal; plane() { } plane(const vector4& pointOnPlane, const vector4& normal) { MathLib::vector4_copy(plane::pointOnPlane, pointOnPlane); MathLib::vector4_copy(plane::normal, normal); } plane(float pointOnPlane_x, float pointOnPlane_y, float pointOnPlane_z, float normal_x, float normal_y, float normal_z) { pointOnPlane.setXYZW(pointOnPlane_x, pointOnPlane_y, pointOnPlane_z, 1.0f); normal.setXYZW(normal_x, normal_y, normal_z, 0.0f); MathLib::vector4_normalize(normal); } plane(const plane& other) { MathLib::vector4_copy(plane::pointOnPlane, other.pointOnPlane); MathLib::vector4_copy(plane::normal, other.normal); } MATHLIB_INLINE void setPointOnPlane(const vector4& pointOnPlane) { MathLib::vector4_copy(plane::pointOnPlane, pointOnPlane); } MATHLIB_INLINE void setNormal(const vector4& normal) { MathLib::vector4_copy(plane::normal, normal); MathLib::vector4_normalize(plane::normal); MathLib::vector4_setToVector(plane::normal); } MATHLIB_INLINE void setNormal(float x, float y, float z) { plane::normal.setXYZW(x, y, z, 0.0f); MathLib::vector4_normalize(plane::normal); MathLib::vector4_setToVector(plane::normal); } MATHLIB_INLINE const vector4& getPointOnPlane() const { return pointOnPlane; } MATHLIB_INLINE const vector4& getNormal() const { return normal; } } MATHLIB_ALIGN(16); MATHLIB_INLINE void plane_copy(plane& dest, const plane& src) { vector4_copy(dest.pointOnPlane, src.pointOnPlane); vector4_copy(dest.normal, src.normal); } } #endif // MATHLIB_PLANE_H_INCLUDED
#pragma once namespace tmx { class Polygon { }; }
// // Created by azu on 2013/05/06. // #import <Foundation/Foundation.h> extern const struct GrowlAttributes { __unsafe_unretained NSString *key; } GrowlAttributes; @interface GrowlConst : NSObject + (void)notifyTitle:(NSString *) title description:(NSString *) description context:(id) context; @end